Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Question to OpenGL Evaluator

  1. #1
    Junior Member Regular Contributor LangFox's Avatar
    Join Date
    Oct 2001
    Location
    Shen Zhen, Guangdong, China
    Posts
    103

    Question to OpenGL Evaluator

    Hello everyone,
    I tried evaluator today, the following is origin code:
    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:
    Code :
    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!
    Best Regards,
    LangFox


    http://hi.baidu.com/lang_fox

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: Question to OpenGL Evaluator

    Check the maximum order your implementation supports; glGetInteger with GL_MAX_EVAL_ORDER. I bet you can't use more than 8 points.

  3. #3
    Junior Member Regular Contributor LangFox's Avatar
    Join Date
    Oct 2001
    Location
    Shen Zhen, Guangdong, China
    Posts
    103

    Re: Question to OpenGL Evaluator

    Yes, that's it!
    Thank you.
    Best Regards,
    LangFox


    http://hi.baidu.com/lang_fox

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •