Wednesday, January 7, 2009

Away3d - Tween Filters

I had read that there was no way to tween filters in Away3d using one of the convenient Tweening Engines like TweenLite. It is true that you cannot Tween the filters using the tweening engines built-in filter tweening, but I have found an easy way around this. All you have to do is tween the properties in the Filters array.

For example:

// cube can be any Object3D object
cube.filters = [ new GlowFilter(0xFFFFFF, 1, 12, 12, 0), new GlowFilter(0x00FFFF, 1, 21, 21, 0) ];

TweenLite.to( cube.filters[0], 1, { strength:2.4 } );
TweenLite.to( cube.filters[1], 1, { strength:1.3 } );

No comments: