Jump to content
  • Advertisement

Archived

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

wyrd

Retrieving the top x, y, z values from the matrix stack.

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

How would I go about getting the x, y, z values from the top matrix on the modelview matrix stack? Basically what I'm looking to do is make a few transformations, then grab those values and use them to move my camera around (using gluLookAt(...)). That way I don't have to recreate routines to do matrix multiplication. If there's a better way to achieve what I'm trying to do, I'm open for suggestions. Otherwise, here's an example of what I'm getting at; glPushMatrix(); glLoadIdentity(); glTranslatef(...); glRotatef(...); float vect3[3] = get_xyz_values_from_matrix_stack(); gluLookAt(vect3[0], vect3[1], vect3[2], ...); glPopMatrix(); EDIT: Oh ya.. thanks in advance for any and all help. [edited by - wyrd on June 1, 2004 12:00:41 AM]

Share this post


Link to post
Share on other sites
Advertisement

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