Skip to content

Commit

Permalink
better coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangliangNan committed Feb 3, 2025
1 parent 40d3127 commit b5ab137
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tutorials/Tutorial_603_Curves/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ int main(int argc, char** argv) {
};
create_drawable(viewer, points, vec3(0, 0, 0)); // this is the control polygon

const int resolution = 50; // Number of line subdivisions to display the spline
const int resolution = 100; // Number of line subdivisions to display the spline

add_Bezier(viewer, points, resolution, vec3(1, 0, 0));
add_BSpline(viewer, points, resolution, vec3(0, 1, 0));
Expand All @@ -107,10 +107,10 @@ int main(int argc, char** argv) {
fitter.set_ctrl_points(points);
std::vector<vec2> curve_points;
for(int i = 0; i < resolution; ++i) {
const vec2 p = fitter.eval_f( float(i) / float(resolution-1) );
const vec2 p = fitter.eval_f( static_cast<float>(i) / static_cast<float>(resolution - 1) );
curve_points.push_back(p);
}
create_drawable(viewer, curve_points, vec3(0, 0, 1));
create_drawable(viewer, curve_points, vec3(0, 1, 1));
}

{
Expand All @@ -121,10 +121,10 @@ int main(int argc, char** argv) {
interpolator.set_points(points);
std::vector<vec2> curve_points;
for (int i = 0; i < resolution; ++i) {
const vec2 p = interpolator.eval_f(float(i) / float(resolution - 1));
const vec2 p = interpolator.eval_f(static_cast<float>(i) / static_cast<float>(resolution - 1));
curve_points.push_back(p);
}
create_drawable(viewer, curve_points, vec3(0, 1, 1));
create_drawable(viewer, curve_points, vec3(1, 0, 1));
}

// run the viewer
Expand Down

0 comments on commit b5ab137

Please sign in to comment.