POV-Ray : Newsgroups : povray.off-topic : Random vector through a hemisphere? : Re: Random vector through a hemisphere? Server Time
11 Oct 2024 03:15:03 EDT (-0400)
  Re: Random vector through a hemisphere?  
From: Nicolas Alvarez
Date: 18 Feb 2008 10:26:55
Message: <47b9a3bf$1@news.povray.org>

>> Another way is to generate a random vector:
>>
>> #local vResult=vrotate(x,<rand(Seed),rand(Seed),rand(Seed)>*360);
> 
> vResult is not uniformly distributed over the sphere with this approach 
> though...
> 

rand.inc has macros that return random vectors uniformly distributed 
over a sphere's volume or surface.


Post a reply to this message

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