I need some help using Java3D with Eclipse. I checked under the Tools Forum, but no one posted in it since late November. Anyway, how do I configure Eclipse to use Java3D? (By the way, I already hava the Java3D files.) I’m following Sun’s Java3D tutorial, and when I paste in this code…
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.event.*;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.ColorCube;
import javax.media.j3d.*;
import javax.vecmath.*;
public class HelloJava3Da extends Applet {
public HelloJava3Da() {
setLayout(new BorderLayout());
GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
Canvas3D canvas3D = new Canvas3D(config);
add("Center", canvas3D);
BranchGroup scene = createSceneGraph();
scene.compile();
// SimpleUniverse is a Convenience Utility class
SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
// This moves the ViewPlatform back a bit so the
// objects in the scene can be viewed.
simpleU.getViewingPlatform().setNominalViewingTransform();
simpleU.addBranchGraph(scene);
} // end of HelloJava3Da (constructor)
public BranchGroup createSceneGraph() {
// Create the root of the branch graph
BranchGroup objRoot = new BranchGroup();
// Create a simple shape leaf node, add it to the scene graph.
// ColorCube is a Convenience Utility class
objRoot.addChild(new ColorCube(0.4));
return objRoot;
} // end of createSceneGraph method of HelloJava3Da
} // end of class HelloJava3Da
…I get a lot of “cannot be resolved” errors. Can anyone help? Thanks a lot! ;D