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, &pfControlPoints[0][0]);
I don’t know why. Could you help me? Thanks in advance!