View Full Version : position
04-23-2000, 09:53 AM
I'm drawing a pseudo-nurbs with line strips and draw the points and I want to draw the control vectors :
// draw strips
// then draw points
for ( w=0; w<WidNbr; w++ )
for ( h=0; h<HgtNbr; h++ )
glBegin( GL_POINTS );
glEvalCoord2f( [x],[y] );
and I try to get back the real position of each point.
I have tried with glGetFloatv and glGetMapfv but I can't get it.
04-25-2000, 12:23 PM
glEval...() is not updating the current state, as far as I remember, so glGet...() on the current vertex will return the last glVertex() data instead.
I haven't understood the meaning of "control vectors" though. Do you mean the first derivatives in u and v direction at each point?
04-25-2000, 03:52 PM
Thanks for your answer,
My mean is to find the XYZ coordinates of the point I just drawn.
If glEval doesn't update this data is there any other way to get this information(without recalculate with algorythms :-(
04-25-2000, 10:20 PM
Sounds as if glRenderMode(GL_FEEDBACK) would return the data. That doesn't draw anything and isn't hardware accelerated normally.
But feedback is something I largely avoid.
Have a look in feedback.c of the redbook examples.
I did Bezier and B-spline patches myself after I had some weird experiences with two sided lighting with glEval. Haven't used glMap since then.
04-26-2000, 12:54 AM
So if you don't use glMap, what do you do? Do the calculations?
Do you think NURBS is more reliable?
04-26-2000, 02:49 AM
Depends on what you want to do. Knowing what happens in the graphics is always a plus.
I have written some algorithms which calculate the surface and normals of freeform patches for personal research. It's quick enough to be realtime editable, but I don't know how the code looks like anymore(three years ago, maybe), so I cannot offer it.
I rely on basic OpenGL features mainly. Stuff in libs I have no source access to must work or I simply kick it.
NURBS have less polygons than my algorithm, which simply interpolates in constant steps on u and v.
Give it a try. It's not that complicated with the glu lib, but if you need the final vertices for storing models you'll need the feedback buffer.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.