• Advertisement

Archived

This topic is now archived and is closed to further replies.

using evaluator to draw surfaces

This topic is 5154 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I understand that evaluators uses the start, end and control points to draw a 3D surface.The control points do not lie on the surface itself so to draw a 3D 1/4 hollow cylinder. What should the middle control point be? i tried these points: GLfloat ctrlPoints[3][3][3]={{{-d,0.0f,1.0f},{-d,-d,1.0f},{0.0f,-d,1.0f}}, //v=0 {{-d,0.0f,0.0f},{-d,-d,0.0f},{0.0f,-d,0.0f}}, //v=1 {{-d,0.0f,-1.0f},{-d,-d,-1.0f},{0.0f,-d,-1.0f}}};//v=2 assumming d is radius of cylinder. But somehow it doesn''t look that accurate. In addition the following code work when i use GL_LINE but not if i change it to GL_FILL, how do i resolve this? // 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); // 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); glEnable(GL_AUTO_NORMAL);

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement