Omni.usd.get_world_transform_matrix and omni.usd.get_local_transform_matrix give the same result

The title pretty much explains it. When I use these functions to get the transformations matrix of a prim they give the same transformation matrix. Should they not be inverse of each other? The way I understand it local_transform should give the world to local and world_transform should give the local to world matrix.

Hi @dkalpay - In terms of USD, the “world transform” and “local transform” refer to the transformation of an object with respect to different coordinate systems:

  • The world transform of an object is the transformation matrix that transforms the object’s coordinates from its local space to the world space. In other words, it is the cumulative transformation, including all of its parent transforms, that places the object within the global scene’s coordinate system.
  • The local transform of an object is the transformation matrix that defines the object’s position, rotation, and scale within its own local coordinate system, typically with respect to its immediate parent node in the hierarchy (if it has one).

The local transform matrix does not represent the world-to-local transformation. Instead, it represents how to move from the object’s parent space to the object’s local space.

Usually, when you call functions like omni.usd.get_world_transform_matrix and omni.usd.get_local_transform_matrix, they should provide different results unless the object’s local coordinate system coincides with the world coordinate system. This could be the case if:

  • The object is at the root of the scene graph (i.e., it has no parent, or its parent is the root).
  • The object and all its ancestor nodes have identity transforms (no translation, rotation, or scaling).

If you’re consistently getting the same result from both get_world_transform_matrix and get_local_transform_matrix for an object that is not at the root of the hierarchy, it’s possible that there’s an issue with how these functions are being called, or how the transforms are being computed/applied, or how the scene graph is structured.

Here is a simple example to differentiate them:

  • If an object A is positioned at (0, 0, 5) in world space, and this is its only transformation (no parent with a non-identity transformation), both its world transform and local transform will be a translation by (0, 0, 5).
  • If an object B is parented to A, and it is also positioned at (0, 0, 5) relative to A (so (0, 0, 10) in world space), its local transform will be the same translation by (0, 0, 5), but its world transform would be a translation by (0, 0, 10).
1 Like

This makes sense. Thank you rthaker

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.