OK... I got it to work now... thanks for the direction jyk :)
These were my thoughts on the quaternion math thing
These are the steps i go through to make my view matrix :)
1. Get the current View's rotation as a Quaternion
2. Make a Quaternion with the amount of rotational change this frame
3. Multiply the two together to get the new view rotation quat(with the current view quat from 1 as PQ1, if they are the other way around it will gimbal lock)
4. Normalize the new view quat to prevent generations of small math errors
5. Turn the new view quat into a matrix
6. make a new Identity Matrix to hold the translational info
7. move the camera position x,y,z to the matrix's fourth row
8. Multiply the Translation Matrix, and the Rotation Matrix, Order doesn't matter
9. Set the View Transform to the new combined translate/Rotate matrix
10. Sit back and smile
Here is the final code
D3DXQuaternionRotationMatrix(&matViewQuatIn,&matView); //Step 1D3DXQuaternionRotationYawPitchRoll(&matViewQuat,CamYaw,CamPitch,CamRoll);//Step 2D3DXQuaternionMultiply(&matViewQuatOut,&matViewQuatIn,&matViewQuat); //Step 3D3DXQuaternionNormalize(&matViewQuatOut, &matViewQuatOut); //Step 4D3DXMatrixRotationQuaternion(&matViewOut,&matViewQuatOut); //Step 5D3DXMatrixIdentity(&matView); //Step 6matView._41 = CameraPosition.x; //Step 7matView._42 = CameraPosition.y;matView._43 = CameraPosition.z;matView = matView * matViewOut; //Step 8d3ddev->SetTransform(D3DTS_VIEW, &(matView)); //Step 9
11 Lines of code for a 6 degree freedom camera... I'm proud of myself :)
Quando Omni Flunkus MoritatiWhen All Else Fails, Play Dead!