|
How to use geometric utility classes |
|
|
The geometric utility classes provide a convenient way to create the content for
Java 3D virtual world.By instantiating the object of the classes in package
'com.sun.j3d.utils.geometry',You can create the box,cone,cylinder and sphere for
your scene.
public class GeomUtilityTest extends JFrame {
public GeomUtilityTest() {
...
}
public BranchGroup createSceneGraph() {
BranchGroup objRoot = new BranchGroup();
// Create a Cone
Cone cone=new Cone(0.6f,0.2f);
objRoot.addChild(cone);
....
// Create a Sphere
Sphere sphere=new Sphere(0.2f);
objRoot.addChild(sphere);
....
return objRoot;
}
}
|
Related Tips
|
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.