Sign in to follow this  
wong_bo

[MDX] zoom to selected rectangle

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this