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. ??? 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.
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 
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.(VirtualUniverse.java:229)
at javax.media.j3d.Canvas3D.(Canvas3D.java:3533)
at Hello3d.main(Hello3d.java:28)
Exception in thread “main”
[/quote]
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;
}
}
[/quote]
Aha yes, that’s the native library thing I mentioned
There are 2 ways around this:
-
Make sure the Java3D DLLs are installed in the JRE’s bin directory
-
Point the Run… configuration at them by adding VM arguments:
-Djava.library.path=
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 
Thanks for the help, I got it working now. ;D