Hi Ben,

  Can you please send us a complete test program that can
reproduce this problem ? This code given below is just a
BoxShape class.

I guess the mouse rotate behavior somehow select the
transform branch group to rotate which is above all the multiple
box shape branch groups. This is probably because when

  public MouseRotate(TransformGroup transformGroup)

is created, the transformGroup pass in is not the one
localized to the individual BoxShape.

Thanks.

- Kelvin
-----------
Java 3D Team
Sun Microsystems Inc.



>MIME-Version: 1.0
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
>Date: Fri, 23 Jun 2000 09:30:13 -0400
>From: Ben Arbel <[EMAIL PROTECTED]>
>Subject: [JAVA3D] multiple mouse rotation behaviors
>Comments: cc: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>
>hello all java3D programmers and good morning to you
>
>i encountered a strange problem today, when creating 16 3dboxes and trying to
apply mouse rotation to all of them
>, the problem is that when running the program all 16 boxes appeared to have a
unifromed mouse rotation behavior, i.e when
>trying to rotate a single shape all the shapes rotated as well.. does any one
know the source for the problem ?
>im including  the source code for the class that creates the objects and
applies the mouse rotation to each one of them, keep in mind that class is
created 16 times to create 16 different boxes..
>
>class BoxShape{
>  private BranchGroup localRoot;
>  private Appearance app=null;
>  private float sizeX = 0.0f,
>                sizeY = 0.0f,
>                sizeZ = 0.0f;
>  private BoundingSphere bounds = null;
>  private Transform3D t3dLocation = null;
>  public BoxShape(float x,float y,float z,Vector3f location){
>    localRoot = new BranchGroup();
>    sizeX = x;
>    sizeY = y;
>    sizeZ = z;
>    bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0),100);
>    t3dLocation = new Transform3D();
>    t3dLocation.setTranslation (location);
>    localRoot=buildBoxScene();
>  }
>  private BranchGroup buildBoxScene(){
>    BranchGroup root = new BranchGroup();
>    root.setCapability (BranchGroup.ALLOW_CHILDREN_READ);
>    TransformGroup scale = new TransformGroup();
>    Transform3D t3d = new Transform3D();
>    t3d.setScale (0.4);
>    scale.setTransform (t3d);
>
>    root.addChild (scale);
>
>    TransformGroup transG = new TransformGroup();
>    transG.setTransform (t3dLocation);
>    transG.setCapability (TransformGroup.ALLOW_TRANSFORM_WRITE);
>    transG.setCapability (TransformGroup.ALLOW_TRANSFORM_READ);
>    transG.setCapability (TransformGroup.ALLOW_BOUNDS_WRITE );
>    scale.setCapability (TransformGroup.ALLOW_BOUNDS_WRITE );
>    scale.addChild (transG);
>
>    Material m = new Material();
>    app = new Appearance();
>    app.setMaterial (m);
>    app.setCapability (Appearance.ALLOW_TEXTURE_ATTRIBUTES_WRITE);
>    app.setCapability (Appearance.ALLOW_TEXTURE_WRITE);
>    TextureAttributes tAtt = new TextureAttributes();
>    ColoringAttributes cAtt = new ColoringAttributes
>      (new Color3f(1.0f,1.0f,1.0f),ColoringAttributes.NICEST );
>    app.setColoringAttributes (cAtt);
>    app.setTextureAttributes (tAtt);
>
>    com.sun.j3d.utils.geometry.Box box = new
>        com.sun.j3d.utils.geometry.Box(sizeX,
>        sizeY,sizeZ,
>        Box.GENERATE_TEXTURE_COORDS |
>        Box.GENERATE_NORMALS, app);
>
>    transG.addChild (box);
>
>    // create mouse activity
>    // rotate through mouse left click and drag
>    MouseRotate mRotate=new MouseRotate(transG);
>    transG.addChild (mRotate);
>    mRotate.setSchedulingBounds (bounds);
>
>    root.compile ();
>    return root;
>  }
>  public BranchGroup getSceneBranch(){
>    return localRoot;
>  }
>}

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to