Académique Documents
Professionnel Documents
Culture Documents
//get instancer
string $instancer = $particleobject[1];
//==================================================
// creation expression
string $expressionc;
$expressionc = ($particleshape[0] + ".axispp = floor(rand(3)); \n");
$expressionc += ($particleshape[0]+ ".rotpp =
<<rand(360),rand(360),rand(360)>>;\n");
$expressionc += ($particleshape[0]+ ".rotmaxrandpp = rand( 0 - " +
$particleshape[0]+ ".rotmax," + $particleshape[0]+ ".rotmax)/1000;\n");
dynexpression -s $expressionc -c $particleshape[0];
//==================================================
// runtime expression
string $expressionr;
$expressionr = ("if (" + $particleshape[0]+ ".axispp == 0)\n");
$expressionr += ($particleshape[0] + ".rotpp = " +$particleshape[0]+ ".rotpp +
<<" + $particleshape[0] + ".rotmaxrandpp,0,0>>;\n");
$expressionr += ("else if (" + $particleshape[0] + ".axispp == 1)\n");
$expressionr += ($particleshape[0] + ".rotpp = " + $particleshape[0] + ".rotpp +
<< 0, " + $particleshape[0] + ".rotmaxrandpp, 0 >>;\n");
$expressionr += ("else\n");
$expressionr += ($particleshape[0] + ".rotpp = " + $particleshape[0]+ ".rotpp +
<< 0, 0, " + $particleshape[0] + ".rotmaxrandpp >>;" );
//===================================================
//getshapes gets the shaped of a selected transform
// (from bryans site)
//===================================================
proc string[] getshapes( string $xform )
{
string $shapes[];
$shapes[0] = $xform;
return $shapes;
}