Jump to content
  • Advertisement
Sign in to follow this  
Lidestro

OpenGL Where am I drawing?

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

I'm creating a solar system, it's all very neat and simple with this matrix math, not a single cosine do I have to calculate to make the planets fly around their concentric ellipse in different orientations. But, since OpenGL does all of the hard part of calculating where to draw the object in the glTranslate, glRotate and glScale functions I have no idea where they actually end up, and I need their coordinates in a common coordinate system to do the collision checking etc. I thought I could extract the current matrix in some way, before drawing the object, and then calculate the coords from that, but I haven't found a way of doing that. Any suggestions of strategies for solving this? (And does anyone know any good sources of information on these kind of more design related issues? I havn't seen much of that around.) Thanks in advance! /Lidestro

Share this post


Link to post
Share on other sites
Advertisement
Cheers! Maybe I can use that in some way. (Stragely, this function wasn't in my gl book or on several reference pages, but on msdn...)

But what is a good solution to this basic problem: I draw an object after a serie of translate, rotate and scale, and than I have to find out WHERE I drew it?

/Lidestro

Share this post


Link to post
Share on other sites
You can use that matrix to transform the point or vector that describes the planets location, and you'll get its actual location.

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!