Jump to content
  • Advertisement
Sign in to follow this  
MrCodeSushi

Fit object in camera view

This topic is 1847 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 thinking of a simple camera behavior where the camera would smoothly zoom in to an object but just enough that the entire 3d model would perfectly fit in the camera's view. More specifically, i'm creating a 3D textured quad with GUI elements rendered in the texture then the camera would zoom in to that quad until it would look like as if it was rendering quads in an orthographic projection; but it would still be in perspective projection. Kind of like similar to what Windows Aero View does when it transitions back.

Windows_7_Aero.jpg

I'm drawing blank on where to start on the math for this behavior. Can anyone be so kind to explain the mathematics for this? Pseudo-code would even be much helpful. smile.png Edited by BrentChua

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!