Jump to content
  • Advertisement
Sign in to follow this  
jcondon

GLModelview matrix newbie question

This topic is 4878 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 writing a simple openGL program that draws an object composed of triangles. I am using glrotate so you can spin it around and view it from different angles, however sometimes the points that make up the object are not centered around (0,0,0). So when it rotates, it rotates about (0,0,0) not the center of the object. Does anyone know how to change the point that glrotate rotates about? Thanks for your help. -James

Share this post


Link to post
Share on other sites
Advertisement
Yea originally I wanted to do that, but unfortunately Im getting the points from a file output from a different program. All of the objects are going to be different so I thought it would to difficult to do a good translation. I know a way I could estimate the center pretty easily so I was hoping there was some quick fix to make that the origin...

-James

Share this post


Link to post
Share on other sites
A easy fix is to find the senter of the mass.

Or you can find the min/max of x,y and z. Find the avrage of them
and rotate around that point. ( avrageX, avrageY, avrageZ )

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!