Saturday, July 8, 2017

Global vs Local

There are times when it is beneficial to work either in what is referred to as Local or Global space.  This manifests itself in a few places.  In the editor, you may have seen these buttons.  They toggle where the center point of an object is [Center/Pivot], and the transform reference [Local/Global]

 

As an example of the distinction, Center will place the transform marker at the average center of the object including the shape of its children.  To the contrary, the Pivot will place the center at what I would call the "center reference" as defined in the original model.

In the same way Local and Global refer to the reference in space for the transform.  This can be most easily seen in the available transform functions.

  • eulerAngles/localEulerAngles
  • position/localPosition
  • rotation/localRotation
  • scale/localScale
Specifically with child objects, using one or the other makes a significant difference in behavior.  Making changes to the global transform of a child object will control it irrespective of what the parent is doing whereas local changes are relative to what the parent is doing.

No comments:

Post a Comment