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)`

.

This makes sense. Thank you rthaker

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