coordinates of points of surfaces

Started by
1 comment, last by apastukh 21 years, 11 months ago
How to receive coordinates of points of surfaces created by functions glEvalcoord () and glEvalmesh ()??
Advertisement
apastukh,

I''m going to move this thread to the OpenGL forum, since its specifically an OpenGL question and not a math/physics question.

But I believe I have an answer for you. You never have the opportunity to receive those coordinates directly. The functions glEvalcoord() and glEvalmesh*() internally evaluate and send the coordinates to the graphics card implicitly, as if you had directly called glColor*() or glTexCoord*() or glVertex*(). So you could do something like:

glBegin(GL_QUAD_STRIP);  glEvalMesh2();  glEvalMesh2();glEnd(); 


In this case, you never need to call glVertex*(). But you also never actually receive the coordinate values directly...

There may be a way to get OpenGL to emit the coordinates in a callback. But there probably is no guaranteed way, since glEvalMesh*() or glEvalCoord*() may be executed in GPU hardware.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Though it''s pretty simple. All those evaluators use general formula of summing all the points on curve and using time from 0.0 to 1.0. If you can wait, I''m implementing bezier patch using that general formula and my n degree bezier curve, so you''d be able to get any point on patch using t1 and t2. Or, you can do it yourself, go to my webpage, grap Bezier Curve module, and get the function GenDegree that calculates a point on curve using given time ''t''.
(Web page link below)
Cheers.

" Do we need us? "


Ionware Productions - Games and Game Tools Development

This topic is closed to new replies.

Advertisement