|
![](/i/fill.gif) |
>> 1) is there a way to adjust the while loop so that it generates the
>> spheres
>> inside the boundries of the cone?
> 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.
> 5 - every 50 to 100 elements, place a dummy asteroids that have been
> prescaled to twice or trice the dimention of the asteroid, make them part
> of an union.
> 6 - on subsequant iterations, check if you are "inside" that union to
> prevent part of the possible intersections.
>
> If your placement is sparce, there will be very few intersecting asteroids
> and the placement process will be fast.
There is a macro for this in rand.inc
VRand_In_Obj(Object, Stream)
Post a reply to this message
|
![](/i/fill.gif) |