|
|
In article <Xns### [at] 204213191226>,
Marc Champagne <marcch.AT.videotron.DOT.ca> wrote:
> Hi folks,
>
> I'm trying (in vain) to write a segment of code that will randomly place
> a declared object within a fixed-radious circular x-z plane at a
> specific y position.
>
> Now my math is not so hot, so I thought of placing said objects within a
> fixed-size x-z square at a specific y position and use CSG to cut out the
> circle of objects I want, but that will leave some objects along the
> circumference of the circle partially cut.
>
> Not very elegant...
>
> Hmmm
>
> Well it took writing this message to figure out that I can place the
> object randomly on the x radious and then randomly rotate it arround the
> y, it will always remain within the circle.
waht about that :
#declare alea = seed(a_number);
#declare rotAngle = 360*rand(alea);
#declare objet = sphere {
<xVal, 0, 0>
radius
rotate rotAngle*y
}
> Am I on the right track here?
yes you are
> They should have had POV in school, it would of given me a reason to
> remember my trigonometry. :)
no trigo need for the moment.
> Much appreciated.
Post a reply to this message
|
|