POV-Ray : Newsgroups : povray.beta-test : rand.inc VRand_In_Sphere flaw : Re: rand.inc VRand_In_Sphere flaw Server Time
30 Jul 2024 18:10:22 EDT (-0400)
  Re: rand.inc VRand_In_Sphere flaw  
From: Brendt Hess
Date: 12 Oct 2001 00:54:49
Message: <3BC67943.22079984@home.com>
Personally, I think both versions should be retained.  I can see uses for both
evenly distributed random placements (e.g. your code) and the original code...
nebular distribution / globular clusters would be easily generated using the
original code.

Slime wrote:

> Out of curiosity, I looked at rand.inc, and noticed a flaw in the way the
> VRand_In_Sphere macro works. It is supposed to return random values inside a
> sphere, but it has a bias that most often returns values closer to the
> center of the sphere. I have solved the problem in the below code, it merely
> involves taking the cube root of the radius (magnitude) of the vector to be
> returned.


Post a reply to this message

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