Jump to content
  • Advertisement
Sign in to follow this  

Fit object in camera view

This topic is 2023 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.


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
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!