Javier Gonzalez-Sanchez | SER431 | Fall 2018 | 8
jgs
6 curves x 6 control points per curve
const int V_size = 6;
const int U_size = 6; // curves in blue color
const int ORDER = 4;
GLfloat ctlpoints[U_size][V_size][3] = {
{ { 25, 5, 15 } ,{ 20, 5, 15 },{ 0, 0, 15 },{ -5, 0, 15 },{ -10, 5, 15 } ,{ -15, 5, 15 } },
{ { 25, 5, 10 } ,{ 20, 0, 10 },{ 0, 0, 10 },{ -5, 0, 10 },{ -10, 0, 10 } ,{ -15, 5, 10 } },
{ { 25, 0, 5 } ,{ 20, 0, 5 },{ 0, 15, 5 },{ -5, 15, 5 },{ -10, 0, 5 } ,{ -15, 0, 5 } },
{ { 25, 0, -5 } ,{ 20, 0, -5 },{ 0, 10, -5 },{ -5, 10, -5 },{ -10, 0, -5 } ,{ -15, 0, -5 } },
{ { 25, 5, -10 } ,{ 20, 0, -10 },{ 0, 0, -10 },{ -5, 0, -10 },{ -10, 0, -10 } ,{ -15, 5, -10 } },
{ { 25, 5, -15 } ,{ 20, 5, -15 },{ 0, 0, -15 },{ -5, 0, -15 },{ -10, 5, -15 } ,{ -15, 5, -15 } }
};
GLfloat uknots[U_size + ORDER] = { 0.0, 0.0, 0.0, 0.0, 1.0, 3.0, 5.0, 5.0, 5.0, 5.0 };
GLfloat vknots[V_size + ORDER] = { 0.0, 0.0, 0.0, 0.0, 1.0, 3.0, 5.0, 5.0, 5.0, 5.0 };
gluBeginSurface(theNurb);
gluNurbsSurface(theNurb,
U_size + ORDER, uknots, V_size + ORDER, vknots,
V_size * 3, 3,
&ctlpoints[0][0][0],
ORDER, ORDER, GL_MAP2_VERTEX_3);
gluEndSurface(theNurb);