#Tiled Planet
13 messages · Page 1 of 1 (latest)
This is super cool! :o
I think I remember Tynan Sylvester (RimWorld) saying you can't tile a sphere with mere hexagons, there has to be 1 pentagon in there. Is that true? 😄
Well actually, I think there are 12 pentagons, since the tiling is done through a icosahedron
I tried to do it by dividing multiple times the triangles of the icosahedron. How do you coordinate through the tiles? That was where I stopped...
I'm using a half edge data structure for the graph/mesh. The base graph (on the left) is used for navigation and gameplay where a vertex is a tile and the edges are the directions you can move. you can then generate its dule (on the right) where the faces are associated with the base graph's vertex's so you can display it and hover over it with a moues. if you need to navigate from one tile to another you would just travers the base graph with something like a*. Also apparently when you use a ico-sphere for the base its considered a Geodesic grid.
Thank you @crystal gazelle for your reply! I used an icosahedron as base, then divided it myltiple times (acrually I had an parameter to control the division depth), and looped through the trianlges to pull haxagons information, and finally created a new mesh with the hexagons and their collision meshes, having full control on them (mouse hover, in the future add height, more details etc.). What I haven't yet accomplish was to create a sort of geodetic system (coordinations). I tried to sort hexagons by their center, but the loop to place them didn't work well - though I haven't invested more time to it yet. Just need more free time 🙂
this is super interesting, I'm working in a similar project and I did something similar:
- Icosphere for the planet mesh.
- Vertices as tiles, and edges as paths to neighbor tiles.
- At the start of the game, map all vertices and their edges to create a graph.
OK cool, so you both loop through all vetrices and create the hexagons/pentagons. using each vertex as center and half the edge size as radius - clever and more staightforward! I used 7 of the created vertices to create the hexagons, and had to keep track which vertex was already used and which did not... I have to revise my approach and see if I can aplly any geodetic system (the problem is that the icosahedron triangles are stored at unsuitable order and need sorting). Nevertheless Great Job!
yes, at least in my case I did that
in my case the vertices are not sorted, so I do two things:
- I have connected each vertex/tile with their neighbors, so at least I can run algoritms such as breadth-first search
- Because the poles of the planet and the camera are always in the same orientation I can "sort" vertex/tiles calculating their Azimuth and Altitude