PDA

View Full Version : Question to OpenGL Evaluator



LangFox
12-03-2002, 04:07 AM
Hello everyone,
I tried evaluator today, the following is origin code:


:
GLfloat pfControlPoints[][3] =
{
{-5.0f, 5.0f, 0.0f}, {0.0f, 5.0f, 0.0f}, {5.0f, 5.0f, 0.0f},
{-5.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, {5.0f, 0.0f, 0.0f},
{-5.0f, -5.0f, 0.0f}, {0.0f, -5.0f, 0.0f}, {5.0f, -5.0f, 0.0f},
};

glEnable(GL_MAP1_VERTEX_3);
glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 9, &pfControlPoints[0][0]);
glBegin(GL_LINE_STRIP);
{
for(i = 0; i < 100; i++)
glEvalCoord1f((GLfloat)i/100);
}
glEnd();

I think the code is right, but it didn't work until I did some change to glMap1f() like this:



glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 8, &amp;pfControlPoints[0][0]);

I don't know why. Could you help me? Thanks in advance!

Bob
12-03-2002, 04:37 AM
Check the maximum order your implementation supports; glGetInteger with GL_MAX_EVAL_ORDER. I bet you can't use more than 8 points.

LangFox
12-03-2002, 05:24 AM
Yes, that's it!
Thank you.