I am trying to draw a smooth surface from some control points
( the bottom of the sea from real lat, lon and depth data). The data I have include 8x8 points. Each have x, y, Z value.
I build a
GLfloat pfControlPoints[8][8][3];
then I assigned the real value to the 3-dimensional array.
then I did the following
GLfloat Knots1[16] = {0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3};
GLfloat Knots2[16] = {0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3};
glPushMatrix();
gluBeginSurface(m_pNurb);
gluNurbsSurface(m_pNurb,
16, Knots1,
16, Knots2,
3*8,
3,
&(pfControlPoints[0][0][0]),
4, 4,
GL_MAP2_VERTEX_3);
gluEndSurface(m_pNurb);
glPopMatrix();
The problem is my virtual memory went up very high and my computer got killed.
I tried 4X4 points, The program works just fine. I fuuny thing is, all examples I found are use 4x4 control points.
I tried 6x4, only 4x4 points are connected by the nurb. Are there any restrictions to the NURB. Does it only take 4X4 control points?
thanks a lot
jim