mirror of
https://github.com/brl/mutter.git
synced 2025-02-19 14:44:10 +00:00

When doing affine transforms on 2D and 3D spaces, operations are done relative to the origin. That means that, when applying rotations and scales, we must: * translate (-anchor_x, -anchor_y, -anchor_z) * apply the operation * translate (anchor_x, anchor_y, anchor_z) Since OpenGL has its matrices applied in the reverse order, the usual way to do it is, then: * translate (anchor_x, anchor_y, anchor_z) * apply the operation * translate (-anchor_x, anchor_y, anchor_z) However, graphene matrices do not follow the GL format, so matrix operations are done as the first example. Now that we are using graphene_matrix_t for every matrix operation, the transform order is wrong. Apply the transform operations in the opposite order.