POV-Ray : Newsgroups : povray.general : Star night sky : Re: Star night sky Server Time
9 Aug 2024 09:07:26 EDT (-0400)
  Re: Star night sky  
From: Warp
Date: 29 Sep 2000 11:33:16
Message: <39d4b63c@news.povray.org>
Geoff Wedig <wed### [at] darwinepbicwruedu> wrote:
: So, instead of generating 3 numbers, generate 2, latitude and longitude. 
: Ie:

: #declare c1 = 180 * rand(s1) - 90;
: #declare c2 = 360 * rand(s1);

: translate <0,0,1000> // Assuming object originally at origin.

: rotate <0, c2, c1>   // This means y is up direction, but it is really
:                      // irrelevant which rotation is first and which
:                      // of the axes as used as long as the first axis is
:                      // not the direction of translation.

  This is exactly the mistake made in the original code.
  That doesn't distribute the points evenly. There will be more spheres
near the z-axis than elsewhere.
  You can test that if you like. Create LOTS of spheres with that algorithm.
You'll notice how they will concentrate near the z-axis.

  The idea behind my algorithm is that the spheres are truely distributed
evenly around the sphere.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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