17 lines
439 B
C++
17 lines
439 B
C++
|
|
#include <iostream>
|
||
|
|
#include "vde/curves/bezier_curve.h"
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
using namespace vde::curves;
|
||
|
|
BezierCurve curve({
|
||
|
|
{0,0,0}, {1,2,0}, {3,2,0}, {4,0,0}
|
||
|
|
});
|
||
|
|
std::cout << "Cubic Bezier, degree=" << curve.degree() << "\n";
|
||
|
|
for (int i = 0; i <= 10; ++i) {
|
||
|
|
double t = i / 10.0;
|
||
|
|
auto p = curve.evaluate(t);
|
||
|
|
std::cout << "t=" << t << " -> (" << p.transpose() << ")\n";
|
||
|
|
}
|
||
|
|
return 0;
|
||
|
|
}
|