Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
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  
  I need a little help with Java3D.  (Read 3132 times)
0 Members and 1 Guest are viewing this topic.
Offline DecafJava

Senior Newbie





« Posted 2007-12-24 21:11:18 »

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

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

JGO Ninja


Medals: 38



« Reply #1 - Posted 2007-12-25 01:47:50 »

As a rule of thumb: Don't sumarize error messages when asking for help. Always paste the full error messages (or at least  a significant section of them). Also try to explain in more detail, what you already have tried to set up the Java3D libraries. 

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

Senior Newbie





« Reply #2 - Posted 2007-12-25 01:50:51 »

I can't really get any more specific. Well, they're not errors at all. They're warnings the compiler gives me before I even compile. I've installed Java3D, but Eclipse doesn't seem to be finding the files.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Conzar

Junior Member




There is nothing common about common sense


« Reply #3 - Posted 2008-02-06 18:51:14 »

Well, I've never used java3d in eclipse before so I can't say for certain that I know what your problem is; however, from my little knowedge of eclipse, there should be a tool for adding jars.  Here you need to add the java3d jars.

So for instance, if ur using GNU/Linux, then u would need to add the following jars
j3dutils.jar, vecmath.jar, j3dcore-linux.jar

This wil allow you to compile j3d; however, if you want to run it you will need to include the dynamic libs.  I think there is a tool for that in eclipse to.  This would include the directory that has the libj3dcore-ogl.so and libj3dcore-ogl-cg.so

Hope that helps

Ubuntu
Offline anil

Senior Newbie





« Reply #4 - Posted 2008-02-21 06:27:42 »

In Eclipse u have to create a project first to add files in it. Right click on the project name and then click on Build Path in the popup menu. furher click on Libraries and click and add the external Jar files. U need 2 add following three jar files to run java 3D programs.
j3dcore.jar
j3dutils.jar
vecmath.jar

If required more help tell me.
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.

ctomni231 (39 views)
2014-07-18 06:55:21

Zero Volt (36 views)
2014-07-17 23:47:54

danieldean (29 views)
2014-07-17 23:41:23

MustardPeter (32 views)
2014-07-16 23:30:00

Cero (47 views)
2014-07-16 00:42:17

Riven (48 views)
2014-07-14 18:02:53

OpenGLShaders (38 views)
2014-07-14 16:23:47

Riven (37 views)
2014-07-14 11:51:35

quew8 (33 views)
2014-07-13 13:57:52

SHC (70 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!