Skip to content

Instantly share code, notes, and snippets.

@qw3rtman
Created January 30, 2020 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qw3rtman/cf8c5c6e61ae7110897871cc0e2d01df to your computer and use it in GitHub Desktop.
Save qw3rtman/cf8c5c6e61ae7110897871cc0e2d01df to your computer and use it in GitHub Desktop.
for supertux, mapsize=192
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