Billboard Meshes

Billboard Meshes

A billboard mesh is a mesh that always faces the camera.  Billboard meshes are often just a single flat plane, but billboarding can also be used with more complex meshes.

A mesh can be flagged as a billboard mesh by adding a special game property to a Blender mesh object:

Image of the "Add Property" button on the logic panel of Blender's buttons window, highlighted in red

The game property should be of type "Bool", and the property name should be either "BB" or "Billboard".  In order for the property to take effect, the property value must be set to "True":

Billboard meshes rotate around their parent node, which is usually the "object node" that is automatically generated at the Blender object's pivot point.  If a billboard mesh's object node is excluded from export, the mesh will rotate around the next non-excluded ancestor node in the hierarchy.  If there is no non-excluded ancestor node, the mesh will rotate around the default exporter-generated root node at the origin point (0,0,0).

The side of a mesh that ends up facing the camera is determined by the orientation of the mesh's parent node (usually the mesh's own orientation, as taken from the auto-generated mesh node).  The "camera" can be thought of as always facing from the -Y axis of the mesh object to the +Y axis:

The "Up" direction is determined by the direction of the local +Z axis of the mesh's node.

In the example below, 9 meshes are set up with different rotations in 3D space.  The meshes have been "counter-rotated" in edit mode so that the labels on sides of the boxes are aligned with the world space axes.  After being exported, the mesh orientation in relation to the camera is determined by the orientation of each parent node (object orientation):


(billboard example in Blender)


(billboard example in Torque Showtool Pro)

Notes:

  • Node animations do not affect the orientation of billboard meshes, but do affect the positions of the billboard meshes.
  • If a Blender mesh object's auto-generated node is excluded from export, additional meshes that share the same non-excluded ancestor node may also be displayed as billboard meshes.  It is assumed by Torque that each billboard mesh has a unique parent node.

Billboard Example Model 

Download the billboard example model pictured above: BillboardExample2.zip

Z-aligned Billboard Meshes

Z-aligned Billboard Meshes are the same as ordinary billboard meshes, with one important exception:  Z-aligned Billboard meshes only rotate around their parent node's z-axis when attempting to face the camera.  This means that the z-aligned billboard meshes will not always perfectly face the camera, but only attempt to do so by rotating around their parent node's z-axis.

A mesh can be flagged as a billboard-z mesh by adding a special game property to a Blender mesh object:

The game property should be of type "Bool", and the property name should be either "BBZ" or "BillboardZ".  In order for the property to take effect, the property value must be set to "True":

Billboard-z meshes rotate around their parent node.  If the auto-generated Blender mesh object node for a billboard-z mesh is excluded from export,  the mesh will rotate around the next non-excluded ancestor node in the hierarchy.  If there is no valid non-excluded ancestor node, the mesh will rotate around the default exporter-generated root node at the origin point (0,0,0).

The side of a billboard-z mesh that ends up facing the camera is determined by the orientation of the mesh's parent node.  The "camera" can be thought of as facing from the -Y axis to the +Y of the mesh object, the same as an ordinary billboard mesh:

The "Up" direction is determined by the direction of the local +Z axis of the parent node.  For billboard-z meshes, this is also the only axis around which the mesh is free to rotate in its attempt to always "face" the camera.

Notes:

  • Node animations do affect the orientation of billboard-z meshes;  the parent node's z-axis continues to be the only axis around which the billboard-z mesh can rotate in its attempts to face the camera.  Rotating a billboard-z mesh object causes the axis of rotation for billboard-z mesh to change to match the new z-axis of the mesh.
  • Z-aligned billboard meshes suffer from matrix gimbal lock problems that will cause them to suddenly "flip" or rotate 180 degrees when the viewpoint is directly aligned with the z-axis of the mesh's node.  Care must be taken to ensure that the billboard mesh can never be viewed down the node's z-axis if this "flipping" is a problem for your particular application of billboard-z meshes.

  

Billboard-z Example Model 

Download the billboard-z example model: BillboardZExample2.zip

 

See also: