Source Code : Basic steps needed to display 3D objects

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Basic steps needed to display 3D objects

Basic steps needed to display 3D objects
/*
The Joy of Java 3D

by Greg Hopkins

Copyright Copyright 2001


*/


/*
The following program shows you the basic steps needed to display 3D objects.

1.  Create a virtual universe to contain your scene.
2.  Create a data structure to contain a group of objects.
3.  Add an object to the group
4.  Position the viewer so that they are looking at the object
5.  Add the group of objects to the universe


*/




import javax.media.j3d.BranchGroup;

import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.SimpleUniverse;

public class Hello3d {

  public Hello3d() {
    SimpleUniverse universe = new SimpleUniverse();
    BranchGroup group = new BranchGroup();
    group.addChild(new ColorCube(0.3));
    universe.getViewingPlatform().setNominalViewingTransform();
    universe.addBranchGraph(group);
  }

  public static void main(String[] args) {
    new Hello3d();
  }
} // end of class Hello3d



           
       

Thank with us