Instructions
By clicking and dragging within the window you can apply various transformations to the displayed object.
You may switch to a specific view or model transformation by selecting its radio button.
Warning: Scaling is much more sensitive than the other transformations. On your first time scaling you will
probably notice that the points quickly dissapear. Please restart the applet (by clicking the "Restart" button),
and scale slower.
Source
- Object files: Contain commands to set up the viewing position and field-of-view of the
displayed window, including eye x y z, look x y z, up x y z, and fov angle_in_degrees
- Code
- TestMatrix.java - the test applet; displays the 3D points, and allows view/model transformations
- Matrix3D.java - implements a matrix class for transforming three-dimensional points, including:
- Scaling (scale method)
- Skewing (skew method)
- Rotation (rotate method)
- Translation (translate method)
- Perspective viewing (perspective method)
- Orthographic viewing (orthographic method)
- Point3D.java - represents a 3D coordinate
Requirements satisfied
- My Matrix3D class implements all methods described on
the project web page.
- I use my own test applet, TestMatrix.java, to display the functionality of my
Matrix3D class on this, my project web page. I chose to use the test program provided on the
project web page
as a starting point. My changes to it are as follows:
- Added java buttons on the right side of the applet.
- Added in code to detect button events, and tranform the view and model based on the state of these buttons.
- Display the time in the lower right of the applet instead of on the browser status bar.
- Added in debug code for testing.
- My test program exercises each method in Matrix3D.
Optional stuff sure to impress
- Added on chunky mode to display a pixel 9 times bigger, since, especially for the cube, some pixels are hard to see.
- Place timer on applet, showing how incredibly fast the points are transformed.
- Restart button, in case you overscale, or simply want to start over. :)-
- toString() and toString2() methods added to both Matrix3D and Point3D to allow pretty-printing
of transformation matrices in DEBUG mode.
- Pretty pastel colors to distinguish view vs. modeling tranformation radio buttons.
Issues
- I referred to Prof. McMillan's lecture notes, as well as the Hearns & Baker book,
to determine what calculations to implement in my transformation matrices.
- My applet should work on Netscape on the Suns.
- Unfortunately, it doesn't seem to work on the SGI's.
- While testing, I noticed that the model randomly disappears after rotation on MSIE 4.0.
I did not experience this problem, however, when testing on Netscape.
Acknowledgements
- I would like to thank TA's Kari-Anne and Jacob, and Prof. Teller for their assistance in
helping me understand and debug my transformations.
- Thanks go to my colleague Andres Tellez
for his assistance in helping me fix the "shrinking bull" problem (my cow would shrink whenever I rotated;
I normalized the incoming vector to fix this).
|