Part1
I have a camera. It is specified by 4x4 matrix from XML.
Also I have scalar value “distance to target”.
I need to calculate the target pos.
First step: calculate cameraPos and direction quaternion.
XMMATRIX M = LoadMatrixFromXML();
XMVECTOR scale, rotationQuaternion, cameraPos;
XMMatrixDecompose(&scale, & rotationQuaternion, &cameraPos, M);
float distanceToTarget = LoadDistanceFromXML();
Question1:
How to calculate position of a target, if I have cameraPos, distanceToTarget and rotationQuaternion?
=============================================
Part2.
I found many sources about what are quaternions, vectors, matrices and the math that is behind of them.
I found a lot of DirectXMath functions in MSDN.
But I can’t find a missed link between them: how to link math tasks like I am struggled with the DirectXMath library.
Quesion2:
Can anyone share a good connection link between math tasks and how are they can be solved with DirectXMath library?
It might be a link to a book, url, ....
Thanks in advance.