-
-
Save JT5D/e707231fed0bcd0b4850 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // quad pos: 0.5, 0.5, 0 | |
| // quad scale: 2, 1, 0 | |
| // texture size: 1280x720 | |
| Vector3 wPos = new Vector3(x,y,0); // x,y = texture pixel pos | |
| float localX = wPos.x*2 / tex.width - 0.5f * 2; // 2 = quad transform scale | |
| float localY = wPos.y / tex.height - 0.5f * 1; | |
| wPos = transform.TransformPoint(new Vector3(localX, localY, 0)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment