PDA

View Full Version : double window management



selcux
12-21-2005, 01:56 PM
hi
I perform terrain rendering in 2 windows.
first one has pespective, second one has orthographic projection. When I change terrain dynamically, I cannot see it in orthographic window any more. But it works for perspective one.
2 wndows are seperated not subwindow.
does anyona knows something about this problem?

12-21-2005, 09:52 PM
You need to completely define each viewport's transformations. The viewport transformation itself is part of the total transformation, along with the camera's position and orientation, and projection. That the viewport happens to be embedded in another physical window is largely irrelevant.

For your perspective view, use gluPerspective or glFrustum along with your camera transformations. For your orthographic view, use glOrtho along with your camera transformations. Really, the camera part is the same for all the different views. What changes is the way you project the scene, and the size and shape of the viewport (aspect ratio).