Need help

Started by
6 comments, last by MetRaLHa1 22 years, 2 months ago
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.
Advertisement
You can query where OpenGL draws the polys using the feedback buffer.
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
thx u very much, i already investigated, well it is what i did want so thank u very much friend

best wishes,
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.
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.
one last thing do you know where can i get new GLU versions?
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.

This topic is closed to new replies.

Advertisement