I am currently trying to construct a vector in space given yaw, pitch, and roll with the assumption that my ray originates from (0,0,0).
I started by breaking up the problem into 3 sets of triangles by slicing space in 3 ways:
- In the X-Y plane, I concluded that x = sin(yaw) and y = cos(yaw)
- In the Y-Z plane, I determined that y = cos(pitch) and z = sin(pitch)
- In the X-Z plane, I found that x = cos(pitch) and z = sin(pitch)
However, this doesn't seem to satisfy basic tests, such as <1,1,1>, where the Yaw = Pi/4 and the Pitch should be Pi/4, but the formula yields 0.5, 0.5, 0.7, which has a direction vector different than <1,1,1>. Can anyone spot where I messed up? I've been banging my head at this for a while, and I can't seem to resolve where I made an error.