# Jogl Demos - Documentation

This workspace contains the source code to demos for the Jogl package. To build the demos:

- Check out and build the Jogl sources from http://jogl.dev.java.net/; note that these sources must go into a sibling directory to the jogl-demos directory
- Unset your CLASSPATH environment variable
- cd into the "make" subdirectory of the jogl-demos workspace and type "ant" (Ant can be obtained from http://ant.apache.org/

To run the demos:

- Add the built jars to your CLASSPATH (jogl-demos.jar, jogl-demos-util.jar, jogl-demos-data.jar)
- Run one of the demos from the command line: e.g. `java demos.gears.Gears` (Note: the current working directory is not important)

# Hardware and Software Requirements

The demos currently have the following hardware and software requirements:

demos.gears.Gears | none
demos.hwShadowmapsSimple.HWShadowmapsSimple | Pbuffer support, ARB_shadow, ARB_depth_texture
demos.infiniteShadowVolumes.InfiniteShadowVolumes | none
demos.proceduralTexturePhysics.ProceduralTexturePhysics | Pbuffer support, ARB_vertex_program, ARB_fragment_program
demos.vertexArrayRange.VertexArrayRange | NVidia GeForce family card. Runs on Windows and Linux (Jogl's vertex_array_range support not yet ported to Mac OS X).
demos.vertexBufferObject.VertexBufferObject | ARB_vertex_buffer_object
demos.vertexProgRefract.VertexProgRefract | ARB_vertex_program and either ARB_fragment_program or NV_register_combiners
demos.vertexProgWarp.VertexProgWarp | ARB_vertex_program

# Per-demo controls

## Hardware Shadow Mapping

- Alt + left click and drag: rotate camera about focal point
- Alt + right click and drag: translate camera parallel to image plane
- Alt + left + right click and drag: zoom camera in/out
- Click and drag on the faces of the manipulators (look for the yellow highlight of the faces upon mouse over) to translate the manipulator parallel to that face. Use the handles outside the boxes to rotate, and the handles at the corners of the boxes to scale.
- Escape key or 'q' quits.
- Space bar cycles through view options. Shadowed view; view from light source; unshadowed view.
- 'v' recenters camera on object

## Infinite Shadow Volumes

- Alt + left click and drag: rotate camera about focal point
- Alt + right click and drag: translate camera parallel to image plane
- Alt + left + right click and drag: zoom camera in/out
- Click and drag on the faces of the manipulators (look for the yellow highlight of the faces upon mouse over) to translate the manipulator parallel to that face. Use the handles outside the boxes to rotate, and the handles at the corners of the boxes to scale.
- 'w' toggles wireframe view
- 'c' recenters camera on object
- Space bar toggles animation of figure
- 'v' toggles visualization of shadow volume

## Vertex Prog Warp

- Left click + drag: rotate camera about focal point
- Right click + drag: translate camera parallel to image plane
- Left + right click and drag: zoom camera in/out
- 'w' toggles wireframe mode
- Escape or 'q' quits
- 'r' resets the demo (including recentering object)
- left/right arrow keys cycle through warp effects
- 'h' produces a help screen
- '-'/'+' decreases/increases amplitude of deformation
- '['/']' decreases/increases frequency of deformation
- '1'..'5' changes model being viewed
- Space bar toggles animation

## Vertex Prog Refract

- Left click + drag: rotate camera about focal point
- Right click + drag: translate camera parallel to image plane
- Left + right click and drag: zoom camera in/out
- 'w' toggles wireframe mode
- Escape or 'q' quits
- '1' .. '4' changes model being viewed
- 's' toggles multipass rendering for chromatic aberration effect
- 'v' recenters the camera on the object
- Space bar toggles animation

## Procedural Texture Physics

- Alt + left click and drag: rotate camera about focal point
- Alt + right click and drag: translate camera parallel to image plane
- Alt + left + right click and drag: zoom camera in/out
- Space bar toggles animation
- 'r' resets the demo
- 'c'/'v' decrease/increase blur increment
- '-'/'=' decrease/increase bump scale
- 'l' (lowercase “L”) toggles effect of spinning and static textures on the water
- ','/'.' decrease/increase frequency of droplets