< Zurück | Inhalt | Weiter >

11.8 Billboard behavior

java.lang.Object

|

+−−javax.media.j3d.SceneGraphObject

|

+−−javax.media.j3d.Node

|

+−−javax.media.j3d.Leaf

|

+−−javax.media.j3d.Behavior

|

+−−javax.media.j3d.Billboard


The following is from Sun’s Java 3D documentation: “The Billboard behavior node operates on the TransformGroup node to cause the local +z axis of the TransformGroup to point at the viewer’s eye position. This is done regardless of the transforms above the specified TransformGroup node in the scene graph. Billboard nodes provide the most benefit for complex, roughly symmetric objects. A typical use

might consist of a quadrilateral that contains a texture of a tree.”


This means that you can define some geometry and then attach a Billboard behavior to the TransformGroup controlling the position of the geometry. The Billboard behavior will ensure that the geometry is oriented consistently to the viewer. Unlike real billboards, Java 3D Billboards are equipped with stepper motors so that they are always perpendicular to you, regardless of your position relative to them. For example, your application might define a 3D virtual environment to model a town. To allow people using the environment to easily navigate the town, you might wish to have a sign with the name of each building attached to the roof of the building. How do you ensure that people will always see the front of all the signs, regardless of their position in the town? By attaching a Billboard behavior to each sign, Java 3D will automatically rotate the sign such that the face of the sign is perpendicular to each viewer’s line of sight.



 

NOTE
From BillboardTest.java