Class UVMapping

java.lang.Object
org.openstreetmap.josm.gui.util.imagery.UVMapping

public final class UVMapping extends Object
A utility class for mapping a point onto a spherical coordinate system and vice versa
Since:
18246
  • Field Details

  • Constructor Details

  • Method Details

    • getTextureCoordinate

      Returns the point of the texture image that is mapped to the given point in 3D space (given as Vector3D) See the Wikipedia article on UV mapping.
      Parameters:
      vector - the vector to which the texture point is mapped
      Returns:
      a point on the texture image somewhere in the rectangle between (0, 0) and (1, 1)
    • getVector

      public static Vector3D getVector(double u, double v)
      For a given point of the texture (i.e. the image), return the point in 3D space where the point of the texture is mapped to (as Vector3D).
      Parameters:
      u - x-coordinate of the point on the texture (in the range between 0 and 1, from left to right)
      v - y-coordinate of the point on the texture (in the range between 0 and 1, from top to bottom)
      Returns:
      the vector from the origin to where the point of the texture is mapped on the sphere