Particles - fade out over time

Software: Away3D 4.x

mattmogford, Newbie
Posted: 16 July 2013 03:27 PM   Total Posts: 23

Hi All,

I’m needing to do a simple task, alpha out each particle over time.
All being the same is fine. I’ve tried…

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

private function 
initParticleParam(prop:ParticleProperties):void
  {
   
//prop.startTime = prop.index * 0.005;
   
prop.startTime 0;
   
prop.duration 2;
   
prop.delay 0;
   
//calculate the original position of every particle.
   
prop[ParticlePositionNode.POSITION_VECTOR3D] = new Vector3D(Math.random() * 5001000);
   
prop[ParticleVelocityNode.VELOCITY_VECTOR3D] = new Vector3DMath.random() * 275Math.random() * 275Math.random() * 275 );
   
prop[ParticleColorNode.COLOR_END_COLORTRANSFORM] = new ColorTransform001);
  

But I get the error :
Error: there is no ColorStartColorTransform in param!

 

   

Avatar
Cheng Liao, Administrator
Posted: 16 July 2013 03:45 PM   Total Posts: 116   [ # 1 ]

This color node needs two color transforms:COLOR_START_COLORTRANSFORM and COLOR_END_COLORTRANSFORM.
I need to set the COLOR_START_COLORTRANSFORM at the same time like this:

prop[ParticleColorNode.COLOR_START_COLORTRANSFORM] = new ColorTransform001); 
   

mattmogford, Newbie
Posted: 16 July 2013 03:53 PM   Total Posts: 23   [ # 2 ]

Thanks for the fast reply.
This sort of works, I’ll explain.

Each particle is a simple sphere, with a ColorMaterial

var material:ColorMaterial = new ColorMaterial(0x0000ff1); 

It doesn’t fade to nothing unless I set the color material alpha to 0.99.
Also, how would this work with a normal texture? For example, a rock texture fading to invisible?

Thanks

   

Avatar
Cheng Liao, Administrator
Posted: 16 July 2013 03:59 PM   Total Posts: 116   [ # 3 ]

When the alpha=1, the alphaBlending of the texture is auto set to normal, which means the alpha value will be ignored. When you use a bitmaptexture, you need to set the alphaBlending to true.

   

mattmogford, Newbie
Posted: 16 July 2013 04:02 PM   Total Posts: 23   [ # 4 ]

- IGNORE THIS - Answer = ColorMaterial .alphaBlending = true;

Ok excellent, so how then would I set alphaBlending = true on a ColorMaterial to make the alpha fade work?

Thanks

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X