int $i;
for ($i = 0 ; $i < $numPart
{
vector $p = 1 * (rand(<<$sphereX - $sphereR, $sphereY - $sphereR, $sphereZ - $sphereR>>, <<$sphereX + $sphereR, $sphereY + $sphereR, $sphereZ + $sphereR>>
);
float $sqrX = pow(($p.x - $sphereX), 2);
float $sqrY = pow(($p.y - $sphereY), 2);
float $sqrZ = pow(($p.z - $sphereZ), 2);
float $sqrR = pow($sphereR, 2);
float $result = sqrt($sqrX + $sqrY + $sqrZ);
if ($result < $sphereR)
{
float $fbm = fBm( $p, 0.8, 2, 3 );
$thresh = rand (0.4, 0.7);
if($fbm > $thresh)
{
emit -object $s[0] -position ($p.x) ($p.y) ($p.z);
$max--;
$i = $i + 1 ;
}
}
}
thanks guys...now i must sleep...