Game Development Reference
In-Depth Information
Overview of a Heads-Up Display
In this section, I will cover the basic features of our heads-up display, as well as the necessary
classes that we will need to create to support the HUD.
Overview of Our HUD
Our HUD is composed of components of the HUDItem class. The actual graphic images for each
HUD item are a BillBoard class that implements a 2D billboarding system. In billboarding, a flat
rectangle with the image of the items we want to display on the HUD, such as scores and the
player's health, are placed in front of the camera and turned toward the camera, so that the images
appear flat (see Figure 6-1 ). HUD items are updated by directly copying the new graphics data to the
texture associated with the HUD item.
Figure 6-1. HUD diagram
Creating the BillBoard Class
In billboarding, the basic idea is to take a 2D rectangular image and turn it, so that it faces the
camera. Generally, this is used as a cheap way to make a 2D image look three-dimensional.
Billboarding is accomplished in our BillBoard class, which I cover in this section.
The BillBoard class is derived from the Cube class, which is derived from the Object3d class.
public class BillBoard extends Cube
 
Search WWH ::




Custom Search