title: Mathematically producing sphere-shaped hexagonal grid
body: <p>I am trying to create a shape similar to this, hexagons with 12 pentagons, at an arbitrary size.</p>
  
  <p><a href="https://i.stack.imgur.com/F35J0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/F35J0.png" alt="https://i.stack.imgur.com/F35J0.png"></a></p>
  
  <p>(<a href="https://stackoverflow.com/questions/28014924/three-js-texturing-terrain-on-a-spherical-hexagon-grid-map">Image Source</a>)</p>
  
  <p>The only thing is, I have absolutely no idea what kind of code would be needed to generate it!</p>
  
  <p>The goal is to be able to take a point in 3D space and convert it to a position coordinate on the grid, or vice versa and take a grid position and get the relevant vertices for drawing the mesh.</p>
  
  <p>I don't even know how one would store the grid positions for this. Does each "triagle section" between 3 pentagons get their own set of 2D coordinates?</p>
  
  <p>I will most likely be using C# for this, but I am more interested in which algorithms to use for this and an explanation of how they would work, rather than someone just giving me a piece of code.</p>