Jump to content
  • Advertisement
Sign in to follow this  

OpenGL How I calculate the camera for model viewer program

This topic is 2993 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 do not know how to start....
I want to create the model viewer by using openGl.
Problem is when I loaded model, I found that model is too small or cannot see.

I think it because of this...

gluLookAt(10.0, 1.0, 300.0,
0.0, 1.0, 0.0,
0.0, 1.0, 0.0);

How to calculate the ratio for this?

Whatever models which program loaded will appear with the proper size.

Thanks for any advice.

Share this post

Link to post
Share on other sites
I wouldn't play with the aspect ratio.

Here are some things you can search:
bounding box
bounding sphere

That's all you need. And a bit of geometry to calculate the distance of the camera from the object using the diameter of the bounding volume.

(Sit down, take a piece of paper and a pen, then work it out).

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!