Jump to content
  • Advertisement


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


ModelView problem

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

Okay I have a model and eventially want to draw a line to another object. The problem that I am having is that when I use the following code, the drawn object should be fixed when I translate or rotate the model. At first I blamed it on my inversion function. But I tried replacing it with the ones from Graphic Gems and the one found in Mesa. Anyone have any suggestions. Btw, I am using Windows and the MS version of opengl. typedef double GLMatrix[16] ; GLMatrix objMatrix, objInverseMatrix ; glMatrixMode(GL_MODELVIEW) ; // Rotate and translate here PushMatrix() ; glBegin(GL_QUADS) ; // Draw something glEnd() ; glGetDoublev(GL_MODELVIEW_MATRIX,obj2Matrix) ; InvertMatrix(objMatrix,objInverseMatrix) ; glLoadMatrixd(objInverseMatrix) ; glBegin(GL_QUADS) // Draw Something here that stays put relative to the // first thing I drew. glEnd() ; PopMatrix() ; One other strange behavior is that when I use GL_POINTS, I get two points one in the right place on in the wrong. Not so with any other of the drawing modes.

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!