Skip to content

Coordinate spaces and transforms

bartteunis edited this page Aug 13, 2020 · 6 revisions

This page gives an overview of the coordinate systems used by SMF.

Coordinate system handedness

SMF uses a right-handed coordinate system, as shown in the image below.

Note In the image we see that the colors of the x, y and z axes in the SMF Model Tool are g, b, r respectively.

World

This image shows that the bone axis is oriented along the local x axis.

If we output the offsets and location rotations using show_debug_message, we get the following output:

NodeInfo - Node: 0 - World: { { 0,0.00,0 },  } - Local: { { 0,0,0 },  } - LocalRot: 0
NodeInfo - Node: 1 - World: { { -0.00,0.00,8.00 },  } - Local: { { -0.00,-0.00,8.00 },  } - LocalRot: 270
NodeInfo - Node: 2 - World: { { 4.00,0.00,8.00 },  } - Local: { { 0.00,0.00,-4.00 },  } - LocalRot: 90.00
NodeInfo - Node: 3 - World: { { 0.00,0.00,12.00 },  } - Local: { { 4.00,-0.00,0.00 },  } - LocalRot: 0
NodeInfo - Node: 4 - World: { { 4,0.00,-0.00 },  } - Local: { { 4,0.00,-0.00 },  } - LocalRot: 360

Let's take a look at bone 2. Its world coordinates are (4, 0, 8). That's easy to see.
The local coordinates are a bit harder to interpret. To interpret those correctly we need to look at the parent node's axes. In this case, the parent node is node 1.
Node 1's x axis is oriented along the world z axis and its z axis is oriented along the world's negative x axis.
Because of this node 2 is on the negative side of the local z axis; it has local coordinates (0, 0, -4). Node 3 is oriented along the z axis in world space which corresponds to its parent node's (node 1) local x axis.
Therefore node 3 has local coordinates (4, 0, 0).

Nice-to-know The rig is stored in the SMF file using the world-space DQs of each node.

Local

The local space is the bone space. Its origin is located at the parent node.