def prepare(vector)
      vertex = vector.normalize.clone
      vertex.index = @vertices.push(vertex).length - 1

      # Texture coords are equivalent to map coords, calculate angle and convert to fraction of a circle.
      u = azimuth(vector) / 2.0 / Math::PI + 0.5
      v = inclination(vector) / Math::PI + 0.5
      vertex.uv = Vector2.new(u, 1.0 - v)

      vertex
    end
def prepare(vector)
      vertex = vector.normalize.clone
      vertex.index = @vertices.push(vertex).length - 1

      # Texture coords are equivalent to map coords, calculate angle and convert to fraction of a circle.
      u = azimuth(vector) / 2.0 / Math::PI + 0.5
      v = inclination(vector) / Math::PI + 0.5
      vertex.uv = Vector2.new(u, 1.0 - v)

      vertex
    end
Project vector onto sphere's surface