Homework # 2 -- 3D Animation

Our assignment was to implement the basic 3D matrix transformations and to make something cool. I experimented with "true" 3D using parallax. The two cubes at right are identical but rotated in towards each other, ever so slightly. To see how it works, hold a piece of paper perpindicular to the screen and in the center between the two cubes, so each eye can only see one cube. Then try to cross your eyes until the cubes fuse. You may also want to use the keyboard controls to change the orientation of the cubes to better suit your eyes. If you can't get it to work, don't strain yourself :-) This is a work in progress. Check back again soon :-) One hint, it seems to work best with smallish cubes like the ones at right, otherwise the cubes overlap each other and you get funny shapes.
You can also use the keyboard to zoom in/out, or click and drag to spin the animation.


Keyboard (click the applet once to give it "focus" before trying these)

UP ARROW -- Zoom in
DOWN ARROW -- Zoom out
RIGHT ARROW -- Spread cubes apart
LEFT ARROW -- Bring cubes together
. -- swivel cubes towards each other
, -- swivel cubes away from each other


Mouse

Click and drag to rotate cube
Click mouse button to toggle spinning on/off

This was my first stab at lots of new things:
  • 3D animation (minus perspective)
  • Rotation, translation, scaling of 3D drawings
  • Keyboard commands
  • Parallax


This work is being done as part of Prof. Ken Perlin's Graduate Computer Graphics Course (G22.2270-001) at NYU.

Source code:
Animation3D.java extends BufferedApplet.java
Matrix3D.java