Drawing bezier curve with limited subdivisions in OpenGL
- by xEnOn
Is it possible to tell OpenGL to draw a 4 degree (5 control points) bezier curve with 10 subdivisions?
I was trying with this:
point ctrlpts[] = {..., ..., ..., ...};
glMap1f(GL_MAP1_VERTEX_3, 0, 1, 3, 5, ctrlpts);
glBegin(GL_LINE_STRIP);
for (i = 0; i <= 30; i++)
glEvalCoord1f((GLfloat) i/30.0);
glEnd();
But this just draws the curve nicely. I am thinking that I want the algorithm inside the bezier curve to draw only until 10 subdivisions and then stop. The line should look a little facet.