Struggling with some equations here. I've got a particle I need to track in an absolute reference frame, but each step I move/rotate it relative to its own reference frame. I need to track it's absolute position while moving it relatively.
I'm trying to figure out the proper set of rotation matrices. It propagates along the x-axis and I can describe its current direction with [ux, uy, uz], now I need to rotate it about it's own reference frame by the deflection $\theta$ (deflection from incident direction) and azimuthal rotation $\phi$ (rotation about incident direction), and then find its new position, [ux', uy', uz']. Should I multiply by the rotation matrix, ROT[y,$\theta$], then ROT[x,$\phi$] or the opposite order?
I'm just getting myself confused. By way of reference, I'm trying to derive the set of equations on (pdf) page 20 of this document.
It's a) not derived very well and b) derived for propagation along the z-axis, not the x-axis.
TL;DR - I have a vector in space pointing in an arbitrary direction, described by its projections on the world x,y,z-axis. I need to rotate the vector, in relation to its own reference frame, and find the world axis projections. Essentially this is a ray-tracing problem. Incoming ray needs to point in a new direction - what is that direction?