# n-control points for bezier

I was wondering if there was a way to make n control points for bezier curves in opengl.

``````glMap2f(GL_MAP2_VERTEX_3,       // Type of data generated
0.0f,                           // Lower u range
10.0f,                          // Upper u range
3,                              // Distance between points in the data
3,                              // Dimension in u direction (order)
0.0f,                           // Lower v range
10.0f,                          // Upper v range
9,                              // Distance between points in the data
3,                              // Dimension in v direction (order)
&TempPatchPtr-&gt;CtrlPoints[0][0][0]);     // array of control points
``````

at the moment all this can do is use 3 control points.

Please explain what you mean here:
“if there was a way to make n control points for bezier curves in opengl.”, because there are generally two types of bezier curves used in CAGD:
At first we have Bezier curves of order n, which are described by n+1 control points, their basis is Bernstein-Bezier polys of order n, have C(n) continuity and require full recomputing at every contr. pt change.
Second we have composite bezier curves, which are composed from k bezier curves of order n(the first type ). The last point of the j-th curve is also the first point of (j+1)-th curve and etc. They have C(n) continuity at the inner curves and only C(0) at the connection poits. However there are different approaches to have better continuity at these points, which requires additional conditions for control points of the connecting curves. The benefit is that often when you modify one point from the curve, you must recalc only one or two segment curve, dependent of the point position. These curves are also faster calculated.

Althought I have never used OpenGL API for Bezier/BSpline rendering,(I have my written own funcs for calculating the aproximations) in documentation is clearly specified that you can use more points -
void glMap1f(
GLenum target,
GLfloat u1,
GLfloat u2,
GLint stride,
GLint order, //The number of control points. Must be positive.
const GLfloat *points
);
I think, this is the case for the first type curves.
And also glMap2f() is used for surfaces, not for curves, but the story with the control points is exactly the same, as for the curves, with this exception that you have PxL contol points - P in u parametric direction, and L in v. However bulding composite Bezier surfaces with better continuity at the connection lines is more complicated…
Hope this helps