Original Post
Hello, I am trying to make a third person camera that receives a D3DXMATRIX and then follows from behind. However, I am having problems as I rotate the object around the Y Axis, the camera seems to flip in itself, as in rotating up to about 180 degrees and then instead of keep rotating, it changes the direction of rotation! Here is my code. // Vectors for the Camera's Position and Camera's Look At Target D3DXVECTOR4 CameraPos, LookAt; // Matrices to apply D3DXMATRIX matView, matCameraPos; // Set the Camera's Position scaling to 1.0f matCameraPos = OrbitCenter; matCameraPos._11 = matCameraPos._22 = matCameraPos._33 = matCameraPos._44 = 1.0f; // Apply camera's zoom and height fixing CameraPos = D3DXVECTOR4(0.0f,OrbitCenterHeight,-OrbitCurrentZoomDistance,1); // Apply Look At's height fixing LookAt = D3DXVECTOR4(0.0f,OrbitCenterHeight,0.0f,1); // Apply matrices to the camera's position and camera's target D3DXVec3Transform(&CameraPos, &(D3DXVECTOR3(CameraPos.x,CameraPos.y,CameraPos.z)), &matCameraPos); D3DXVec3Transform(&LookAt, &(D3DXVECTOR3(0.0f, 0.0f, 0.0f)), &OrbitCenter); // Create view matrix D3DXMatrixLookAtLH(&matView, &(D3DXVECTOR3(CameraPos.x, CameraPos.y, CameraPos.z)), &(D3DXVECTOR3(LookAt.x, LookAt.y, LookAt.z)), &(D3DXVECTOR3(0.0f, 1.0f, 0.0f))); // Set the Camera's matrix to the newly created view matrix for assigning later. m_matWorld = matView;