Representation of Spheres

By Jo Jaquinta ·

TML message #689From bundle 63

    Most of you seem to be discussing things over my head. Literially.
I am not so much concerned with generating huge number of stars but things
of planet sized and lower.
    The reccomended grid for worlds looks something like this:

               /\    /\    /\    /\    /\
              /  \  /  \  /  \  /  \  /  \      I.e. a 20 sided dice.
             /____\/____\/____\/____\/____\
            /\    /\    /\    /\    /\    /
           /  \  /  \  /  \  /  \  /  \  /
          /____\/____\/____\/____\/____\/
          \    /\    /\    /\    /\    /
           \  /  \  /  \  /  \  /  \  /
            \/    \/    \/    \/    \/

    You put hexes down the sides (one for each size of the world gives
you a constant scale) and pentegrams on the corners. This is really peachy
and plesant but has several drawbacks if you want to try to implement this
on a computer (If you don't trust me, I leave it as an exercise).
    Firstly I will outline what is needed for a computer representation:
    1) There must be a simple way to thread the sphere. I.e. we must easialy
be able to visit every point once and only once.
    2) We must be able to find all represented points withing a certain
radius of our subject point. E.g. I need all nodes within two of this one.
    3) We must be able to trace a diameter in a small number of cardinal
directions eventually reaching our starting point.
    4) It must be recursively definable. I.e. we must be able to increase
the resolution infinately.

    So what do we do?
    Hexes are nice, traditional and great for flat surfaces but a bit of a
bollox when you hit the corners. I think triangles are out best bet. Lets
work through the criteria in reverse order.
    (4) Recursively definable:
       /\               /\               /\
      /  \             /  \             /8_\
     /    \           / 2  \           /\2 /\
    /      \   ==>   /______\    ==>  /9_\/10\  ==> ...
   /        \       /\      /\       /\7 /\6 /\
  /    1     \     /  \ 1  /  \     /11\/1_\/14\
 /            \   / 3  \  / 4  \   /\3 /\5 /\4 /\
/______________\ /______\/______\ /12\/13\/15\/16\    no problem.
    (3) diameter.
    Always stand in a triangle with our backs to a base. If we go through
the left face, then with our back to that in the new triange go through the
right face repeatedly we will circumnavagate the sphere. Choosing which
base and wether to go left or right first gives us six directions.
    (2) find all points within a radius
    If you assume that an adjacent triangle is a triangle sharing
a base you have no problem and minimal difficulty on corners. A more
attractive way is to have any triangle which shares a vertex be one
unit away. This has rather more difficulties.
    (1) threading the sphere.
    I haven't been able to come up with an algorithmical way to do this.
It is, of course, trivial if one numerically orders the triangles. This
brings us to my mental block. To come up with a numbering system for
the triangles of the sphere that caters for the conditions above.
    What this boils down to is that the above scheme is mathematically
elegant it needs four things to make it usefull. (4) a way of uniquely
identifying {preferably with an integer, or ordered pair} each triangle
element on the sphere. This numbering system must remain compatible as
the resolution is increased. (3) A function that when given a location
id and a direction, returns a location id of the next triangle along
that diameter. (2) A function that is passed a location and returns
a fixed number of locations distance one from the given location. (1)
A function that given a locations returns another location such that
if continually called with the return value it will cycle through all
locations before returning.
    Is there a fresh mind out there that can see what I can't?

    			-- Jo Jaquinta


All opinions and material above is the responsibility of the originator.
Submissions: [email removed], or [email removed]
Administrator: [email removed] (James Perkins)
The TML is made possible by facilities provided by Tektronix, Inc.