|
At present, all the surface examples in books and on the Internet only have 4x4 control points. I extended it to 8x8 control points, which can draw the surface normally. However, it cannot be displayed if it reaches 10x10 or more. Is there a limit to the number of control points? But software like 3dsmax can insert countless control points. I need a surface to build a human body model. 8x8 control points are definitely not enough. Please see the code:
/ * Control point * /
GLfloat ctrlpoints [8] [8] [3] = {
/ * Call the 2D evaluation program * /
glMap2f (GL_MAP2_VERTEX_3, 0, 1, 3, 8, 0, 1, 24, 8,&ctrlpoints [0] [0] [0]);
GlEnable (GL_MAP2_VERTEX_3);
/* evaluate */
For (j = 0; j <= 8; j ++)
{
GlBegin (GL_LINE_STRIP);
For (i = 0; i <= 30; i ++)
GlEvalCoord2f ((GLfloat) i / 30.0, (GLfloat) j / 8.0);
GlEnd ();
}
There is no problem with the bezier surface drawn in this way, but when I change 8 to 10 or more, I can't draw it.
/ * Control point * /
GLfloat ctrlpoints [10] [10] [3] = {
/ * Call the 2D evaluation program * /
glMap2f (GL_MAP2_VERTEX_3, 0, 1, 3, 10, 0, 1, 30, 10,&ctrlpoints [0] [0] [0]);
GlEnable (GL_MAP2_VERTEX_3);
/* evaluate */
For (j = 0; j <= 8; j ++)
{
GlBegin (GL_LINE_STRIP);
For (i = 0; i <= 30; i ++)
GlEvalCoord2f ((GLfloat) i / 30.0, (GLfloat) j / 8.0);
GlEnd ();
}
Did I confuse control points, nodes, and order? So, what if you want to draw a bezier or nurbs surface with hundreds of control points? It is best to give the source code. Many thanks! |
|