When displaying the avatar, I place the appropriate texture map on to a
polygon that is always rotated to face the local user. This angle of
rotation, Towards (T), is calculated using the positions
of the avatar and local user in the space. Note that
here 0degrees is on the +X axis, and
positive rotation is counterclockwise.
I also use T to calculate the Viewing angle (V), which is how far I would need to rotate the user's position to place him at the 270degrees position, looking down the Z axis.



The direction that the avatar is actually facing, the Actual
angle (A), is obtained either from
the network for remote avatars or supplied by the programmer for local
avatars. Note that
here 0degrees is on the Z axis, and
positive rotation is
counterclockwise. (This is how the CAVE library returns the tracking
information, so I conformed to that strategy.)

We can now use these values to determine the rotation of the avatar
within the images, the Image angle (I). That is to say,
what direction the person is looking in the movie that we recorded.
Note that the direction that the person was turning within the movie is
in yet another orientation of the coordinate system, so for now
we will calculate it in terms of the Actual angle, and convert it
later.
If we look at the movie of the avatar, we see that here 0degrees is on the X axis, and positive rotation is clockwise. A simple subtraction can be used to convert an angle expressed in terms of the Actual angle to one in expressed in relation to the Image angle.

