<style> .reveal-up, .reveal-left, .reveal-right, .reveal-stagger > * { opacity: 1 !important; transform: none !important; } </style>
  1. Learn
  2. BIM Math
  3. Foundations
All lessons in this course

Lesson 2 of 44 14 minBeginner

Coordinate systems: 2D, 3D, right-handed, Z-up

Origins, axes and coordinates; why BIM uses a right-handed Z-up system; how to convert from Y-up formats such as glTF; and why the screen’s Y axis points down.

To describe where something is, you need three things: an origin (the zero point), a set of axes (directions to measure along) and a unit (how long “1” is). A coordinate is just the distance from the origin along each axis.

In plan: X and Y

On a floor plan, the usual convention is X to the right (east on a north-up drawing) and Y up the page (north). A column at (6, 4) sits 6 m east and 4 m north of the origin. Negative values are simply west of or south of it.

In 3D: add Z for height

BIM tools (Revit, ArchiCAD, IFC files, AutoCAD, Rhino) add a third axis, Z, pointing up. So a point on level 2 at 3.5 m might be (6, 4, 3.5). Plans look straight down the Z axis; elevations look along X or Y.

Turn the axes below, move the point and switch between conventions. The dashed lines walk from the origin to the point: across the floor first, then straight up. Notice which letter “up” has in each convention.

Interactive

Axes, handedness and “up”

+X+Y+ZP (2, 3, 2.5)↺ positive turn about +Z, seen from above
Z-up, right-handed (Revit, IFC, AutoCAD, Rhino). Up is +Z. Right hand: fingers along +X, curl towards +Y, thumb gives +Z. This point is (2, 3, 2.5) in BIM (Z-up, right-handed) coordinates.

Right-handed and left-handed

Once X and Y are fixed there are two choices for the third axis. In a right-handed system, point the fingers of your right hand along +X, curl them towards +Y, and your thumb points along +Z. A left-handed system uses the left hand, so its Z points the other way.

  • Handedness also fixes which way is a positive rotation: in a right-handed system, a positive angle about Z turns counter-clockwise when you look down from above. That is the convention used throughout this course.
  • It decides the direction of the cross product (coming in the Vectors module), which is how software finds a face’s outward normal.
  • Mixing the two silently mirrors a model: left becomes right, and every door swings the wrong way.
Software or formatUp axisHandedness
Revit, IFC, AutoCAD, Rhino, ArchiCADZRight-handed
glTF, three.js, OpenGL conventionYRight-handed
UnityYLeft-handed
Unreal EngineZLeft-handed

Converting Y-up to Z-up

Exporting a model to a web viewer or a game engine, or importing a glTF file, means converting between conventions. For two right-handed systems the rule is short: the Y-up “up” becomes Z, and the Y-up “towards the viewer” axis becomes minus Y.

YUpToZUp.cs
using P3 = (double X, double Y, double Z); static P3 YUpToZUp(P3 p) => (p.X, -p.Z, p.Y);static P3 ZUpToYUp(P3 p) => (p.X, p.Z, -p.Y); P3 columnTop = (4, 3, -2);          // from a glTF file: Y is upP3 inModel = YUpToZUp(columnTop);Console.WriteLine($"Z-up: {inModel}");Console.WriteLine($"Back: {ZUpToYUp(inModel)}");
Output
Z-up: (4, 2, 3)
Back: (4, 3, -2)

Screens point Y down

Screens, images, SVG and WPF all put the origin at the top-left with Y growing downwards. To draw a plan you flip Y and scale from metres to pixels. Every widget on this page does exactly this.

ToScreen.cs
// Plan (metres, Y up) to a canvas (pixels, Y down) that is 'height' pixels tall.static (double X, double Y) ToScreen(double x, double y, double scale, double height)    => (x * scale, height - y * scale); Console.WriteLine(ToScreen(0, 0, 50, 400));     // origin: bottom-left cornerConsole.WriteLine(ToScreen(6, 4, 50, 400));
Output
(0, 400)
(300, 200)

Several origins in one project

A real project has more than one coordinate system. The internal origin is where the software measures from; a project base point gives the building a convenient origin (often a grid intersection); the survey point ties the model to real-world site coordinates. Elements inside a family or block have their own local coordinates too. The Matrices module shows how to move between all of them.

Quick check

In a right-handed system with X east and Y north, where does +Z point?

Quick check

A point is (5, 2, 7) in a right-handed Y-up file. Where is it in a right-handed Z-up model?

Practice

A glTF export (Y-up) contains three points: (1, 3.5, -2), (4, 7.2, -1) and (2, 6, -5). Convert them to Z-up and print the highest point (largest Z).

Show a hint

Convert with (x, -z, y), then keep the point whose Z is largest.

Show the solution
Solution.cs
using P3 = (double X, double Y, double Z); static P3 YUpToZUp(P3 p) => (p.X, -p.Z, p.Y); P3[] fromFile = { (1, 3.5, -2), (4, 7.2, -1), (2, 6, -5) }; P3 highest = YUpToZUp(fromFile[0]);foreach (P3 p in fromFile){    P3 q = YUpToZUp(p);    if (q.Z > highest.Z) highest = q;}Console.WriteLine($"Highest: {highest}");
Output
Highest: (4, 1, 7.2)

Remember

  • A coordinate system is an origin, axes and a unit; a coordinate is the distance along each axis.
  • BIM tools and IFC use a right-handed, Z-up system: X east, Y north, Z up, positive rotation counter-clockwise from above.
  • Right-handed Y-up to Z-up is (x, y, z) → (x, −z, y); dropping the minus sign mirrors the model.
  • Screens put Y down: flip and scale to draw a plan.
  • Projects have several origins (internal, project base, survey, local), connected by transforms.
0 of 44 lessons completed