What I am trying to do is modify the Transform Group of my view platform.
I'm using MouseRotate MouseTranslate and MouseZoom and I have set each of thier transform groups to the "root" transform group of my Universe.

The goal is just to allow me to look around all of the objects in my scene at the same time.

The problem I am having is that the Mouse rotation is not rotating about the "center" of my scene graph.

Here is a code snippet... I think my problem is that the MouseRotate needs to be added as a child of the *same* transform
group that is passed to setTransformGroup().
In this case I am adding MouseRotate to a transform group that contains some shapes. But I am passing the "root" transform group
from the ViewPlatform to setTransformGroup()

The rotation works... But it is rotating about the wrong point in space.

// Add mouse rotation
 BoundingSphere rotate_bounds =
     new BoundingSphere(new Point3d(0.0,0.0,0.0), 5.0);
 MouseRotate rotateBehavior = new MouseRotate();
 MouseZoom zoomBehavior = new MouseZoom();
 MouseTranslate transBehavior = new MouseTranslate();
//     Give the Mouse behaviors a handle to the root transform group
 rotateBehavior.setTransformGroup(mRootTransformGroup);
 zoomBehavior.setTransformGroup(mRootTransformGroup);
 transBehavior.setTransformGroup(mRootTransformGroup);
// The root transform group won't allow me to add
// the Mouse behaviors as a child. So I will add them to a
// transform group that contains some shapes. *This is wrong!*
//
 objTrans.addChild(rotateBehavior);
 objTrans.addChild(zoomBehavior);
 objTrans.addChild(transBehavior);
 rotateBehavior.setSchedulingBounds(rotate_bounds);
 zoomBehavior.setSchedulingBounds(rotate_bounds);
 transBehavior.setSchedulingBounds(rotate_bounds);
 

Or maybe it is a better idea not to modify this TransformGroup??

Thanks,
 - Adam Belmont
 

begin:vcard 
n:Belmont;Adam 
x-mozilla-html:FALSE
adr;dom;quoted-printable:;;101 Huntington Ave.=0D=0AFloor 22;Boston;MA;02199;
org:Art Technology Group [www.atg.com]
version:2.1
email;internet:[EMAIL PROTECTED]
tel;fax:617.859.1211
tel;work:617.859.1212 EXT.523
x-mozilla-cpt:;0
fn:Adam  Belmont
end:vcard

Reply via email to