Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void project(float x, float y, float z, int* dx, int *dy) {
- *dx = x * (TILE_W/2) - y * (TILE_W/2);
- *dy = x * (TILE_H/2) + y * (TILE_H/2) - z;
- }
- void invProject(float x, float y, float z, int* dx, int* dy) {
- float tw = TILE_W/2, th = TILE_H/2;
- *dx = x / tw + ((y + z) / th - x / tw) / 2;
- *dy = ((y + z) / th - x / tw) / 2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement