java left logo
java middle logo
java right logo
 

Home arrow Other API Tips
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 4085
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
Using Billboard class to Implement billboad in Java 3D World E-mail
User Rating: / 4
PoorBest 

The term "billboard" used in computer graphics context refers to the technique of automatically rotating a planar visual object such that it is always facing the viewer.In Java 3D, the billboard technique is implemented in a subclass of the Behavior Class, thus the phrase "billboard behavior" used in Java 3D literature.

Here is the Billboard usage recipe:

  1. create a target TransformGroup with ALLOW_TRANSFORM_WRITE capability
  2. create a Billboard object referencing the target TransformGroup
  3. supply a scheduling bounds (or bounding leaf) for the Billboard object
  4. assemble the scene graph

Image

public BranchGroup createSceneGraph(SimpleUniverse su) {
     BranchGroup objRoot = new BranchGroup();
     
     ...
     
     // Create a TransformGroup object
     TransformGroup TGR = new TransformGroup()
     // Set the proper capability
     TGR.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE)
     
     // Create a Billboard object referencing to the TransformGroup object
     Billboard billboard = new Billboard(TGR);;
     BoundingSphere bSphere = new BoundingSphere();
     //Set the scheduling bounds
     billboard.setSchedulingBounds(bSphere);

     // assemble scene graph
     objRoot.addChild(TGT);
     objRoot.addChild(billboard);
     TGT.addChild(TGR);
     TGR.addChild(createTree());
     
     ...
     
     return objRoot;
}

 Related Tips

 
< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.