CS4620/4621 Viewing Demo

The demo requires Java Web Start to run, and it is here. It uses the JOGL native library, but this ought to be installed automatically and transparently to you. You can find the source code in CMS (if you are in the class).

Here is a screenshot:

Principles

The Camera viewport shows the view of a scene containing a bunny mesh (courtesy Stanford Graphics Lab) near the origin, with the usual x, y, and z axes shown. You can control this camera using the mouse in that viewport. The other three viewports give from-the-outside views of the relationship between the view frustum and the geometry in world space, eye space (aka. camera space), and clip space (OpenGL speak for the canonical view volume).

When you adjust the camera in the Camera view, watch how the bunny and the view frustum change (or don't change) in the different spaces.

Literally, what is drawn in these three viewports is the bunny and a 2-unit cube, under different transformations, and the grid and axes drawn in world coordinates. In the World view, the bunny gets no transformation and the cube is transformed by inverse(camera matrix) * inverse(projection matrix). In the Eye view, the bunny is transformed by the camera matrix and the cube is transformed by inverse(projection matrix). In the Clip view, the bunny is transformed by (projection matrix) * (camera matrix) and the cube is not transformed.

Controls

The controls are the same in all viewports—it's just that adjusting the Camera view camera changes what's shown in the other three views. The controls all use the mouse buttons, with many modifiers.

Switching to orthographic scales the view height so that the projections match at the distance of the camera's target point.