Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tw = texture width
- tw = texture height
- ap = aspect ration = tw / th
- pw = preview width
- ph = preview height
- ppu = pixels per unit
- upp = units per pixel = 1 / ppu
- twu = texture width unit per preview pixel = tw / pw
- thu = texture height unit per preview pixel = (tw / pw) * ap
- upw = units per preview pixel width = pw * upp
- uph = units per preview pixel height = ph * upp
- convertToPreview(float worldX, float worldY) = Vector2(twu * worldX, thu * worldY)
- convertToWorld(float previewX, float previewY) = Vector2(upw * previewX, uph * previewY)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement