POV-Ray : Newsgroups : povray.newusers : trace function question : Re: trace function question Server Time
29 Jul 2024 02:30:42 EDT (-0400)
  Re: trace function question  
From: Chris B
Date: 18 Jan 2007 17:11:13
Message: <45aff081$1@news.povray.org>
"serfurj" <nomail@nomail> wrote in message 
news:web.45afe5111c5723b3e73422500@news.povray.org...
> "Chris B" <c_b### [at] btconnectcomnospam> wrote:
>>
>> If you want a uniform distribution you probably want   #declare Start =
>> vrotate ( <0,0,-2>, <asind(rand(R1)*2-1),rand(R1)*360,0> );
>
> I understand your approach, but it seems to only apply to placing objects 
> on
> a sphere.  Is there a way to place the cylinders uniformly on the
> sphere_sweep or cylinder shapes below?  Is it possible to create a random
> distribution of points in a space within a sphere_sweep or cylinder?
>

You're right it does only apply to a sphere.
Cylinders are easy, you just rotate by rand(R1)*360 around the axis of the 
cylinder and translate by rand(R1)*cylinderLength along the length of the 
centre line of the cylinder.

Getting uniformly random distribution on the surface of a sphere sweep is 
beyond me I'm afraid. You can define a spline that corresponds to the path 
followed by the sphere sweep and take a point at a random distance along it, 
then you could send out traces at right angles to the line of the spline. 
This would give you a uniform random distribution on the straight sections, 
but you'd still get more on the inside of the bends and less on the outside 
of the bends.

Regards,
Chris B.


Post a reply to this message

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