02560 Web Graphics and Scientific Visualization

Week 2 - transformation, animation, camera, and the virtual trackball

The goal of this set of exercises is to introduce interactivity into your visualizations. More specifically, the objective is to enable you to rotate visualizations of three dimensional objects using the mouse. This functionality is commonly referred to as a virtual trackball. Mouse input, transformation and animation of 3D objects, and virtual camera handling is required to do this. Using mouse input was part of the week one exercises, so we will continue from there.
  1. Think about your visualization project and write some notes on your webpage in which you identify 3D visualizations in your project that it could be interesting to rotate interactively.

  2. Work through Chapter 4 of GL to learn basic transformations and anmiation. This should enable you to draw a rotating triangle in a canvas on your webpage.

  3. Move to 3D using Chapter 7 of GL. This should take you through the following steps:

  4. You are now ready to rotate an object using the mouse. To do this, work with subsection called Rotating an Object with the Mouse in Chapter 10 of GL.

  5. Now that you know how to implement a virtual trackball, use it to enable interaction with a visualization in your project.

  6. If you test the virtual trackball from GL for a while, you will discover that it does not always work well. Implementing a good virtual trackball is slightly more involved. Get inspiration from the lecture (or from the supplementary reading material, see below) to improve the rotations delivered by the trackball.

Reading Material

GL Chapters 4 and 7. More transformations and basic animation and toward the 3D world.
GL Chapter 10, the first subsection (pp. 357-360). Rotating an object with the mouse.
suppl. Henriksen, K., Sporring, J., and Hornbæk, K. Virtual trackballs revisited. IEEE Transactions on Visualization and Computer Graphics 10(2):206-216, March/April 2004.