Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1.     void project(float x, float y, float z, int* dx, int *dy) {
  2.         *dx = x * (TILE_W/2) - y * (TILE_W/2);
  3.         *dy = x * (TILE_H/2) + y * (TILE_H/2) - z;
  4.     }
  5.     void invProject(float x, float y, float z, int* dx, int* dy) {
  6.         float tw = TILE_W/2, th = TILE_H/2;
  7.         *dx = x / tw + ((y + z) / th - x / tw) / 2;
  8.         *dy = ((y + z) / th - x / tw) / 2;
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement