Original Post
I''ve been attempting to learn different rotation methods (quaternions, euler angles, angle-axis matrices), and I have come across a sticking point (for days now actually). I found this on gametutorials.com:
sorry that is so messy, wouldn''t all fit right. Anyways, for this paper I''m writing (for a grade) I have to know how to derive these, and this one has me stumped. Anybody know where the top formula came from????
// Find the new x position for the new rotated point vNewView.x = (cosTheta + (1 - cosTheta) * x * x) * vView.x; vNewView.x += ((1 - cosTheta) * x * y - z * sinTheta) * vView.y; vNewView.x += ((1 - cosTheta) * x * z + y * sinTheta) * vView.z; // Find the new y position for the new rotated point vNewView.y = ((1 - cosTheta) * x * y + z * sinTheta) * vView.x; vNewView.y += (cosTheta + (1 - cosTheta) * y * y) * vView.y; vNewView.y += ((1 - cosTheta) * y * z - x * sinTheta) * vView.z; // Find the new z position for the new rotated point vNewView.z = ((1 - cosTheta) * x * z - y * sinTheta) * vView.x; vNewView.z += ((1 - cosTheta) * y * z + x * sinTheta) * vView.y; vNewView.z += (cosTheta + (1 - cosTheta) * z * z) * vView.z; [source] <br><br> and I believe they derived it from this: | cos(b)cos(c) cos(b)sin(c) -sin(b) 0| | sin(a)sin(b)cos(c)-cos(a)sin(c) sin(a)sin(b)sin(c)-cos(a)cos(b)| |cos(a)sin(b)cos(c)+sin(a)sin(c) cos(a)sin(b)sin(c)-sin(a)cos(c) cos(A)cos(b) 0| | 0 0 0 0 |