Where am I drawing?
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
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
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
You can use that matrix to transform the point or vector that describes the planets location, and you'll get its actual location.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement