A SERVICE OF

logo

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 elds:
csMFRef children (inherited from csGroup)
csEnum mode
csMFVec3f position
csVec3f axis
The mode eld species one of three billboard modes: AXIAL, POINT_SCREEN, and
POINT_OBJECT. The mode denes how the billboards children should be rotated to
face the viewer. Specic 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 screens +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 eld species 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 eld as
there are children.
The axis eld is used in AXIAL and POINT_OBJECT modes.