Triz
Senior Newbie 
|
 |
«
Posted
2007-10-28 15:43:48 » |
|
I need help... I have Java 3D and Docs installed JDK and docs installed JVM installed In Sun's tutorial on getting HelloJava3Da working I run into these problems..... Step 1: I put this into a text editor:public class HelloJava3Da extends Applet { public HelloJava3Da() { setLayout(new BorderLayout()); Canvas3D canvas3D = new Canvas3D(null); 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
// The following allows this to be run as an application // as well as an applet
public static void main(String[] args) { Frame frame = new MainFrame(new HelloJava3Da(), 256, 256); } // end of main (method of HelloJava3Da)
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.*; - then i attempt to Javac it, and it does javac it successfully... BUT Step 2: Upon it Javac'n i get 10 errors and they are: I have all the latest docs 'downloaded' but I guess I apparently didn't put them in the right directory... I mean I did download them and put them in (for example) J3D docs I put w/ java 3d... NEED ONE HUGE FAVOR - Can someone please recommend a book to start with to learn java programming that will secure me for learning how to program in java 3d - A good book please - thanksAnyways yea
|
|
|
|
|
Triz
Senior Newbie 
|
 |
«
Reply #2 - Posted
2007-10-28 15:52:54 » |
|
Nice try but learn how to read that obviously doesn't answer my question
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Matzon
|
 |
«
Reply #3 - Posted
2007-10-28 16:54:17 » |
|
and you obviously didn't read the link 
|
|
|
|
Riven
|
 |
«
Reply #4 - Posted
2007-10-28 17:38:15 » |
|
You might not have noticed, but you pressed capslock.
How on Earth would you expect any meaningful answer to your post.
If you're really that frustrated over coding, maybe you should pick another hobby or job. You know the nice thing about such problems in programming? It's always your fault! Realizing that, you know that there is a solution, and it just needs some clear thinking. Ofcourse, I get frustrated too, every once in a while, but it hardly ever occured that it was Sun who was to blame. It was always me screwing up. So either sit down and ponder a bit about the problem, trying to figure it out. If that doesn't help, try to tell others exactly what you did to solve the problem, and where you got stuck. If you simply tell everybody it just won't work, we can't do much but agree.
So... now what exactly was the problem?
|
Hi, appreciate more people! Σ ♥ = ¾ Learn how to award medals... and work your way up the social rankings!
|
|
|
Triz
Senior Newbie 
|
 |
«
Reply #5 - Posted
2007-10-28 17:55:46 » |
|
This is my problem:
I managed to fix the javac problem but this is my other one....
The first tutorial that Sun offers on how to open up the Universe App and what not... Every time I enter the code in I always get an error, it compiles but it never works it's so irritating. There is always (now) one error that wont work. Before it would never compile but it does now... Thankfully..
|
|
|
|
cylab
|
 |
«
Reply #6 - Posted
2007-10-28 18:00:57 » |
|
Actually you need to post the exact error messages whenever you ask someone in a forum for help.
|
Mathias - I Know What [you] Did Last Summer!
|
|
|
Triz
Senior Newbie 
|
 |
«
Reply #7 - Posted
2007-10-28 18:08:47 » |
|
I updated first post with problem..
|
|
|
|
Orangy Tang
|
 |
«
Reply #8 - Posted
2007-10-28 18:21:30 » |
|
1. "import" statements go right at the top of source files (but underneath "package" statements, but you don't have any of those).
2. All methods need to reside within a class. Your main() method is outside a class and needs to be moved within the HelloJava3Da class.
|
|
|
|
Triz
Senior Newbie 
|
 |
«
Reply #9 - Posted
2007-10-28 19:09:28 » |
|
1. "import" statements go right at the top of source files (but underneath "package" statements, but you don't have any of those). I do have those I downloaded them off of sun.... Can you show me a pic of where they go?
|
|
|
|
Games published by our own members! Check 'em out!
|
|
cylab
|
 |
«
Reply #10 - Posted
2007-10-28 19:18:10 » |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| 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()); Canvas3D canvas3D = new Canvas3D(null); add("Center", canvas3D);
BranchGroup scene = createSceneGraph(); scene.compile();
SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
simpleU.getViewingPlatform().setNominalViewingTransform();
simpleU.addBranchGraph(scene); }
public BranchGroup createSceneGraph() { BranchGroup objRoot = new BranchGroup();
objRoot.addChild(new ColorCube(0.4));
return objRoot; }
public static void main(String[] args) { Frame frame = new MainFrame(new HelloJava3Da(), 256, 256); }
} |
|
Mathias - I Know What [you] Did Last Summer!
|
|
|
|
Triz
Senior Newbie 
|
 |
«
Reply #12 - Posted
2007-10-28 19:26:38 » |
|
Thanks any recommended must read books?
|
|
|
|
Triz
Senior Newbie 
|
 |
«
Reply #13 - Posted
2007-10-28 19:27:54 » |
|
Cylab I did what you said in your script and now i have 15 errors... lol
|
|
|
|
cylab
|
 |
«
Reply #14 - Posted
2007-10-28 19:33:05 » |
|
I haven't testet it, since I have not J3D installed. Sorry... paste the error-messages... make it a habbit, when asking for help  You don't have to make a screenshot. Right click on the command prompt icon in the comand prompt's title bar, open properties, check the quick edit mode, close the dialog with OK. Check to apply the properties to all windows (it's the second option... don't know the exact words, no english windows). After that you can select regions in the command window with your mouse and copy the selected text to the clipboard by right click.
|
Mathias - I Know What [you] Did Last Summer!
|
|
|
cylab
|
 |
«
Reply #15 - Posted
2007-10-28 19:47:46 » |
|
Just installed Java3D and tried the code... There was an error in it (maybe from your tutorial) 1
| Canvas3D canvas3D = new Canvas3D(null); |
has to be: 1
| Canvas3D canvas3D = new Canvas3D(SimpleUniverse.getPreferredConfiguration()); |
other than that, the code compiles and runs fine.
|
Mathias - I Know What [you] Did Last Summer!
|
|
|
|