View Single Post
  #18  
Old 04-15-2005, 03:15 AM
thirddan thirddan is offline
Senior Member
 
Join Date: Nov 2003
Location: San Francisco CA
Posts: 849
Default victory....

int $i;

for ($i = 0 ; $i < $numPart
{
vector $p = 1 * (rand(<<$sphereX - $sphereR, $sphereY - $sphereR, $sphereZ - $sphereR>>, <<$sphereX + $sphereR, $sphereY + $sphereR, $sphereZ + $sphereR>&gt);
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...
Reply With Quote