PDA

View Full Version : nothing appear using GL_FILL



coda
01-15-2004, 05:40 PM
i used the following code to draw a 3D 1/4 surface of a hollow cylinder along z-axis. When i use GL_LINE, the object appeared nicely but when i use GL_FILL, nothing appeared. What is the problem? I posted this in the beginner forum but no one replied so hope someone can help me here.

//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_LINE,0,10,0,10);

d:radius of cylinder, also does the order of specifying the control points affect the rendering? does it have to go in antiCW?

coda
01-15-2004, 06:15 PM
i get it now. I reverse the control coodinates and it appeared correctly