For a generic rotate3d(x, y, z, α), you have the matrix
where
You now get the matrices for each of the 3 rotate3d transforms and you multiply them. And the resulting matrix is the matrix corresponding to the resulting single rotate3d. Not sure how to easy it is to extract the values for rotate3d out of it, but it's sure easy to extract those for a single matrix3d.
In the first case (rotateX(50deg) or rotate3d(1, 0, 0, 50deg)), you have:
x = 1, y = 0, z = 0, α = 50deg
So the first row of the matrix in this case is 1 0 0 0.
The second one is 0 cos(50deg) -sin(50deg) 0.
The third one 0 sin(50deg) cos(50deg) 0.
And the fourth one is obviously 0 0 0 1.
In the second case, you have x = 0, y = 1, z = 0, α = 20deg.
First row: cos(20deg) 0 sin(20deg) 0.
Second row: 0 1 0 0.
Third row: -sin(20) 0 cos(20deg) 0.
Fourth: 0 0 0 1
In the third case, you have x = 0, y = 0, z = 1, α = 15deg.
First row: cos(15deg) -sin(15deg) 0 0.
Second row sin(15deg) cos(15deg) 0 0.
And the third and the fourth row are 0 0 1 0 and 0 0 0 1 respectively.
Note: you may have noticed that the signs of the sin values for the rotateY transform are different than for the other two transforms. It's not a computation mistake. The reason for this is that, for the screen, you have the y-axis pointing down, not up.
So these are the three 4x4 matrices that you need to multiply in order to get the 4x4 matrix for the resulting single rotate3d transform. As I've said, I'm not sure how easy it can be to get the 4 values out, but the 16 elements in the 4x4 matrix are exactly the 16 parameters of the matrix3d equivalent of the chained transform.
EDIT:
Actually, it turns out it's pretty easy... You compute the trace (sum of diagonal elements) of the matrix for the rotate3d matrix.
Depends on what you are trying to do, this 'hack' could help you. Let's say you are doing animation, and you want add transformation after transformation and so on, and you don't want the CSS to look like it's doing 100's of transformations:
This works in chrome:
1. Apply whatever transform you want to an element.
2. Next time you want to add a transform, add it to the computed transform:
"window.getComputedStyle(element).transform" - but make sure to put the new transform to the left.
3. Now your transform would look like "rotateZ(30deg) matrix3d(......).
4. Next time you want to add another transform, repeat the process - Chrome always reduces the transforms to matrix3d notation.
TL;DR- apply whatever transforms you want, and then get the computed matrix3d transformation.
This trick also lets you quickly (that is, without doing any math by yourself) make a functionality that rotates an object with respect to your reference frame in any direction. See the sample below:
EDIT: I have added xyz translations as well. Using this, it would be very easy to place objects in specific 3d locations with specific orientations in mind. Or...imagine a cube that bounces and changes it's spin axis with each bounce depending on how it lands!