rotating and moving camera for FPS

Hi,does anyone know how to make the camera to follow a moving object and also to rotate according to what the object should see (it is simulation of an Aibo)? we are getting really complicated with the rotation matrix and the tranlation info … the problem is that the Aibo moves by itself an we can get the position and rotation of the head, but we are unable to use this info to set the 1st person view…
We’ve managed to make the camera to follow the Aibo (it seems), but it seems that the coordinates rotated around each other every time we draw the image.
Help please!