< Zurück | Inhalt | Weiter >

6.5.1 Billboards and LOD behaviors

Java 3D implements Billboard (rotate the object to face the viewer) and LOD (vary the geometry of objects depending on distance from viewer) as operations that directly manipulate the scenegraph. This obviously has implications when there is more than one viewer: if the Billboard Behavior rotates an object to face Viewer1, it cannot simultaneously rotate the object to face Viewer2.

If there is more than one active View, the Billboard and LOD Behaviors will use the orientation and distance information from the first View attached to the live ViewPlatform. This is defined as the primary View for the Behavior and can be returned using the Behavior.getView() method.

The OrientedShape3D class defines a variant of the Shape3D class that is always aligned to face the viewer, irrespective of View.

Sun will be offering more complete support for multiple Views in forthcoming releases, so check the latest details at the Sun Java 3D site.