Meaningless Drivel is fun!*
The moose likes Other JSE/JEE APIs and the fly likes java 3D error - help. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "java 3D error - help." Watch "java 3D error - help." New topic
Author

java 3D error - help.

Shuaib Gill
Ranch Hand

Joined: May 29, 2001
Posts: 62
I can compile a program called StartCube.java, but when I type
java StartCube
on the command line, it will open a window with nothing in it. However it works on the schools computer. What did I do wrong? Here is the code:
// creates a universe with nothing in it.
import java.awt.*;
import java.awt.event.*;
import javax.media.j3d.*;
import com.sun.j3d.utils.universe.SimpleUniverse;
import com.sun.j3d.utils.geometry.ColorCube;
public class StartCube extends Frame {
public static void main(String[] args) {
StartCube frame = new StartCube("StartCube");
frame.setSize(300,200);
frame.setVisible(true);
}
public StartCube(String title) {
super(title);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
Canvas3D canvas = new Canvas3D(null);
add(canvas,"Center");
SimpleUniverse universe = new SimpleUniverse(canvas);
universe.getViewingPlatform().setNominalViewingTransform();
BranchGroup root = new BranchGroup();
ColorCube cube = new ColorCube(.5);
root.addChild(cube);
universe.addBranchGraph(root);
}
}
this code is right because it works on the computer at school. i have windows 2000 OS, using OpenGL java 3D API and Runtime environment.
please help.
thanks....


programmer77
 
 
subject: java 3D error - help.
 
Similar Threads
need help whit 3d applet
VIEWING VRML FILES IN JAVA3D. URGENT!!!
Problem in drawing block using java3d
tooltip in Java3D
Concept question regarding Transform3D