On 1/28/2018 at 1:56 PM, ryt said:
How could I extract for example Forward vector (in DirectXMath) from some matrix that stores some object position, rotation,...?
You only need two orthographic (="right angle") vectors, and everything else follows.
The cross product of the forward and up vector is the right vector (or left vector, if that's your world view). Each of those three of forward, up, and right can be negated to give you reverse, down, and left.
If you have a transformation matrix, I suggest learning a bit about how a matrix is composed. This is for row-major:
![transform_matrix_explained.PNG.7cb47cb3b73be374967871c9483fc2e3.PNG](https://uploads.gamedev.net/monthly_2018_02/transform_matrix_explained.PNG.7cb47cb3b73be374967871c9483fc2e3.PNG)
That is, if you have a graphics transformation matrix already, the three basis functions tell you the directions for forward, up, and right, the position or offset tells you the position or offset, the flag at the bottom right should be zero for vectors (that are position-less) or one for points (that have a position).
In the identity matrix, the forward direction or x-basis is [1,0,0] since it is fully pointing in the X direction, Y is similarly 100% in the transformed Y axis, Z is 100% in the transformed Z axis. As you turn the basis vectors also change, so the forward is transformed to some other direction, the components in each direction change as well.