Jump to content
  • Advertisement
Sign in to follow this  
wong_bo

[MDX] zoom to selected rectangle

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

How do I let user to select a rectangle on the screen and zoom-in my 3D model to fit that rectangle? What I can think of is to unproject the center point of that 2D selection rectangle to a view plane, then translate the model to the negative value of that intersection point on the plane, then scale the model to the appropriate scale (screen to selection rectangle ratio). Is this a correct approach? If it is, I need to know how to obtain the view plane in the first place. The view plane is a plane that crosses the rotation center of the model and always parallel to the screen no matter how you rotate the model.

Share this post


Link to post
Share on other sites
Advertisement
Look for algorithms to extract the frustum planes from the transformation matrices. The view plane is the near plane in the view frustum.

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!