Skip to content

How can I translate the position #210

Answered by saul
jacobxy asked this question in Questions
Discussion options

You must be logged in to vote

Take a look at these .json files: https://github.com/saul/gamevis/tree/master/overviews/csgo

Imagine you have a world-space co-ordinate named worldSpace, such as {x: 3305.17170, y: 11590.83300}.

To determine where this position fits on the map, do:

map_x = (worldSpace.x - pos_x) / scale
map_y = (worldSpace.y - pos_y) / scale

Where pos_x, pos_y and scale are taken from: https://github.com/saul/gamevis/blob/master/overviews/csgo/de_dust2.json

Replies: 15 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by saul
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #18 on February 28, 2021 13:59.