mattrdowney / planetaria

A Unity framework for Euclidean 2-sphere games (e.g. 2D virtual reality games) [quasi-MIT license]
Other
10 stars 2 forks source link

Icosahedron Sphere #51

Closed mattrdowney closed 5 years ago

mattrdowney commented 6 years ago

There are some nice things about this:

1) better resolution 2) UV coordinates are equilateral triangles (instead of the incorrect right triangle). 3) UV coordinates have no triangle on the UV 0->1 boundaries (no issues with 0 vs 1 being sort of the same point / ambiguous)

There are disadvantageous:

1) generating the seams of the mesh might result in floating point errors since they are no longer at x=0 or z=0 2) conversion to and from UV coordinates has "dead zones" that are undefined or ambiguous still (i.e. the problem is shifted from the boundaries).

mattrdowney commented 6 years ago

Points 2&3 in the pros (and 2 in cons) are not intrinsic to the icosahedron and could still be achieved with a octahedron

mattrdowney commented 6 years ago

The wasted texture space is problematic, even if it is zeroed out for better compression.

mattrdowney commented 6 years ago

Not worth it, since #52 does the same thing with fewer drawbacks.

mattrdowney commented 6 years ago

Looking at this more, it seems like a good idea.

mattrdowney commented 6 years ago

Notably: the coordinate system conversions are object-oriented, so adding features isn't confusing to end users.

mattrdowney commented 5 years ago

Implicitly solved in #119 (and #118).

mattrdowney commented 5 years ago

While UV maps are harder and less precise, I did settle on a pretty good variant.

The icosahedron can pretty easily get a triangle band around the equator (10 out of 20 faces). It does this with a simple triangle strip (naively, with one face cut in half - but don't do that).

Getting the other band of 10 working is harder (and in my method is guaranteed to have 4 seams that will blend between disjoint regions). What I decided on was triangle fanning for the poles, such that one triangle section contains 5 fanned triangles, which causes a lot of stretching.

I think the ability to use .svg files will solve this because I'll use a coordinate system that is sparse, but if I had to use dense packing that is the 2nd or 3rd iteration attempt.