The matrix I'm using is a row-major matrix used by OpenGL. Here's what it looks like:
[ X1 Y1 Z1 WX ]
[ X2 Y2 Z2 WY ]
[ X3 Y3 Z3 WZ ]
[ TX TY TZ CZ ]
What you have is actually three matrices: a rotation matrix, a scale matrix and a translate matrix. This is because virtually any 4x4 matrix can be broken down to two or more matrices that together form the original matrix. A matrix concatenation looks like this:
mat4x4 m0, m1, m2
m2[X1] = (m1[X1] * m0[X1]) + (m1[Y1] * m0[X2]) + (m1[Z1] * m0[X3]) + (m1[WX] * m0[TX]);
m2[Y1] = (m1[X1] * m0[Y1]) + (m1[Y1] * m0[Y2]) + (m1[Z1] * m0[Y3]) + (m1[WX] * m0[TY]);
m2[Z1] = (m1[X1] * m0[Z1]) + (m1[Y1] * m0[Z2]) + (m1[Z1] * m0[Z3]) + (m1[WX] * m0[TZ]);
m2[WX] = (m1[X1] * m0[WX]) + (m1[Y1] * m0[WY]) + (m1[Z1] * m0[WZ]) + (m1[WX] * m0[CZ]);
m2[X2] = (m1[X2] * m0[X1]) + (m1[Y2] * m0[X2]) + (m1[Z2] * m0[X3]) + (m1[WY] * m0[TX]);
m2[Y2] = (m1[X2] * m0[Y1]) + (m1[Y2] * m0[Y2]) + (m1[Z2] * m0[Y3]) + (m1[WY] * m0[TY]);
m2[Z2] = (m1[X2] * m0[Z1]) + (m1[Y2] * m0[Z2]) + (m1[Z2] * m0[Z3]) + (m1[WY] * m0[TZ]);
m2[WY] = (m1[X2] * m0[WX]) + (m1[Y2] * m0[WY]) + (m1[Z2] * m0[WZ]) + (m1[WY] * m0[CZ]);
m2[X3] = (m1[X3] * m0[X1]) + (m1[Y3] * m0[X2]) + (m1[Z3] * m0[X3]) + (m1[WZ] * m0[TX]);
m2[Y3] = (m1[X3] * m0[Y1]) + (m1[Y3] * m0[Y2]) + (m1[Z3] * m0[Y3]) + (m1[WZ] * m0[TY]);
m2[Z3] = (m1[X3] * m0[Z1]) + (m1[Y3] * m0[Z2]) + (m1[Z3] * m0[Z3]) + (m1[WZ] * m0[TZ]);
m2[WZ] = (m1[X3] * m0[WX]) + (m1[Y3] * m0[WY]) + (m1[Z3] * m0[WZ]) + (m1[WZ] * m0[CZ]);
m2[TX] = (m1[TX] * m0[X1]) + (m1[TY] * m0[X2]) + (m1[TZ] * m0[X3]) + (m1[CZ] * m0[TX]);
m2[TY] = (m1[TX] * m0[Y1]) + (m1[TY] * m0[Y2]) + (m1[TZ] * m0[Y3]) + (m1[CZ] * m0[TY]);
m2[TZ] = (m1[TX] * m0[Z1]) + (m1[TY] * m0[Z2]) + (m1[TZ] * m0[Z3]) + (m1[CZ] * m0[TZ]);
m2[CZ] = (m1[TX] * m0[WX]) + (m1[TY] * m0[WY]) + (m1[TZ] * m0[WZ]) + (m1[CZ] * m0[CZ]);
So let's get down to business. First, we have the scale matrix:
sx = 1.0
sy = 1.0
sz = 1.0
mat4x4 mat_scale =
[ sx, 0.0, 0.0, 0.0 ]
[ 0.0, sy, 0.0, 0.0 ]
[ 0.0, 0.0, sz, 0.0 ]
[ 0.0, 0.0, 0.0, 1.0 ]
The rotational matrix can be further broken down to a matrix on the x-, y- and z-axis.
Rotation over x-axis:
cx = cos(deg_to_rad(117.882))
sx = sin(deg_to_rad(117.882))
mat4x4 mat_x =
[ 1.0, 0.0, 0.0, 0.0 ]
[ 0.0, cx, sx, 0.0 ]
[ 0.0, -sx, cx, 0.0 ]
[ 0.0, 0.0, 0.0, 1.0 ]
Rotation over y-axis:
cy = cos(deg_to_rad(2.189))
sy = sin(deg_to_rad(2.189))
mat4x4 mat_y =
[ cy, 0.0, -sy, 0.0 ]
[ 0.0, 1.0, 0.0, 0.0 ]
[ sy, 0.0, cy, 0.0 ]
[ 0.0, 0.0, 0.0, 1.0 ]
Rotation over z-axis:
cz = cos(deg_to_rad(154.074))
sz = sin(deg_to_rad(154.074))
mat4x4 mat_z =
[ cz, -sz, 0.0, 0.0 ]
[ sz, cz, 0.0, 0.0 ]
[ 0.0, 0.0, 1.0, 0.0 ]
[ 0.0, 0.0, 0.0, 1.0 ]
So our final rotation matrix becomes:
mat4x4 mat_rotation = mat_x * mat_y * mat_z;
Finally, the translation matrix:
tx = 1.542
ty = 3.319
tz = -1.821
mat4x4 mat_translation =
[ 1.0, 0.0, 0.0, 0.0 ]
[ 0.0, 1.0, 0.0, 0.0 ]
[ 0.0, 0.0, 1.0, 0.0 ]
[ tx, ty, tz, 1.0 ]
Putting it all together:
mat4x4 mat_transform = mat_scale * mat_rotation * mat_translation;
If you want, you can write out all the concatenations and get a valid matrix. But I believe it's easier to keep it in either separate matrices like I've done or in matrix operations (AddRotationX, Scale, etc.)