02560 Web Graphics and Scientific Visualization
Week 2
To illustrate transformations, animation, and use of the camera, this lecture provides an example of a quaternion-based virtual trackball.
The webpage is developed in the following steps:
- Drawing a cube in perspective (with the cube faces coloured by their normal directions).
- Rotate the cube using standard rotation matrices modified by mouse input.
- Replace rotation matrices by quaternions.
- Enable camera initialization, spinning, panning, and dolly.
Press F12 in your browser to view the source behind each step. The final result with a more complete text follows below.
Trackball Example
By Jeppe Revall Frisvad (based on GL and a pdf)
Mouse control: orbit - left button, dolly - middle button, pan - right button.