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...
|