View Full Version : glViewport and glFrustum
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.
You may or may not find the chapter on viewing revealing. ;)
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).
10-27-2006, 03:20 AM
Check out the Nate Robins tutorials, I think you'll find them quite enlightening.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.