glViewport and glFrustum

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. :wink:

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

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).

Check out the Nate Robins tutorials, I think you’ll find them quite enlightening.

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