|
Voracious, I know
I am trying to figure out how to rotate an object in place. Here are the steps I wish to accomplish:
Create a plane, initialize with an initial translation and rotation (done)
This basically creates the plane, rotates it(I need a vertical plane) and moves it to some point. All good so far.
Later
on, I want to create a RotationInterpolator to "flip" the plane on it's
own axis. When I try this, the plane jumps back to (0,0,0) and then
goes through the Rotation. I tried setting the axisOfRotation to the
point I want the plane to rotate around but it makes no difference,
just modifies the axis but still rotates around (0,0,0).
Petit, could you give me any insight on this?
function rotateObject(object){
var rTrans:TransformGroup = new TransformGroup();
var myEase:Ease = new Ease();myEase.circular();myEase.easingOut(1);
rotation = new RotationInterpolator( myEase.create(),25, 0, 180);
rotation.setAxisOfRotation(new Vector(4270, 370, -1150));
rTrans.setTransform( rotation );
rTrans.addChild(object);
_global.scnGroup.addChild( rTrans );
}
I
think the key here is in how you approach the initial transforms to
easily add subsequent transforms. I found my solution in the following
approach:
For initial transforms, rotation and/or translation,
set them on transformGroups, then later, if you want to rotate an
object on it's own axis, just add the Interpolator to the object
directly. Since it is inside of the other transform groups it will
rotate on it's own axis without changing the initial transformations.
Yes exactly
That's how I would to either !
++
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)