Class UVMapping
java.lang.Object
org.openstreetmap.josm.gui.util.imagery.UVMapping
A utility class for mapping a point onto a spherical coordinate system and vice versa
- Since:
- 18246
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Point2D.DoublegetTextureCoordinate(Vector3D vector) Returns the point of the texture image that is mapped to the given point in 3D space (given asVector3D) See the Wikipedia article on UV mapping.static Vector3DgetVector(double u, double v) For a given point of the texture (i.e.
-
Field Details
-
TWO_PI
- See Also:
-
-
Constructor Details
-
UVMapping
private UVMapping()
-
-
Method Details
-
getTextureCoordinate
Returns the point of the texture image that is mapped to the given point in 3D space (given asVector3D) 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
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 (asVector3D).- 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
-