Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (511)
Games in Android Showcase (119)
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  
  Eclipse and Downloaded Java APIs  (Read 1199 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 Kernel


Medals: 404
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
Quote
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 javax.media.j3d.MasterControl$22.run(MasterControl.java:889)
     at java.security.AccessController.doPrivileged(Native Method)
     at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:886)
     at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:229)
     at javax.media.j3d.Canvas3D.<clinit>(Canvas3D.java:3533)
     at Hello3d.main(Hello3d.java:28)
Exception in thread "main"

this is the program I used
Quote
import javax.media.j3d.*;
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 );

           frame.show( );
     }

     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 );
           spinner.setSchedulingBounds(
                 new BoundingSphere( new Point3d( ), 1000.0 ) );
           trans.addChild( spinner );

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

JGO Kernel


Medals: 404
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.

 

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

The first screenshot will be displayed as a thumbnail.

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

Norakomi (39 views)
2014-10-16 15:22:06

Norakomi (31 views)
2014-10-16 15:20:20

lcass (36 views)
2014-10-15 16:18:58

TehJavaDev (66 views)
2014-10-14 00:39:48

TehJavaDev (65 views)
2014-10-14 00:35:47

TehJavaDev (56 views)
2014-10-14 00:32:37

BurntPizza (72 views)
2014-10-11 23:24:42

BurntPizza (44 views)
2014-10-11 23:10:45

BurntPizza (84 views)
2014-10-11 22:30:10
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!