Jump to content
  • Advertisement

Archived

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

Tylon

Position of a point after transformations.

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

Here is my problem: I apply several translations and rotations, and several PushMatrix operations, and I draw a single point at (x,y,z). What i would like to know is how to get the position of that point after i have popped all the matrices that i pushed. i.e i want the resultant x,y,z position that all the transformations had on the initial point. for example if i do glTranslate(0, 5, 0); glVertex(3, 5, 2); i want to be able to get the point (3, 10, 2), ie the point relative to my starting situation before all the transforms. Any help would be much appreciated.

Share this post


Link to post
Share on other sites
Advertisement
i think you can get the modelview matrix and do something like:


glGetFloatv( GL_MODELVIEW_MATRIX, &Matrix );
RealPoint = Matrix * Point;


[edited by - sphinx23 on November 9, 2003 2:34:24 PM]

Share this post


Link to post
Share on other sites

  • 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!