Amanda and Monta's Hofstadter trip-let applet:
Description:
This is an implemention of Hofstadter's "trip-let", seen on the cover of his book
Godel, Escher, Bach: An Eternal Golden Braid (see below for link to image).
The triplet starts with a solid cube; the shapes of three letters are then "punched"
into the cube from three orthogonal directions: the right side, the front, and
the top. Shadows are then produced by shinning a light from these three directions.
Our applet allows one to choose which letters to be punched out, and the letters chosen
are displayed on the left of the draw area. When the user clicks on the "PUNCH" button,
the code simulates the cube being punched and the resulting shadows are displayed on the
right of the draw area.
Implementation:
We modified our GEB.cpp source code from Assignment 8 to work
with Java classes. Classes we defined: GEBapplet - The backbone structure of the
applet; Letter - A class containing 27 2D arrays defining each character of the
alphabet; cubeViewArea - A class that extends the Canvas class, allowing us to draw
inside the applet.
Challenges:
Amanda did not know Java going into this semester and had to teach herself. Monta
didn't have much experience with Java applets, though she had taken a Java class.
We underestimated the difficulty of 3D graphics in Java. We learned from books and
online resources; Google was our friend.
We had initially planned to implement the trip-let display in three dimensions,
with a rotateable cube. However, we lacked the time and resources to learn how to
implement 3D rendering in Java. Instead, we decided to show the letters punched
into the cube, as well as the two-dimensional shadows produced when light is
projected onto the punched-out cube.
Links:
Amanda and Monta's proposal for a Java GUI.
Douglas Hofstadter's "trip-let"
Java Graphics Tutorial
Another Java Graphics
Tutorial
Java Sun Documentation