
398 V 3D Engine Design
3.2.5 Parent Switch in Hierarchy
In a 3D engine we often need to modify objects’ parent-children relationship. One
condition that most engines try to enforce is that after changing the parent of
an object, the object’s global transformation remains unchanged. In other words,
we want to change the local transformation such that the global transformation
is still the same. Obviously, that forces us to recompute local TRS values of the
object whose parent we’re changing. Note that if the previous parent’s scale is
nonuniform and it’s different from the nonuniform scale of the new parent, the
skew of the object will change and as