PDA

View Full Version : particles fluid


twilightened
07-01-2006, 07:48 AM
Hi,

I know it is possible to create an ocean that emits particles at maximum height waves. It is mentioned in Alias fluids DVD. create 3 attributes

1) sprayHeight
2) minElevation
3) suckForce

under oceanPlane1. Then put the following script in creation expression

vector $pos = particleShape1.position;
float $px = $pos.x;
float $pz = $pos.z;
float $disp[] = `colorAtPoint -u $px -v $pz oceanShader1`;
float $py = $disp[0];

if ($disp[0] > oceanPlane1.sprayHeight )
{
particleShape1.position = <<$pos.x,$py,$pos.z>>;
particleShape1.lifespanPP = rand(1) + 0.2;
}
else
{
particleShape1.lifespanPP = 0;
}


and the following script in runtime expression

vector $pos = particleShape1.position;
float $px = $pos.x;
float $pz = $pos.z;
float $disp[] = `colorAtPoint -u $px -v $pz oceanShader1`;
float $py = $disp[0];
float $yDiff = $py - $pos.y;

$py = $pos.y + $yDiff * oceanPlane1.suckForce;
if($py < $disp[0] + oceanPlane1.minElevation)
{
$py = $disp[0] + oceanPlane1.minElevation;
}
particleShape1.position = <<$pos.x,$p.y,$pos.z>>;

Doing this much is not enough. What am I not doing. That which I need to do so it emits particles at maximum height.

BRgds,


kNish

CGTalk Moderation
07-01-2006, 07:48 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.