Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. tw = texture width
  2. tw = texture height
  3. ap = aspect ration = tw / th
  4. pw = preview width
  5. ph = preview height
  6. ppu = pixels per unit
  7. upp = units per pixel = 1 / ppu
  8.  
  9. twu = texture width unit per preview pixel = tw / pw
  10. thu = texture height unit per preview pixel = (tw / pw) * ap
  11.  
  12. upw = units per preview pixel width = pw * upp
  13. uph = units per preview pixel height = ph * upp
  14.  
  15. convertToPreview(float worldX, float worldY) = Vector2(twu * worldX, thu * worldY)
  16. convertToWorld(float previewX, float previewY) = Vector2(upw * previewX, uph * previewY)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement