Advertisement

Getting lost in matrix math with rotation

Started by April 06, 2001 06:55 PM
-1 comments, last by SilentStrike 23 years, 7 months ago
I am trying to write a camera class for a little solar sim project I am making. I am having particular trouble doing the matrix multiplication neccesary to find the view direction (line of sight vector) for a yaw and pitch. From this tutorial, starting with a vector (0, 0 , 1) and an angle pitch with X axis and angle yaw with the Y-axis. From the first matrix multiplication, rotating about the x axis, x' = x = 0 y' = y cos(pitch) - z sin(pitch) = 0 - 1 sin (pitch) = -sin(pitch) z' = y sin(pitch) + z cos(pitch) = 0 + z cos(pitch) = cos(pitch) However, from this, when the pitch is 0, the vector produced will be (0, -sin(pitch), cos(pitch) ) or (0 , 0 , 1), which makes sense. However, when the angle is small but positive, it will be (0, slightly less than 0, slightly less than 1). However, this doesn't make sense, as when the pitch is > 0, the y component of the line of sight vector is negative. But it should be positive right? Please help me, I am hopeless lost in this and wishing I paid more attention in algebra 2 . Edited by - SilentStrike on April 6, 2001 7:56:25 PM

This topic is closed to new replies.

Advertisement