|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |