POV-Ray : Newsgroups : povray.general : Realy uniform points on sphere Server Time
2 Aug 2024 10:25:32 EDT (-0400)
  Realy uniform points on sphere (Message 1 to 4 of 4)  
From: Rafal 'Raf256' Maj
Subject: Realy uniform points on sphere
Date: 19 Nov 2004 09:42:57
Message: <Xns95A6A03392860raf256com@203.29.75.35>
Hi,
is there a macro to place points realy uniformly (in almost distances from 
each point to it's neighbours)?

VRand_On_Sphere() places each point correclty, but it doesnt care about 
other points, so when used in loop - the resulting _group_ of points isnt 
so uniformly placed.

This problem is simmilar to finding good points/vectors to be used in 
radiosity directions AFAIK (but it's about full sphere, not half of it).


-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Shay
Subject: Re: Realy uniform points on sphere
Date: 19 Nov 2004 09:50:25
Message: <419e0831$1@news.povray.org>
Rafal 'Raf256' Maj wrote:
> Hi,
> is there a macro to place points realy uniformly (in almost distances from 
> each point to it's neighbours)?
> 
> VRand_On_Sphere() places each point correclty, but it doesnt care about 
> other points, so when used in loop - the resulting _group_ of points isnt 
> so uniformly placed.
> 
> This problem is simmilar to finding good points/vectors to be used in 
> radiosity directions AFAIK (but it's about full sphere, not half of it).
> 
> 

As I understand it, there are only a few truly uniform distributions. If 
you're not overly particular about the exact number of points, you can 
just start with one of the platonic solids (I think the best looking 
distributions come from a cube, icosahedron might give the closest to 
even) and keep diving the faces to get a relatively even distribution.

If you're just talking about just a few points, Tim Nikias has IIRC an 
electrostatic repulsion macro on his website.

  -Shay


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: Realy uniform points on sphere
Date: 19 Nov 2004 10:23:31
Message: <Xns95A6A713AFB7raf256com@203.29.75.35>
sah### [at] simcopartscom news:419e0831$1@news.povray.org

> As I understand it, there are only a few truly uniform distributions.
> If you're not overly particular about the exact number of points, you
> can just start with one of the platonic solids (I think the best
> looking distributions come from a cube, icosahedron might give the
> closest to even) and keep diving the faces to get a relatively even
> distribution. 
 
> If you're just talking about just a few points, Tim Nikias has IIRC an
> electrostatic repulsion macro on his website.

Some related links:

http://news.povray.org/povray.binaries.images/thread/%3CXns93266109FE342fiz
ban### [at] 204213191226%3E/?ttop=189070&toff=1000

http://news.povray.org/povray.advanced-
users/thread/%3C4### [at] triplexde%3E/?ttop=202454&toff=50


http://www.math.niu.edu/~rusin/known-math/index/spheres.html

And finaly:

http://www.nolights.de/download.html#ESR


-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Thies Heidecke
Subject: Re: Realy uniform points on sphere
Date: 22 Nov 2004 04:22:36
Message: <41a1afdc$1@news.povray.org>
"Rafal 'Raf256' Maj" <spa### [at] raf256com> schrieb im Newsbeitrag
news:Xns95A6A03392860raf256com@203.29.75.35...
>
> Hi,
Hi

> is there a macro to place points realy uniformly (in almost distances from
> each point to it's neighbours)?
As the others said, there are only approximations possible for arbitrary
large numbers of points.

> VRand_On_Sphere() places each point correclty, but it doesnt care about
> other points, so when used in loop - the resulting _group_ of points isnt
> so uniformly placed.
>
> This problem is simmilar to finding good points/vectors to be used in
> radiosity directions AFAIK (but it's about full sphere, not half of it).

Sorry if i'm annoying anyone with repeatedly stating the usefulness
of the golden-ratio-approach ; ) ... but i use it with good results.
It's not perfect and probably optimizing the positions with an
electrostatic-repulsion approach can give more optimal results but
i think this method is by far the fastest and for many points it gives
nice results.

Greetings,
Thies


Here's my approach:

#version 3.5;

global_settings {
  assumed_gamma 1.0
  max_trace_level 5
}

camera {
  location  <1.3, 3.5, -1.0>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
}
sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}
light_source {
  <-20, 30, -60>
  color rgb <0.9, 0.7, 0.3>
}
light_source {
  <70, 40, 80>
  color rgb <0.1, 0.3, 0.9>
}

#declare N  = 5000; // Number of Spheres
#declare M  = N;
#declare sr = 0.8 * 2/sqrt(N);  // sphereradius
#declare phi= 0;
#declare gsa= 360*((sqrt(5)-1)/2);  // golden section angle
#declare py = -1;

#while(M>0)
  sphere {
    py*y, sr
    translate sqrt(1-py*py)*x
    rotate phi*y
    texture {
      pigment{color rgb 1}
      finish{ambient 0 diffuse 0.5 reflection{0.3, 0.7}}
    }
  }
  #declare py=-1+2*(M-1)/(N-1);
  #declare phi=phi+gsa;
  #declare M=M-1;
#end


Post a reply to this message

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