Time for action – finding the spot

Using coordinates, we pinpoint a location in 3D space by specifying the distance from the origin along the three axes x, y, and z.

Tip

Remember the order: (x,y,z) coordinates always go in the same rut (Right-Up-Towards you). You can use the word R.U.T. as a mnemonic.

So how do you go about locating a point? Let's try to find coordinate (2,3,-4):

  1. Always start at the origin.
  2. The first value of the (2,3,-4) coordinates tells you to go two steps right, following the arrow of the x axis.
  3. The second value of the (2,3,-4) coordinates tells you to go three steps up, following the arrow of the y axis.
  4. The third value of the (2,3,-4) coordinates tells you to go four steps away from you, against the arrow of the z axis.

What just happened?

If you followed the description with your finger on the picture, you moved two steps right, three steps up, and four steps into the page—your finger is now at coordinate (2,3,-4).

Try another example: the point (1,3,2) is one step right, three steps up, and two steps towards you. Here is one with negative numbers—the point (-3,-2,-1) is three steps left, two steps down, and one step away from you.

Using this coordinate system, you can pinpoint every spot in the 3D space.

In case you are wondering, What's a step? A kilometer, an inch?, our unit of measurement is the world unit, abbreviated as WU. In most games that are set in the human world, 1 WU is 1 meter. If your game is set in an ant hill, you can declare the WU to be 1 millimeter; if your game is set in outer space, you can declare it to be 1 lightyear. The important thing is that you tell your graphic designers which unit size they should work with, so that you do not have to worry about scaling models later.

Every time you create 3D models on a grid or use a method that expects float values, which represent a size, scale, or distance, then you are working in world units.

Pop quiz – which way, vector?

Q1. List the three directions that the values in the coordinates stand for, in the correct order. Use the mnemonic you have learned.

  1. Z = left, Y = up, X = go back (mnemonic L.U.G.)
  2. X = right, Y = up, Z = towards you (mnemonic R.U.T.)
  3. X = red, Y = green, Z = blue (mnemonic R.G.B.)
  4. Z = north, Y = east, X = away from you (mnemonic N.E.W.)