Hi guys,
I’m drawing a pseudo-nurbs with line strips and draw the points and I want to draw the control vectors :
glMap2f( GL_MAP2_VERTEX_3,…)
// draw strips
// then draw points
for ( w=0; w<WidNbr; w++ )
for ( h=0; h<HgtNbr; h++ )
{
glBegin( GL_POINTS );
glEvalCoord2f( [x],[y] );
glEnd();
}
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.
Hi Relic,
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
Regards
Pierre
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.
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.