I'm a little rotating teapot
Let's enhance the viewing experience by rotating the model as the user rotates his head. The effect will be different than a "normal" virtual reality experience. Ordinarily, moving one's head in VR rotates the subjective view of the camera in the scene to look around in unison with your head movement. In this project, the head movement will be like an input control rotating the model. The model is at a fixed position in front of you at all times.
To implement this feature is quite simple. The RenderBox preDraw
interface method is called at the start of each frame. We'll get the current head angles and rotate the model accordingly, converting the head post-Euler angles into a Quaternion. (Combining multiple Euler angles can result in an unexpected final rotational orientation). We will also conjugate (that is, invert or reverse) the rotation, so that when you look up, you see the bottom of the object and so on. It feels more natural...