Back to main page

Spaces

World space is locked to the center of the world. This is useful because it is not relative to any specific object.

Object space is following an object's position and orientation. This is how vertices are represented in models.

Relative space is following an object's position but not orientation. This is used when applying forces and impulses to rigid bodies because it is fast to convert from the point of impact in world space and can be used directly when calculating the effect on angular velocity.

Bone space is following a bone in a model or bone frame with both position and orientation. Bone space is relative to object space so that bone frames can be reused on different locations.

Parent space is relative to a bone's parent bone with both position and orientation. This is used for enforcing that child bones are connected to their parents after giving each bone an orientation. Since bones don't have their orientation in parent space, it can not be used to inherit the orientation.

Convert from world space to object space:

Subtract the object space origin and multiply with the inverse of the 3x3 axis system.

If every axis have length 1 and the 3x3 axis system is orthogonal, the transpose of the 3x3 axis system is also it's inverse.

Convert from object space to world space:

Multiply with the 3x3 axis system and add the object space origin.

Convert from object space to relative space:

Multiply with the 3x3 axis system.

Convert from relative space to object space:

Multiply with the inverse of the 3x3 axis system.

If every axis have length 1 and the 3x3 axis system is orthogonal, the transpose of the 3x3 axis system is also it's inverse.

Convert from relative space to world space:

Add the object space origin.

Convert from world space to relative space:

Subtract the object space origin.

Convert from object space to bone space:

Subtract the bone's origin and multiply with the transpose of the bone's 3x3 axis system.

Convert from bone space to object space:

Multiply with the 3x3 axis system and add the bone's origin.