PDA

View Full Version : screen shows nothign when using GL_FILL for evaluators



coda
01-14-2004, 04:36 PM
I used the following code to show a 1/4 of a hollow cylinder lying along the z-axis. However, using GL_FILL i am able to see the mesh but nothing appear when i use GL_FILL. Need help urgently!

//drawing surface (Curved)
GLfloat ctrlPoints[3][3][3]={{{-d,0.0f,1.0f},{-0.9f*d,-0.9f*d,1.0f},
{0.0f,-d,1.0f}}, //v=0
{{-d,0.0f,0.0f},{-0.9f*d,-0.9f*d,0.0f},{0.0f,-d,0.0f}}, //v=1
{{-d,0.0f,-1.0f},{-0.9f*d,-0.9f*d,-1.0f},{0.0f,-d,-1.0f}}};//v=2

// the setup function
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)
&ctrlPoints[0][0][0]); // array of control points

// Enable the evaluator
glEnable(GL_MAP2_VERTEX_3);
glEnable(GL_AUTO_NORMAL);
glEnable(GL_NORMALIZE);
// Map a grid of 100 points from 0 to 100
glMapGrid2f(10,0.0f,10.0f,10,0.0f,10.0f);
// Evaluate the grid, using lines
glEvalMesh2(GL_FILL,0,10,0,10);

i set up my lightings in a function before this code so do not know what else is missing or incorrect.