Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (616)
Games in Android Showcase (173)
games submitted by our members
Games in WIP (659)
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  
  Eclipse and Downloaded Java APIs  (Read 1397 times)
0 Members and 1 Guest are viewing this topic.
Offline Leppy

Senior Newbie

Java games rock!

« Posted 2004-05-16 22:17:14 »

I am intersted in programming with java3d, and I use the Eclipse IDE. I can't figure out how to make the Java3D API available to Eclipse. Huh I checked the website, but it isn't a very good one. I would greatly appreciate help, and I'm sure that there is a simple answer.
Offline princec

« JGO Spiffy Duke »

Medals: 567
Projects: 3
Exp: 16 years

Eh? Who? What? ... Me?

« Reply #1 - Posted 2004-05-17 07:04:14 »

Right click on your project, and get the properties up. Find the Java Build Path entry on the left, and then click on the Libraries tab on the right. Click on Add External Library... and browse to the Java3D jars.

You will need to make sure the Java3D binaries are accessible too but see how you get on with that.

Cas Smiley

Offline Leppy

Senior Newbie

Java games rock!

« Reply #2 - Posted 2004-05-17 09:23:21 »

I couldn't find the option to add external libraries, but I clisked "Add External JAR files" or something like that, and added all of he JARs from the folder that J3D was installed to. I didn't get any errors when I wrote the program, but when it ran I got these
java.lang.UnsatisfiedLinkError: no J3D in java.library.path
     at java.lang.ClassLoader.loadLibrary(Unknown Source)
     at java.lang.Runtime.loadLibrary0(Unknown Source)
     at java.lang.System.loadLibrary(Unknown Source)
     at Method)
     at Hello3d.main(
Exception in thread "main"

this is the program I used
import javax.vecmath.*;
import java.awt.*;
import com.sun.j3d.utils.geometry.*;
import com.sun.j3d.utils.universe.*;

public class Hello3d
     public static void main( String[] args ) {
           Frame frame = new Frame( );
           frame.setSize( 640, 480 );
           frame.setLayout( new BorderLayout( ) );

           Canvas3D canvas = new Canvas3D( null );
           frame.add( "Center", canvas );

           SimpleUniverse univ = new SimpleUniverse( canvas );
           univ.getViewingPlatform( ).setNominalViewingTransform( );

           BranchGroup scene = createSceneGraph( );
           scene.compile( );
           univ.addBranchGraph( scene );


     private static BranchGroup createSceneGraph( )
           // Make a scene graph branch
           BranchGroup branch = new BranchGroup( );

           // Make a changeable 3D transform
           TransformGroup trans = new TransformGroup( );
           trans.setCapability( TransformGroup.ALLOW_TRANSFORM_WRITE );
           branch.addChild( trans );

           // Make a shape
           ColorCube demo = new ColorCube( 0.4 );
           trans.addChild( demo );

           // Make a behavor to spin the shape
           Alpha spinAlpha = new Alpha( -1, 4000 );
           RotationInterpolator spinner =
                 new RotationInterpolator( spinAlpha, trans );
                 new BoundingSphere( new Point3d( ), 1000.0 ) );
           trans.addChild( spinner );

           return branch;
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »

Medals: 567
Projects: 3
Exp: 16 years

Eh? Who? What? ... Me?

« Reply #3 - Posted 2004-05-17 12:27:19 »

Aha yes, that's the native library thing I mentioned Smiley There are 2 ways around this:

1. Make sure the Java3D DLLs are installed in the JRE's bin directory

2. Point the Run... configuration at them by adding VM arguments:
-Djava.library.path=<path to the J3D dlls>
which means you have to adjust the Run... configuration for each thing that uses Java3D.

I prefer 2. myself as it prevents quite a few strange things happening.

Cas Smiley

Offline Leppy

Senior Newbie

Java games rock!

« Reply #4 - Posted 2004-05-17 19:17:36 »

Thanks for the help, I got it working now. Grin
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Coldstream24 (16 views)
2015-09-03 00:41:28

Andrew_3ds (27 views)
2015-09-01 19:08:10

afikri (18 views)
2015-08-31 09:30:22

afikri (25 views)
2015-08-31 09:30:07

afikri (13 views)
2015-08-31 09:27:24

afikri (16 views)
2015-08-31 09:26:40

Roquen (30 views)
2015-08-29 11:30:54

GamerC4 (36 views)
2015-08-22 20:38:50

GamerC4 (33 views)
2015-08-22 20:37:18

GamerC4 (40 views)
2015-08-22 20:37:01
HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30 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‑
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!