How to Implement an OpenGL Zoom Extents Function -


After

I open an application that navigates to a 3D environment, navigates actions such as orbit Let's go, pan, rotate, etc. It all works losslessly and significantly gluPerspective and gluLookAt .

> > > > > > > > > > > > M_Focus.Y, m_Focus.Z, m_ViewUP.X, M_VIPUP, M_VUUP Junklistlist DisplayPlanner Index

Similar to a ZoomExtents or ZoomToFit command in CAD software, any arbitrary approach (See direction), I want to be able to zoom so that (1) the entire 3D environment is visible, and (2) the 3D environment fills the entire viewport (given the current size of the viewport) Is as big as possible.

I know the demarcation box (expansion) of the environment (minimum XYZ, max XYZ) However, what I need to do is remove the eyes and the positions given focus should be done for ViewAngle and AspectRatio and environmental expansion Are there.

Perhaps there is an easy way to accomplish this, compared with gluLookAt . Any help is appreciated!

Actually this can be very easy.

What do you need to do to launch your model in an aircraft? Then, determine the highest and lowest digits (top y, bottom y, left-right x, right x), and finally determine how much scaling you need to fit this rectangle in the rectangle you will actually need.

Fortunately for you, you are already doing this.

Therefore, you already have to change every point of your model using the matrix. Set and set maximum points.

Calculate how much you should scale on the screen and apply this scaling to the zoom object

this


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -