I noticed the DynamicCuboid constructor takes both a position and a translation. What’s the difference? Don’t those both say where the prim should go?
Edit: I’m guessing translation is relative to the parent frame? Then presumably you’re disallowed from specifying both the position and the translation?
World Space to Local Space
It seems like in world-space “scale” is manifested, while in local-space scale it is ignored. Assuming this is correct, how does one take a position in world-space and get it’s coordinates in local-space ("ie relative to (0,0,0) being the center of the object) and ignoring scale? I see a lot of local-to-world coordinate transforms but not the opposite.
Edit: Understanding the terminology better, I guess I want world pose to the local position and rotation used for joints.
Understanding get_local_transform_xform
Related to the above, I see there’s a get_local_transform_xform function. But I’m missing something – shouldn’t the position in local-space of a prim always be (0, 0, 0) with rotation (1,…)? So obviously that’s not what local space means, but I don’t get what it actually means.
Edit: Further reading makes me think this returns the pose relative to the parent prim – is this correct?
Seems like some of my confusion is due to conflating these three things:
World pose - location/orientation in world (absolute) coordinates
local space - location/orientation in the parent prims coordinates
local position/rotation - used when specifying joints - perhaps not elsewhere?
So presumably world pose takes into account scaling. And local position/rotation does not take into account scaling. And local space also takes into account scaling?
You’re correct in your understanding of the difference between position and translation. In the context of the DynamicCuboid constructor, position refers to the absolute position in the world space, while translation is relative to the parent frame. You’re also correct that you typically wouldn’t specify both at the same time.
As for transforming from world space to local space, you’re correct that scale is taken into account in world space but not in local space. To transform a position from world space to local space, you would typically use the inverse of the transformation matrix that transforms from local space to world space. This transformation matrix would typically be obtained from the parent object.
The get_local_transform_xform function returns the local transformation matrix for a prim, which includes both rotation and translation (and possibly scale, depending on the context) relative to the parent prim. You’re correct that in the local space of a prim, the prim’s own position is always (0, 0, 0) and its rotation is the identity rotation. However, the local transformation matrix returned by get_local_transform_xform describes how to transform from the prim’s local space to its parent’s space.
Your understanding of world pose, local space, and local position/rotation is correct. World pose refers to the absolute position and orientation in world coordinates. Local space refers to coordinates relative to the parent prim’s coordinates, taking into account the parent’s scale. Local position/rotation is used when specifying joints and does not take into account scale.