Example Java 3D Code

How to do all the stuff before to be able to see anything

	//	This is the root of our view branch
viewBranch = new BranchGroup();
// The transform that will move our view
viewTransform = new Transform3D();
viewTransform.set(new Vector3f(0.0f,0.0f,5.0f));
// The transform group that will be the parent
// of our view platform elements
viewTransformGroup = new TransformGroup(viewTransform);
viewTransformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
myViewPlatform = new ViewPlatform();
// Next the physical elements are created
myBody = new PhysicalBody();
myEnvironment = new PhysicalEnvironment();
// Then we put it all together
viewTransformGroup.addChild(myViewPlatform);
viewBranch.addChild(viewTransformGroup);
myView = new View();
myView.addCanvas3D(this);
myView.attachViewPlatform(myViewPlatform);
myView.setPhysicalBody(myBody);
myView.setPhysicalEnvironment(myEnvironment);
// Create a default universe and locale
myUniverse = new VirtualUniverse();
myLocale = new Locale(myUniverse);
// Create the content Branch
contentBranch = new BranchGroup();
contentTransform = new Transform3D();
contentTransform.set(new AxisAngle4d(1.0,1.0,0.0,Math.PI/4.0));
contentTransformGroup = new TransformGroup(contentTransform);
contentBranch.addChild(contentTransformGroup); // buildShape and addLights are two personal methos to implement to // get some result.
contentTransformGroup.addChild(buildShape());
addLights(contentBranch);
//Use the functions to build the scene graph
myLocale.addBranchGraph(viewBranch);
myLocale.addBranchGraph(contentBranch);