IDE doesn't found package

Hi,

I’m trying out the Positionexample of the java3d-tutorial. By the compiling of the code I get some errors. One of it is that the package com.sun.j3d.utils.universe.* can not included into the source.

I’m using netbeans in the linuxversion with jsdk 1.4.0_02. Files that can be related to the packages there are under
/usr/java/j2sdk1.4.0_02/jre/ext/… Is this the right directory for the sun-j3d-components or have I to install these files to another directory. Normaly netbeans suggest parameters to complete the commands. The java3d related stuff are not suggested.

Regards,
Ruprecht

My experience with forte is that the most reliable thing to do is to use the file explorer to mount the jar files in your project.

Hi,

to ensure that we aren’t talking about different. The problem is that netbeans can’t import com.sun.j3d.utils.universe.*. Related classes there are installed in the the path posted last and the under directories.

I also try if there is a possibility with the jarfile(s).

Regards,
Ruprecht

Hi,

In the meentime I’ve checked the including with some other examples and found no differences in the line com.sun.j3d.utils.universe.

I still get errors within the code - One error with wrong startingpoint
in the for-loorp and different error relating with the above mentioned including and an error within the startingprocedure.
A class is wanted that was the content of the message.

Here my code:

import com.sun.j3d.utils.geometry.;
import com.sun.j3d.utils.universe.
;
import javax.media.j3d.;
import javax.vecmath.
;

public class Position extends applet{
SimpleUniverse universe = new SimpleUniverse();
BranchGroup group = new BranchGroup();

//x-axis made of sphere

for (float x =-1.0f;x <= 1.0f;x=x+ 0.1f)
{
    Sphere sphere = new Sphere(0.5f);
    TransformGroup tg = new TransformGroup();
    Transform3D transform = new Transform3d();
    Vector3f vector = new Vector3f(x,-0.f,0.f);
    transform.setTranslation(vector);
    tg.addChild(sphere);
    group.addChild(tg);
}

//y-axis made of cones
//y-axis made of cones

for (float y=-1.0f;y<=1.0f;y=y+0.1f)
{
    Cone cone = new Cone(0.5f,0.1f);
    TransformGroup tg = new TransformGroup();
    Transform3D transform = new Transform3d();
    Vector3f vector = new Vector3f(-0.f,y,0.f);
    transform.setTranslation(vector);
    tg.addChild(cone);
    group.addChild(tg);
}

//z-axis made of zylinders

for (float z=1.0f; z<=1.0f; z = z+0.1f)
{
    Cylinder cylinder = new Cylinder(0.5f,0.1f);
    TransformGroup tg = new TransformGroup();
    Transform3D transform = new Transform3d();
    Vector3f vector = new Vector3f(-0.f,y,0.f);
    transform.setTranslation(vector);
      tg.addChild(sphere);
    group.addChild(tg);
}

//y-axis made of cones

for (float y=-1.0f;y<=1.0f;y=y+0.1f)
{
    Cone cone = new Cone(0.5f,0.1f);
    TransformGroup tg = new TransformGroup();
    Transform3D transform = new Transform3d();
    Vector3f vector = new Vector3f(-0.f,y,0.f);
    transform.setTranslation(vector);
    tg.addChild(cone);
    group.addChild(tg);
}

//z-axis made of zylinders

for (float z=1.0f; z<=1.0f; z = z+0.1f)
{
    Cylinder cylinder = new Cylinder(0.5f,0.1f);
    TransformGroup tg = new TransformGroup();
    Transform3D transform = new Transform3d();
    Vector3f vector = new Vector3f(-0.f,y,0.f);
    transform.setTranslation(vector);
    tg.addChild(cone);
    group.addChild(tg);
}


Color3f light1Color = new Color3f(.1f,1.4f,.1f); // green light
BoundingSphere bounds =
new BoundingSphere(new Point3D(0.0,0.0,0.0),100);
Vector3f light1Direction = new Vector3f(4.0f,-7.0f,-12.0f);
DirectionalLight light1 =
new DirectionalLight(light1Color,lightDirection);
light1.setInfluencingBounds(bounds);
group.addChild(light1);
universe.getViewingPlatform().setNominalViewingTransform();
//add the group of objects to the Universe

universe.addBranchGraph(group);

}

public Position();

}