|
![](/i/fill.gif) |
scott nous apporta ses lumieres en ce 2007/07/13 09:56:
>> I'd use the following steps:
>> 1 - randomly chose a point along the axis of your cone
>> 2 - randomly chose a radius, adjust that acording to your location
>> along the axis
>> 3 - randomly chose an angle from 0 to 360 and rotate your location
>> around the axis
>> 4 - place one asteroid at that location, and check that it don't
>> intersect another one. Use an array to store the locations.
>
> Isn't that method going to produce more asteroids per unit volume near
> the narrow end of the cone, and also near the axis of the cone?
>
>
It's natural to have a higher density near the axis.
You can add some ponderation based on the radius to decrease the density near
the small end. Just multiply a random value by the current radius and check
against a thressold value, small radius = lower chance, large radius = higher
chance.
--
Alain
-------------------------------------------------
Fundamentalism: If shit happens to a televangelist, it's okay.
Post a reply to this message
|
![](/i/fill.gif) |