60
Chapter 4: Scene Graph Nodes
Using csBillboard
csBillboard is a subclass of csGroup. It is used to rotate its children to face the viewer at
all times. csBillboard has the following fields:
csMFRef children (inherited from csGroup)
csEnum mode
csMFVec3f position
csVec3f axis
The mode field specifies one of three billboard modes: AXIAL, POINT_SCREEN, and
POINT_OBJECT. The mode defines how the billboard’s children should be rotated to
face the viewer. Specific descriptions of each mode follow:
• AXIAL: In this mode, the local +z axis is rotated about the billboard axis to face the
viewer (i.e. to match the negation of the view vector).
• POINT_SCREEN: In this mode, the local +z axis is rotated to face the viewer. The
local +y axis is aligned with the screen’s +y axis.
• POINT_OBJECT: In this mode, the local +z axis is rotated to face the viewer. The
remaining degree of freedom is used to minimize the angle between the local +y
axis and the billboard axis.
The position field specifies a position to which each child should be translated after it has
been rotated to face the viewer. There should be as many entries in the position field as
there are children.
The axis field is used in AXIAL and POINT_OBJECT modes.