Created
February 18, 2013 20:53
-
-
Save flarb/4980627 to your computer and use it in GitHub Desktop.
Converts pixel coordinates in a texture to UV coordinates in Unity3D.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vector2 uv = new Vector2((float)myMarker.pixelCoords.x / (float)renderer.material.mainTexture.width, 1f - (float)myMarker.pixelCoords.y / (float)renderer.material.mainTexture.height); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what is uv coordinates?