screen show nothing when using GL_FILL for evaluator
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.
[edited by - coda_x on January 14, 2004 8:46:49 PM]
What code do you use for drawing, i think the problem lies there, and, when lighting is disabled, is it visible then with GL_FILL?
before the above code, i rendered other objects and they all appeared as expected and lighting was enabled in the beginning. the funny thing is, when i add another line: rotate by 180 abt y -axis such that it become mirror image, the surface works and appear but not when it is along the z-axis. Or could it be that the shape is already there but the somehow the lighting obscure it or something like that?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement