Original Post
Im using my mouse to rotate my 3D camera's on the Pitch and Yaw axii, but for some reason when im turning in both (if I drag the mouse diagonaly) the camera seems to be doing a roll on the LookAt axis. The only thing the the mouse is affecting is the Pitch and Yaw angles. This is my source for the camera update function. Thnx for any help.
void Camera::BuildViewMatrix(D3DXMATRIX * matrix, LPDIRECT3DDEVICE9 device)
{
if(is_changed)
{
D3DXMATRIX mx_TotalRotation;
D3DXMATRIX mx_AroundRight;
D3DXMATRIX mx_AroundUp;
D3DXMATRIX mx_AroundLook;
// now we use the angles that we have rotated by and
// put them into matrices
// rotate around look at
D3DXMatrixRotationAxis(&mx_AroundLook, &v_LookAt, rad_angle_aroundLook);
// rotate around right
D3DXMatrixRotationAxis(&mx_AroundUp, &v_Up, rad_angle_aroundUp);
// round right
D3DXMatrixRotationAxis(&mx_AroundRight, &v_Right,rad_angle_aroundRight);
// combine matrices into 1
D3DXMatrixMultiply(&mx_TotalRotation, &mx_AroundUp, &mx_AroundRight);
D3DXMatrixMultiply(&mx_TotalRotation, &mx_TotalRotation,&mx_AroundLook);
D3DXVec3TransformCoord(&v_Right, &v_Right, &mx_TotalRotation );
D3DXVec3TransformCoord(&v_Up, &v_Up, &mx_TotalRotation );
D3DXVec3Cross(&v_LookAt, &v_Up, &v_Right);
D3DXVec3Normalize(&v_Up, &v_Up);
D3DXVec3Normalize(&v_Right, &v_Right);
D3DXVec3Normalize(&v_LookAt, &v_LookAt);
DrawAxii(device);
// compute the position of the matrix ( bottom row)
D3DXMatrixIdentity(matrix);
float viewX, viewY, viewZ;
viewX = -D3DXVec3Dot(&v_Right, &v_Eye);
viewY = -D3DXVec3Dot(&v_Up, &v_Eye);
viewZ = -D3DXVec3Dot(&v_LookAt, &v_Eye);
(*matrix) = D3DXMATRIX( v_Right.x, v_Up.x, v_LookAt.x, 0,
v_Right.y, v_Up.y, v_LookAt.y, 0,
v_Right.z, v_Up.z, v_LookAt.z, 0,
viewX , viewY , viewZ , 1
);
rad_angle_aroundUp = 0.0f;
rad_angle_aroundLook = 0.0f;
rad_angle_aroundRight = 0.0f;
is_changed = false;
} //end if
}