Controlling particles with expressions

It´s been awhile since I played around with expressions and particles. I recently saw a video where a softbody was controlled with a fluid. The idea is to use the velocity of each voxel of the fluid to position the particles of the softbody. I want to recreate this setup and the first step is to learn how to position particles. I did some initial test with some expressions.

if (pPlane1ParticleShape.particleId == 0)
{

vector $pos = pPlane1ParticleShape.position;
pPlane1ParticleShape.position = <<$pos.x,$pos.y+2,$pos.z>>;

}

if (pPlane1ParticleShape.particleId == 3)
{

vector $pos = pPlane1ParticleShape.position;
pPlane1ParticleShape.position = <<$pos.x,2,$pos.z>>;

}

if (pPlane1ParticleShape.particleId == 12)
{

vector $pos = pPlane1ParticleShape.position;
pPlane1ParticleShape.position = <<$pos.x, frame,$pos.z>>;

}

Leave a Reply

Your email address will not be published. Please enter your name, email and a comment.

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>