• 3D
  • Difference between global_transform.origin and global_transform, and when to use which?

I'm trying to understand the difference between a Spatial node's global_tranform.origin vs translation

When I print out both, they seem to always be identical, at least in the ways I'm using them so far.

print(global_transform.origin, translation)

The docs say that translation is "Local translation of this node." and the the origin is the "World space (global) Transform of this node", but I can't visualize the difference.

Are they the same thing? and if not, it what cases would they be different? Thanks!

Upon further consideration, this seems like a dumb question. They will only be the same if the node's parent is the scene's root node (and the root node hasn't been moved/translated). Otherwise, they very likely will be different, since translation gives the node's position relative to its parent node aka Local Space.

yup.

if you need to figure out how a child node is oriented vs its parent then local coordinates are what you want. If you need to know where it is in world space, use global_transform

local-point = global_transform.xform_inv(point) and global-point = global_transform.xform(local-point)