Toolvito

Works on this device

Game Coordinate Converter

Move points between the coordinate systems of screens, canvases, game worlds and 3D programs. You choose where 0, 0 is, which way y grows, the camera, or the axes for right, up and forward. The rule used is shown with every result.

Enter your values

Use this to move points between screen, canvas, window and world coordinates whose 0, 0 or y direction differ.

Your values

1 for coordinates in pixels. For world units, the pixels in one unit, such as 100.

The width of the screen, window, canvas or level in pixels.

Separate x and y with a comma or a space. Use a point for decimals, and no thousands commas. Up to 1,000 points.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Convert.

How to use this converter

  1. Choose a conversion, for example Between two 2D systems.
  2. Describe the system you have and the one you want, or pick an example from the menus. Each example fills the fields, and you can change them.
  3. Type the points, one on each line, such as 960, 540.
  4. Choose Convert. Copy or download the converted points, or the table as a CSV file.

The rules

  • 2D systems: each point is turned into pixels from the top left corner with y down, then into the target system. From top left with y down to bottom left with y up on a screen 1080 pixels high, the rule is x′ = x and y′ = −y + 1080.
  • Screen and world: one screen pixel is 2 × orthographic size ÷ screen height world units (the size is half the visible height, as in Unity). World x = camera x + (screen x − width ÷ 2) × that amount; world y = camera y + (height ÷ 2 − screen y) × that amount, for screen y that grows down.
  • 3D axes: each point is split into its right, up and forward amounts, then written in the other axes and multiplied by the scale. A convention is left-handed when the determinant of its right, up and forward axes is +1, and right-handed when it is −1.
  • Square grids: column = floor((x − grid corner x) ÷ tile width), and the corner of a tile = grid corner + tile number × tile size.
  • All coordinates are worked out with exact fractions from the digits you type.

Worked example

A screen of 1920 × 1080 pixels with 0, 0 at the top left and y down. The point 100.5, 20 in a system with 0, 0 at the bottom left and y up is 100.5, 1060.

A camera at 0, 0 with an orthographic size of 5 on the same screen: one pixel is 10 ÷ 1080, about 0.009259 units. The mouse at 0, 0 (top left) is at about −8.889, 5 in the world: x = (0 − 960) × 10 ÷ 1080 and y = (540 − 0) × 10 ÷ 1080.

From Unity axes (X right, Y up, Z forward) to Blender axes (X right, Z up, Y forward), the rule is x′ = x, y′ = z and z′ = y, so 1, 2, 3 becomes 1, 3, 2. The handedness changes, so it is a mirror.

Limits you should know

  • Rotations, quaternions and Euler angles are not converted. A mirror between left- and right-handed axes also reverses rotation directions and the winding of triangles.
  • The camera mode is for an orthographic camera that does not rotate. A perspective camera needs the depth of each point.
  • The example conventions are common defaults of each program. Export settings and plug-ins can change the axes, so check your own files.
  • Isometric (diamond) tiles use other formulas: see the Isometric Coordinate Calculator.

Related tools