I’m attempting to create the composite transformation matrix
using individual 4×4 matrices derived from the values of the following properties:
order
perspective
rotate
scale
transform
transform-origin
The specification describes the order to follow when computing the transformation matrix:
The transformation matrix is computed from the transform,
transform-origin, translate, rotate, scale, and offset properties as
follows:
Start with the identity matrix.
Translate by the computed X, Y, and Z values of
transform-origin
.Translate by the computed X, Y, and Z values of
translate
.Rotate by the computed
<angle>
about the specified axis ofrotate
.Scale by the computed X, Y, and Z values of
scale
.Translate and rotate by the transform specified by
offset
.Multiply by each of the transform functions in
transform
from left to
right.Translate by the negated computed X, Y and Z values of
transform-origin
.
I have two questions about this:
-
Why doesn’t the specification mention
perspective
? Isn’t that also part of the composite transformation? If so, where would it fall in the order? -
How would I convert the
offset
value into a 4×4 matrix to multiply with the others? I’ve been able to convert all the other values to 4×4 matrices, but I’m not sure what to do about this.offset
is shorthand for five values. I’m not sure how to combine these five into one matrix, and some of them likeoffset-path
could be very complex, so I have no idea where to start. Information is sparse from what I’ve been able to find.