Archived

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

Position of a point after transformations.

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