3D problem

Hello,

Trying to build a simple 3D engine. The camera should be able to pan along all three axis and rotate around the z-axis(roll). It’s working almost perfectly. I can move it along any/all the xyz axis at the same time, and I can roll the camera, however if I try to do both (roll and move along the x or y axis) at the same time, the end point is slightly off from where it should be. Here is the main bit of code. If anybody can see anything obviously wrong, please let me know what.

  var scale:Number = FL / (FL + myOb.z);
            myOb._rotation = camR * 180/Math.PI;
            myOb._alpha = scale * 70 + 30;
            myOb.swapDepths(-myOb.z);
           
            myOb.rotation  = Math.atan2(myOb.y, myOb.x)+ velR;
            var rad:Number = Math.sqrt(myOb.x * myOb.x + myOb.y * myOb.y);
            myOb.x =  Math.cos(myOb.rotation) * rad;
            myOb.y = Math.sin(myOb.rotation) * rad;
            myOb._x =  myOb.x * scale;
            myOb._y =  myOb.y * scale;

Thanks a lot…