Here we have a collections of example joogl programs. We have included images and movies (where appropriate) so that you can see what the output should look like.
A simple program containing a sphere and a single ambient light. The camera is not in the scene graph and there are no transformations that inherit down the graph. | Java Source | |
Add a directional and a positional light to the previous program. | Java Source | |
Add the camera to the scene graph. Translate the camera node up and to the right with a Transform property. |
Java Source | |
Demonstrate a collection of polygons. This is actually 25 polygons (a 5x5 grid), which are affected much more reasonably by the positional light than a single large square would be. | Java Source | |
Same program as above, but change the rows of squares to be different colors, to show that there is more than just one sqaure. The squares in each row are the same color. | Java Source | |
Here is a Quicktime of the animation. |
Demonstrate editing the graph while running. After the scene is set up, we enter an infinite loop changing the transformation on the camera so it moves in a circle. A quicktime of what it looks like is included. |
Java Source |
Demonstrate more transformations. 3 objects are positioned in different locations using transformations. The two small spheres are at the same location as two positional lights (a green and a red one). | Java Source | |
Here is a Quicktime of the animation. |
Demonstrate dynamic properties.
Clicking on the window pauses the clock. Clicking again starts it. |
Java Source |
Here is a Quicktime of the animation. |
Demonstrate two viewports, using different cameras to view a common scene graph. The two cameras are looking at the scene from opposite sides. The left camera is a perspective camera, the right is an orthographic camera. The two viewports also have different ambient light objects attached to them, resulting in a different overall color to the scene. As above, clicking toggles the clock to start/stop. |
Java Source |
A variation of the above, using a manual clock (and two perspective cameras). The clock is tied to the mouse X position. Dragging left and right moves the animation forward and backward. |
Java Source | |
Here is a Quicktime of the animation. |
Demonstrating spot lights and more interaction. This time, the mouse X and Y are tied to rotations around the Y and X axis, respectively. |
Java Source |
Same as the above, but the scene objects now have different drawing modes (line, point and fill). | Java Source |