View Full Version : Help!! Problem with Nurbsurface!!!!

03-14-2001, 12:26 AM
Hi, I am using gluNurbSurface to creat a nurb surface with (N+1)*(N+1) control points.

The (N+1)*(N+1) points are distrbute in the space as evenly spaced grids in a square. When I set the value step between n and n+1 point to be 1 (or integer), the surface can be draw correctly and can be seen.

While, when I change the steps to be 0.5 (or anything with decimal part), there will be (2N+1)*(2N+1) points, all other things like uknots, vknots, strides, orders are set accordingly to the change. But the surface is not drawn.
(I am sure the values of the control points are correct in the array).

Does anyone can help to solve the problem?

the code is like this

//Draw the surface with nurb surface
void DrawSurface()
GLfloat knots[2*(GRIDNUMBER+1)];
int i;

for(i=0; i<2*(GRIDNUMBER+1); i++)
else knots[i]=1;

gluBeginSurface( nurbSurface );
gluNurbsSurface( nurbSurface,
2*(GRIDNUMBER+1), knots,
2*(GRIDNUMBER+1), knots,
(GRIDNUMBER+1)*3, 3,
gluEndSurface( nurbSurface );

When the GRIDNUMBER is 20 and the values of the control points are mostly kind of integer value (like 10.0000, 9.0000), the surface can be drawn correctly.

While, when the GRIDNUMBER is 40 and the values of the control points are mostly kind of decimal value (like 10.0000, 9.5000), the surface can not be drawn (actually nothing is drawn I think).

I am sure that the values of the control points are given 100% correctly and the uknots, vknots, stride numbers are also correct.