To put things into context, I'm tryingto make the active camera rotate around the camera target, when the mouse is moved while holding the middle mouse button (just like in so many RTS games).
I never learnt about matrices in school. I did now, through the web, to understand their concept.
I'm still having trouble understanding exactly how matrices are used. Let me see if I got it right. Im my case, I would do something like this:
- cpp Code: Select all
m.setRotationCenter (camera->getTarget(), /*what is this translate vector?*/);
m.setRotationDegrees(vector3df(10 * MouseMove.X, 10 * MouseMove.Y, 0)); //where MouseMove is delta position of mouse
m.transformVect (//and then I should get the position + direction vector of the camera);
Should the transformed vector be the camera's target?
Or am I doing this all completely wrong?
Please point me in the right direction if I need to learn more about matrices...