- Home /
How would you go at making a spherical grid layout
I want to create a grid in the shape of a sphere yet ,as little as I know, I can't figure where to even begin research this and how to implement it by code, The only grids i ever made were 2D square grids and never had any experience with 3D ones.
So the question is, How would you approach this and is it even possible (not hex grid but a square grid)?
Thanks in advance.
The grid you'll use depends on a few things.
What will be the purpose of the grid?
Do the squares have to be uniform in any way?
Does it have to be squares?
Is this a regular sphere (Same radius all over)?
Should the grid be visible?
Answer by exploringunity · May 18, 2020 at 08:01 PM
Hey @sexysnizel,
tl;dr - You cannot tile a sphere with identical squares or hexagons.
The math on why it's impossible (proven for hexes here, but same formula can be used for squares):
https://stackoverflow.com/questions/749264/covering-earth-with-hexagonal-map-tiles/759232#759232
These two links play around with the idea above and go into more depth:
https://www.redblobgames.com/x/1938-square-tiling-of-sphere/
https://www.redblobgames.com/x/1640-hexagon-tiling-of-sphere/
This research paper covers subdiving a hemisphere into equal sized mostly-square cells, so if you could implement what they're proposing and put a coordinate system on top of it, maybe it could suit your needs:
https://www.sciencedirect.com/science/article/pii/S0925772112000296
Thank you for your answer it was exactly what i was needed!
Your answer
Follow this Question
Related Questions
UI scrollable rect, get position on content based on mousePos. 0 Answers
I need to Snap a 3d object to a grid when it is placed in game. 1 Answer
How can I create a grid for a Leveleditor? 1 Answer
Dynamically adding (prefab) Buttons to a ScrollView 0 Answers
Images added to Grid Layout during runtime not Resizing with Screen Size 1 Answer