Jump to content
  • Advertisement
Sign in to follow this  
Eitsch

Get Coordinates of Transformed Geometry

This topic is 4856 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

an example: glPushMatrix(); glRotatef(39,1.0,0.0,0.0); glBegin(GL_POINTS); glVertex3f(x,y,z); glPopMatrix(); how do i get the position of the vertex? i don't want to use own algorithm for this (performance)

Share this post


Link to post
Share on other sites
Advertisement
you cant, once a vertex goes down the pipeline its lost to you, the only way to work it out is to pull back the modelview matrix and perform the maths yourself

Share this post


Link to post
Share on other sites
i heard something about "feedback" mode. does anybody know an example/tut?
if this doesn't work: how do i have to multiplicate my vertex with the transformed modelview elements?

thanks

Share this post


Link to post
Share on other sites
Sure you can, by using the feedback rendering mode. Check out glRenderMode and glFeedbackBuffer.

However, this is not the fastest way to do it, so performancewise, doing it yourself is likely to be faster. Just because OpenGL can do it for you doesn't mean it can do it faster than you can.

Share this post


Link to post
Share on other sites
the problem is:
i have to rotate a vehicle round strange axis and a recalculation is really terrible

okay. i will check feedback rendering mode out

thanks

Share this post


Link to post
Share on other sites
Given a point, you can perform all transformations on it, then read back the modelview matrix.

The transformed point will reside in the 12,13 & 14 elements of the retrieved modelview matrix.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!