In the wagon example, a translation is applied to the wagon group to make the wagon body and four wheels move a specified distance. A rotation is applied to each wheel group so that the wheels rotate in addition to the translation.
During the top-down and depth-first traversal that happens when the entire group is drawn, the TGraphicGroup transformation functions recursively call the transformation functions of the adopted groups and graphics. The transformation matrix of the parent is postconcatenated with the matrix of the child. For example, the transformation and rotation matrix for the wagon wheels is found by multiplying the wagon group transformation matrix by the wagon wheel rotation matrix as follows:
( ( wagon wheel rotation matrix ) * ( wagon group translation matrix ) )