PDA

View Full Version : glViewport and glFrustum



ToddAtWSU
10-25-2006, 12:33 PM
I was wondering if when I change my viewport using glViewport does it change my frustum? I am thinking it does not change it since my camera is not changing positions and just which part of the screen I am drawing to. Am I correct in this thinking or does changing my viewport subsequently change my frustum.

10-25-2006, 08:22 PM
You may or may not find the chapter on viewing revealing. ;)

http://www.rush3d.com/reference/opengl-redbook-1.1/chapter03.html

dorbie
10-25-2006, 09:56 PM
Yes you are correct, but you should realize that the results of your frustum on the projection transformation will be 'squeezed' into the viewport's 2D region, this can also be asymmetric, so if you change the aspect ratio of your viewport the image may apear stretched unless you adjust the frustum to match.

So, think of the projection as generating a photographic negative, and the viewport as printing that negative to a region of the screen (of course this is only w.r.t. transformation results, don't take the analogy too far).

heath
10-27-2006, 03:20 AM
Check out the Nate Robins tutorials, I think you'll find them quite enlightening.

http://www.xmission.com/~nate/tutors.html