Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (517)
Games in Android Showcase (123)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Java Help  (Read 2204 times)
0 Members and 1 Guest are viewing this topic.
Offline 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 - thanks

Anyways yea
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #1 - Posted 2007-10-28 15:48:51 »

How to ask questions the smart way

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline 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!
Legends of Yore - The Casual Retro Roguelike
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #3 - Posted 2007-10-28 16:54:17 »

and you obviously didn't read the link  Roll Eyes

Online Riven
« League of Dukes »

JGO Overlord


Medals: 823
Projects: 4
Exp: 16 years


Hand over your head.


« 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
Offline 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..
Offline cylab

JGO Ninja


Medals: 52



« 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!
Offline Triz

Senior Newbie





« Reply #7 - Posted 2007-10-28 18:08:47 »

I updated first post with problem..
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« 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.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline 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!
Legends of Yore - The Casual Retro Roguelike
Offline cylab

JGO Ninja


Medals: 52



« 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 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


    // 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)

} // end of class HelloJava3Da



Mathias - I Know What [you] Did Last Summer!
Offline cylab

JGO Ninja


Medals: 52



« Reply #11 - Posted 2007-10-28 19:25:42 »

Too much ads on this page, but it seems to explain the basics: http://java.about.com/od/beginningjava/a/beginjavatutor.htm

Mathias - I Know What [you] Did Last Summer!
Offline Triz

Senior Newbie





« Reply #12 - Posted 2007-10-28 19:26:38 »

Thanks any recommended must read books?
Offline 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
Offline cylab

JGO Ninja


Medals: 52



« 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 Tongue

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!
Offline cylab

JGO Ninja


Medals: 52



« 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!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

DarkCart (1 views)
2014-10-31 21:44:48

DarkCart (1 views)
2014-10-31 21:43:57

TehJavaDev (38 views)
2014-10-27 03:28:38

TehJavaDev (29 views)
2014-10-27 03:27:51

DarkCart (43 views)
2014-10-26 19:37:11

Luminem (24 views)
2014-10-26 10:17:50

Luminem (29 views)
2014-10-26 10:14:04

theagentd (35 views)
2014-10-25 15:46:29

Longarmx (63 views)
2014-10-17 03:59:02

Norakomi (61 views)
2014-10-16 15:22:06
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!