Ofcourse it’s possible, but the problem is that the order in which you apply matrices is important because it determines what the rest of the operations you do mean.
Using a matrix transformation is changing the object’s coordinate system; the reference point and orientation. When you build the matrix of the transformation, you are just doing that: generating a reference frame. After you are done composing the matrix, it’s used to multiply (transform) the vectors and move their values from model space to world space (or whatever space, but thinking of world space as a general intermidiate space will help).
There’s two ways to read the matrix transformations that you have applied. Left to right or right to left. Even if you know that mathematicaly your transformations will be applied from right to left you can still read them left to right and understand what’s happening. The key here is to interprete them correctly.
Assume this chain:
Rotate(90,0,1,0);
Translate(0,0,-100);
Which would read like this:
R * T * vector = transformed_vector
- Interpretation from left to right:
Think of each transformation as being applied to the object’s local axis. In a stasis state, the local object axis will be aligned with the world axis, so Z- is behind, Z+ in front, X- to the left, X+ to the right.
If you read the transformation as a rotation first, then think of it as rotating the complete package: the axis and the object. Thus, after the 90º rotation the Z-/Z+ axis is no longer aligned with the world’s Z; you just rotated the reference. It’s, in fact, aligned with the world’s X axis.
So you read the translation after after, which says “move back 100 units in Z”. This Z, however, refers to the previously rotated object which included the axis reference! So yes, it will go “back 100 units” but in its own axis, which will be the same, in this specific case, as moving it -100 units in world space’s X axis.
- Interpretation from right to left:
If you read them backwards (in the same way as they are multiplied), you can think of transformations as always being applied in world space and always referencing the world space axis. This is probably what normaly people learning how to use these things think it’s happening when they read them forward and obviously it becomes confusing.
So if you read the translation first, you can think of it as moving -100 in world Z. Easy enough.
Then when you read the rotation, think of the object, which is displaced to -100, rotating using the world axis as a reference. So it will not spin in its own object axis but instead rotate around the far away center, like the earth around the sun.
Just to reiterate, these two ways of thinking are just that: ways of envisioning what’s happening. The transformation I applied them to is exactly the same.
Obviously, if you change the actual order of the transformations then you are effectively changing the result.
So to answer your question, yes, it’s obviously possible to have a “base transformation” and then work applying transformations after, but then the order and values of those transformations will be dependant on the original base.
As for this:
For the matrices and learning them. I'm not sure I'm seeing the advantage. So would I...
Calculate physics movements..
calculate translations for object, store them in a matrix.
Calculate rotations for object, store them in a matrix.
Multiply them in correct order to get final matrix for object.
Later, render using loadMatrix ?
GL matrix functions are not helping you at all. All they are doing is hidding a beast you’ll eventualy have to face if you wish to continue doing anything in 3D. Manualy doing matrix calculations does not take longer than using the gl functions (bare some possible processor optimizations by the drivers, I guess) and definitely do not aid you with learning.
Personaly, I would just say that learning directly using core 3.3 is better, since it removes a massive amount of the clutter the API had and forces you to do things manualy, which means you must understand what you are doing.
Alas, it’s up to you how you aproach this.