[MDX] zoom to selected rectangle

Started by
0 comments, last by darkelf2k5 17 years, 11 months ago
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.
Advertisement
Look for algorithms to extract the frustum planes from the transformation matrices. The view plane is the near plane in the view frustum.
Every time you implement a singleton, God kills a kitten. Please, think of the kittens!

This topic is closed to new replies.

Advertisement