This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 31st, when you will be able to use this site as normal.

    Forum Stats

  • 3,890,899 Users
  • 2,269,649 Discussions
  • 7,916,821 Comments

Discussions

exceptions!!

843799
843799 Member Posts: 49,999
edited Aug 3, 2001 11:42AM in Java 3D
when try to compile my code
-----------------------------------
import com.sun.j3d.utils.geometry.*;
import com.sun.j3d.utils.universe.*;
import javax.media.j3d.*;
import javax.vecmath.*;
import java.awt.*;
public class Main
{
public Main()
{
Transform3D tf=new Transform3D();
TransformGroup trans=new TransformGroup();
Vector3f vec=new Vector3f(0.0f,-4.0f,0.2f);
SimpleUniverse su=new SimpleUniverse();
BranchGroup bg=new BranchGroup();
ColorCube cc=new ColorCube(0.10f);
tf.setTranslation(vec);
trans.setTransform(tf);
trans.addChild(cc);
bg.addChild(cc);
su.getViewingPlatform().setNominalViewingTransform();
su.addBranchGraph(bg);
}
public static void main(String[] args)
{
Main m=new Main();
}
}
---------------------------------------------------
i get these exceptions
---------------------------------------------------
javax.media.j3d.MultipleParentException: Group.addChild: child already has a parent
at javax.media.j3d.GroupRetained.checkValidChild(GroupRetained.java:397)
at javax.media.j3d.GroupRetained.addChild(GroupRetained.java:406)
at javax.media.j3d.Group.addChild(Group.java:261)
at Main.<init>(Main.java:19)
at Main.main(Main.java:25)
-------------------------------------------------
someone can plz help me?

Comments

This discussion has been closed.