POV-Ray : Newsgroups : povray.general : Help: Place objects within a circle : Re: Help: Place objects within a circle Server Time
4 Nov 2024 21:24:58 EST (-0500)
  Re: Help: Place objects within a circle  
From: Kurts
Date: 13 Sep 2003 11:58:00
Message: <kurtzlepirate-7C5E24.17575913092003@netplex.aussie.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.