Change particle color on the fly

Software: Away3D 4.x

busterT, Newbie
Posted: 15 November 2012 10:12 AM   Total Posts: 4

Hello,

is it possible in the new 4.1 version to change the particle color property on the fly?

e.g.

animationSet.addAnimation(new ParticleColorNode(ParticlePropertiesMode.LOCAL_DYNAMIC)); 

How would the properties set at runtime? Is there a function to invoke, when I click a button for example?

Thank you!

   

Avatar
Cheng Liao, Administrator
Posted: 16 November 2012 05:10 AM   Total Posts: 116   [ # 1 ]

Hi
these are only a few nodes which can support LOCAL_DYNAMIC mode (ParticlePositionNode, ParticleRotationalNode, ParticleVelocityNode etc.) now. Currently, ParticleColorNode doesn’t support LOCAL_DYNAMIC mode.
If you want to set all particles to the same property, you can use GLOBAL. In GLOBAL mode, you can change color property on the fly. The code is like this

ParticleColorState(animator.getAnimationState(followNode)).startColor = new ColorTransform() 

If you want to set every particle to different property, you can use LOCAL_STATIC, but can’t change it on the fly.

if you really want to set every particle to different property and change it on the fly, you may need to wait for us to implement it smile

   

busterT, Newbie
Posted: 16 November 2012 07:41 PM   Total Posts: 4   [ # 2 ]

Thank you for your quick reply.

So I have to wait a little bit.
I find another approach to manage this task. I take a uv-tiled Bitmap Texture and update the bitmap each frame. So I get an animation on each Particle.
Works like a charme, cause of this terrific particle engine…:-)

   

Kvazar, Newbie
Posted: 05 February 2013 01:53 AM   Total Posts: 8   [ # 3 ]

Hi. I have a question too. There is a cool thing with start and end color, so i can make a “fadeIn” or a “fadeOut” effect by changing alpha values. But is there a way to make a “fadeInOut” effect? From alpha = 0 to alpha = 1 and then back to alpha = 0?
Thanks.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X