Transforms3D


Change Model: bunny triceratops fandisk pipe thing


Transforms3D is a simple applet that demonstrates the basics of three-dimensional geometric transforms. It displays a rendering of an object, and allows the user to transform the object using the mouse. Each transform operates by compositing a sequence of appropriate matrices, and applying the resulting matrix to a homogenous 3d vector.

To rotate the object, we use a "virtual trackball" metaphor. Imagine that the object was suspended in a large sphere; when you click on the screen with the left button, the mouse grabs the appropriate location on the sphere. Moving the mouse will rotate the sphere accordingly, and the object will rotate with it. This allows for arbitrary rotations around two axes. To rotate around the vector perpindicular to the screen, hold shift + left button.

We have implemented an immediate-mode OpenGL-like interface, which allows multiple types of primitives (changed with the space bar) and performs flat-shaded lighting. Models are dynamically loaded from the Internet and parsed at run time. You can change the current model by clicking the links above.

Note that the applet only uses back-face culling for hidden surface removal (it does not perform its own rasterization, making z-buffer testing difficult) so there can be some odd effects. However, back-face testing works pretty well for most models, especially the bunny. To see how bad it would look otherwise, press "b" to toggle back-face culling!


Left Mouse Button
Rotates the object around two axes using a "virtual trackball" interface
Shift + Left Mouse Button
Rotates the object around the vector perpindicular to the screen
Center Mouse Button
Translates the object in the x-y plane
Right Mouse Button
Scales the object in the current view plane
Space Bar
Switches through 4 view modes: filled, filled+wire, wire, and points
"b" Key
Toggles back face culling
"x" Key
Toggles drawing the axis lines
Escape Key
Resets movement parameters

The source for Transform3D is in the files:


Copyright © 2003 Christopher DeCoro