View Single Post
  #12  
Old 04-15-2005, 02:00 AM
thirddan thirddan is offline
Senior Member
 
Join Date: Nov 2003
Location: San Francisco CA
Posts: 849
Default Re: Programming Question

yeah, it will pick random points within the confines of the vector that i give it, then run the point coordinates thru a fractal function and give them a threshold to either draw a particle or not...

my teacher gave us a hint that we would need to use the x^2 + y^2 + z^2 = r^2 forumla....

so far i have this ($sphereX/Y/Z/R are user defined)

float $sqrX = pow((0 - $sphereX), 2);
float $sqrY = pow((0 - $sphereY), 2);
float $sqrZ = pow((0 - $sphereZ), 2);
float $sqrR = pow($sphereR, 2);
float $result = sqrt($sqrX + $sqrY + $sqrZ);
if ($result < $sphereR)
{
vector $p = << ????? >>;
}
else
{
vector $p = << ?????? >>;
}

haha, you guys are the best, thanks for helping...
Reply With Quote