I don't understand this, this is from https://learnopengl.com/Getting-started/Transformations tutorial and it explains that while in the code we first translate and then rotate, rotate actually happens first? But I don't understand this... We have a matrix and we fill it such that matrix multiplication will result to our desired rotation/translation/scaling, but then it doesn't make sense that one of them happens first because all of the matrix is multiplied with the position vector in the vertex shader and it happens all at once which I thought was the exact point and main strength of using matrices for this?
It may be correct to first apply translate and then rotate so that we get that desired result but the whole idea just doesn't make sense that we first rotate and then translate... no, we first translate and then rotate because for example maybe we wanted to first rotate and then translate but in order to get the correct matrix in the end we need to first translate and then rotate, but obviously we first change the matrix with translate and then with rotate so I don't understand how it could ever work the other way arround?
I understand that explaining difficult topics is hard and this is not to apply criticism on the tutorials it's just that I am very curious about this and very annoyed about this. I understand that it may be very complex but I think that there must be a simple explanation for this that explains what happens without going in depth, for example by just explaining how the functions work or how the matrix is generated or what is meant by it without necesarily having to understand all the math behind it. Not that I would mind to understand it, but I guess this would be a much bigger dive into it than just explaining what the tutorial means by what it's saying.
The solution to the excercise 1 in the end is this: https://learnopengl.com/code_viewer_gh.php?code=src/1.getting_started/5.2.transformations_exercise1/transformations_exercise1.cpp and I do not understand their explanation at all.
While we are used to operations working from left to right, for matrices it is typical to apply them right to left. I don't recall the historical reason for that.
Consider a rotation matrix M_R, a translation matrix M_T, and V is the vector we are transforming. Applying the transforms one at a time, you would see it happen like this:
You can still calculate M_T * M_R first, but because the associative property does apply to matrix multiplication, it doesn't affect the result: