[spinning PIC] Chapter 8.   Backgrounds and Overlays


In chapter 7, I described several ways of making detailed backgrounds which look different when viewed from different places in the scene. The techniques all utilize textures wrapped over 3D geometries connected to the scene graph.

This chaper considers a different approach: the background is represented by a standard BufferedImage, which is drawn separately from the rest of the scene graph. This means that a large variety of image processing techniques become available for modifying the graphic at run time.

The approach uses mixed mode rendering, where most of the scene is built using a scene graph, but the background is created outside the scene graph structure.

Mixed mode rendering also makes it very easy to create overlays: semi-transparent areas on screen where text or graphics can be drawn in the foreground without obscuring the gameplay underneath. I'll describe how to draw overlays composed from text and images.

There are three examples in this chapter:

  1. A scene made up of three 'planets' (actually textured spheres) with a static background of stars. This shows the basic technique for background creation with mixed mode rendering.
      [ObjView3D PIC]
  2. The same three planets scene, but with a rotating background of stars. The background image is rotated by a separate thread, using an affine transformation. This illustrates how to manipulate the background at run time.
  3. A variant of the 3D model application, ObjView3D, from chapter 7. When the user turns left or right, the background is shifted by a small amount as well. Overlays are part of this example.




Dr. Andrew Davison
E-mail: ad@fivedots.coe.psu.ac.th
Back to my home page