POV-Ray : Newsgroups : povray.advanced-users : <sighs> Cornflower rows Server Time
29 Jul 2024 06:13:43 EDT (-0400)
  <sighs> Cornflower rows (Message 1 to 4 of 4)  
From: Greg M  Johnson
Subject: <sighs> Cornflower rows
Date: 10 Feb 2003 10:11:19
Message: <3e47c117@news.povray.org>
There's an algorithm for uniformly placing objects on a sphere.  I've pasted
it below with apologies as I don't know from whom I originally got it.  The
question is:

Does anyone know of an algorithmic way to determine which are the nearest
neighbors to any particular point?
Does anyone know of another, close-enough algorithm that would have a more
straightforward way of determining this?




#declare Gball = union{
        //sphere { 0, 1 }
        #declare N = 150;               //arbitrary 150422;
        #declare nn = 0;               //arbitrary 150422;
        #declare R = 1/sqrt(N); //also arbitrary
        #declare Theta = 0;
//        #declare H = (N-1)/N;   //I dunno which of these makes a
betterpattern.
      #declare H = 1;                 //There's a logical argument
foreither.
        #while (H >= -1)
                #declare Phi = degrees(acos(H));

                sphere { <0,1,0>, R*2
                        rotate <Phi, Theta, 0>
                        inverse
                pigment{color rgb nn/150}
                finish{reflection 0.0 specular 100000}
                        }
                #declare H = H - 2/N;
                #declare Theta = mod (Theta + 137.5077641, 360);
                #declare nn=nn+1;
        #end
        //texture {Tex_2 }
        }


Post a reply to this message

From: Micha Riser
Subject: Re: <sighs> Cornflower rows
Date: 10 Feb 2003 10:33:59
Message: <3e47c667@news.povray.org>
Greg M. Johnson wrote:

> There's an algorithm for uniformly placing objects on a sphere.  I've
> pasted
> it below with apologies as I don't know from whom I originally got it. 
> The question is:

nice

> 
> Does anyone know of an algorithmic way to determine which are the nearest
> neighbors to any particular point?
> Does anyone know of another, close-enough algorithm that would have a more
> straightforward way of determining this?

Maybe building Voronoi cells or a nearest-neighbour tree with the points.

-- 
POV-Ray Objects Collection: http://objects.povworld.org


Post a reply to this message

From: Michael Andrews
Subject: Re: <sighs> Cornflower rows
Date: 11 Feb 2003 07:46:16
Message: <3e48f098@news.povray.org>
Greg M. Johnson wrote:
> Does anyone know of an algorithmic way to determine which are the nearest
> neighbors to any particular point?
> Does anyone know of another, close-enough algorithm that would have a more
> straightforward way of determining this?

Hi Greg,

The code I posted (see 'Convex Hull macro ...' thread on p.b.i and 
p.b.s-f) will return the points, nearest neighbour connections and 
triangles of the convex hull of an array of points. Given co-spherical 
points, it gives the 'best' triangulation of the points.

I also posted a file called 'subrandom.inc' which has macros to produce 
three sub-random sequences, one of which is the Golden Mean sequence you 
are using, mapped to a square, circle or spherical surface.

Bye for now,
	Mike Andrews.


Post a reply to this message

From: Apache
Subject: Re: <sighs> Cornflower rows
Date: 5 Mar 2003 21:59:47
Message: <3e66b9a3$1@news.povray.org>
two magic words: GOLDEN RATIO. Try google with that one. With this ratio
it's fairly easy to get a good positioning of points on a circle, square, or
a sphere.


Post a reply to this message

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