- Home /
Learning about Vector algebra and manipulating an object
Hi everyone - I hope you all had a great Christmas and New Years break! :D
I'd like to start learning about Vector algebra(?) and how to manipulate an object's rotation, direction, etc. for more flexibility.
For example, in the following code:
transform.LookAt(transform.position + myCamera.transform.rotation * Vector3.back, myCamera.transform.rotation * Vector3.up);
How a position can be added to a rotation * direction and what it outputs, what the general rules are for this.
If you know of any examples/tutorials or resources on learning about this stuff it would be greatly appreciated (both Unity-specific or otherwise).
Thanks
Answer by Piflik · Jan 03, 2013 at 02:25 AM
Rotations are Quaternions, positions are Vector3. When you multiply a Quaternion and a Vector3, the Vector will be turned by the rotation specified by the Quaternion. The result will again be a Vector 3 and an be added to other Vectors.