Archived

This topic is now archived and is closed to further replies.

Need help

This topic is 5794 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi all!, i need help with nurbs. i already defined a nurbs, but i need to retrieve vertex data in order to make some calculations to know if i am within a certain distance from it. thx you in advance.

Share this post


Link to post
Share on other sites
i was trying to use gluNurbsProperty(thenurb, GLU_NURBS_MODE, GLU_NURBS_TESSELATOR);

using this mode i could register some callback functions in order to retrieve de vertex, normal, etc, from the nurbs. But it seems to be implement just in glu.h version 1.3, but as i am using visual c++ 6.0, i guess my glu.h version is too old.

can´t seem to find where to get a new one.

i wanted to use visual .NET but i am not used to .NET interface yet.

well, could you be a little more specific about the feedbackbuffer?

thx

Share this post


Link to post
Share on other sites
you''re welcome


also, be careful of the coordinates that the feedback buffer returns.

these are the exact coordinates that the graphics card computes to draw the polygons, eg the vertices are tranformed using matrices.

For instance, a vertex coordinate x=0 y=0 means that the vertex is drawn at the lower-left corner og the window whatever the projection and modelview matrices are .

As a side effect, if you resize the window, vertex coordinates will change.
I''m not sure if you see what I mean, but you have to take care of what information OpenGL returns : as you seem to look for distances , you gotta use an orthographic projection matrix not to retrieve "stretched" coordinates.

Share this post


Link to post
Share on other sites
i read something about those side effects. I am making a game, in which specifies that the track must be a nurbs. well, i''ll need the point forming the nurbs in order to know if at a certain instance i am within the track. that''s why i need the vertex points of the track. i guess it can still be done with feedbackbuffer, if it all fails i''ll make the track with beziers, since i can specify an evaluator for it.

thx you once again, your help in unvaluable
au revoir.

Share this post


Link to post
Share on other sites
Oh well, I forgot to tell you the glu1.3 is NOT available.
I looked for it a few months ago, and the only thing that exists on it is the specifications
glu1.2 is available, though. but I bet you already know that, since you may be using glu1.2 .
Also, I speak about a few months ago. If glu1.3 has been implemented since, I would be pleased to know it !

About the "side effects" of the feedback buffer, you just have to know that you can master it if you define your own projection matrix as orthographic and if you scale/bias x and y coordinate depending on window dimensions.
Though, you have to be careful of the clipping frustum. Any vertex outside the frustum will be ignored.
I think that''s all you have to know. With a few tests on it, I''m convinced you''ll see how to use it *properly*.

Good luck for thy project.

Share this post


Link to post
Share on other sites