[Tweener] Tween around circular path
Zeh Fernando
zeh at zehfernando.com
Mon Nov 2 11:22:44 PST 2009
That's a way, but personally I believe it's way too wacky.
Personally, independently of the tweening engine used, I'd create a function
that allowed you to project an object on the ellipse then create a
getter/setter and just tween it. Something like
protected var _objectAngle:Number
public function get objectAngle(): Number {
return _objectAngle;
}
public function set angle(__value:Number): void {
if (_objectAngle!= __value) {
_objectAngle= __value;
// Redraw object
var radiusX:Number = 10;
var radiusY:Number = 20;
var px:Number = Math.cos((_objectAngle / 180) * Math.PI) * radiusX;
var py:Number = Math.sin((_objectAngle / 180) * Math.PI) * radiusY;
myObject.x = px;
myObject.y = py;
}
}
Something like that. You may need additional transformation if you want to
rotate the ellipsis itself instead of using simple x/y radius.
Zeh
On Mon, Nov 2, 2009 at 2:09 PM, Fred Naude <info at headspacemedia.co.za>wrote:
> HI there list,
>
>
>
> How would I go about tweening an object around an ellipse with tweener?
>
> Is using Bezier points the only way?
>
>
>
> Thanks,
>
>
>
> Fred
>
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20091102/7296c732/attachment.htm>
More information about the Tweener
mailing list