Created
January 30, 2020 05:01
-
-
Save qw3rtman/cf8c5c6e61ae7110897871cc0e2d01df to your computer and use it in GitHub Desktop.
for supertux, mapsize=192
This file contains 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
map_size = 192 | |
pos_map = torch.FloatTensor([map_size // 2, map_size]) | |
def cam_to_map(points): | |
points[:,0] *= 32768 | |
points[:,1] *= 4000 | |
points[..., 1] *= -1 | |
pixel_coords = (points - points[0]) + pos_map | |
return pixel_coords |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment