Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (404)
games submitted by our members
Games in WIP (289)
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 2811 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 Knight


Medals: 30



« 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!
Try the Free Demo of Revenge of the Titans
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.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (48 views)
2013-05-17 21:29:12

alaslipknot (57 views)
2013-05-16 21:24:48

gouessej (87 views)
2013-05-16 00:53:38

gouessej (85 views)
2013-05-16 00:17:58

theagentd (94 views)
2013-05-15 15:01:13

theagentd (87 views)
2013-05-15 15:00:54

StreetDoggy (132 views)
2013-05-14 15:56:26

kutucuk (153 views)
2013-05-12 17:10:36

kutucuk (153 views)
2013-05-12 15:36:09

UnluckyDevil (163 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.144 seconds with 21 queries.