This is G o o g l e's cache of http://www.flashsandy.org/forum/index.php?act=Print&client=printer&f=17&t=338 as retrieved on 1 Aug 2007 10:08:18 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:Owp4wUo0QNIJ:www.flashsandy.org/forum/index.php%3Fact%3DPrint%26client%3Dprinter%26f%3D17%26t%3D338+act%3DPrint+%22index+php%22+-lofiversion+site:www.flashsandy.org&hl=en&ct=clnk&cd=29


Google is neither affiliated with the authors of this page nor responsible for its content.
These terms only appear in links pointing to this page: act print index php

Printable Version of Topic

Click here to view this topic in its original format

Sandy's Forum _ AS2 1.x versions _ Rotate in place

Posted by: Jeffrey Blyseth Feb 22 2007, 06:54 PM

Voracious, I know smile.gif

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 );
}

Posted by: Jeffrey Blyseth Feb 22 2007, 08:03 PM

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.

Posted by: kiroukou Feb 22 2007, 08:09 PM

Yes exactly smile.gif
That's how I would to either !

++

Posted by: Petit Feb 23 2007, 12:41 AM

QUOTE(Jeffrey Blyseth @ Feb 22 2007, 09:03 PM) *

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


Happy you found your solution, even if I was occupied with other things wink.gif
For the setAxisOfRotation( vector ), it always only gives the *direction* of the rotation axis.
How would it know through which point this axis should go ?

If you want rotation around an axis through a certain point, you can set a reference point with the RotationInterpolators setPointOfReference() method.
This is demonstrated in "http://www.petitpub.com/labs/media/flash/sandy/interpolators.shtml" under "Listen to the Interpolator".


Posted by: Jeffrey Blyseth Feb 23 2007, 01:03 AM

QUOTE(Petit @ Feb 22 2007, 04:41 PM) *

This is demonstrated in "http://www.petitpub.com/labs/media/flash/sandy/interpolators.shtml" under "Listen to the Interpolator".

Yep, already found that, as I said, your tutorials rock. So I didn't really solve my problem, you did smile.gif

Posted by: Petit Feb 23 2007, 10:44 AM

QUOTE(Jeffrey Blyseth @ Feb 23 2007, 02:03 AM) *

Yep, already found that, as I said, your tutorials rock. So I didn't really solve my problem, you did smile.gif

cool.gif

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)