I’m trying to model the position of a planet orbiting a star. The planet is a simple sphere and the orbit itself is calculated with a vector, and per-frame, the sphere is moved to that vector. So far, so good.

Next, I need to model axial tilt and daily rotation, and this is where I run into problems. I can do each one on their own (pitch the sphere for the axial tilt, yaw it for the rotation), but I can’t seem to combine them because all the transformations take place in world space.

Is it possible to perform pitch in world and then yaw locally? Failing that, how would a Quaternion be used here? X,Y,Z to describe the pitch, and then W in place of yaw? What units is W in?

Thanks in advance.