Original Post
ok, i have a view matrix and it translates and rotates etc, whats wrong is that the way i am doing it, i am translating and then roatting so it rotates around the origin, i know that i have to rotate and then translate but i dont know how to do this, here is what i have as of right now...
// positions, rotates, and applies the view matrix
D3DMATRIX view_matrix, RY, RX, RZ;
ZeroMemory(&view_matrix, sizeof(view_matrix));
// create identity matrix
view_matrix._11=view_matrix._22=view_matrix._33=view_matrix._44=1.0f;
// create transform matrix
view_matrix._41 = -camera_location.x;
view_matrix._42 = -camera_location.y;
view_matrix._43 = -camera_location.z;
// create rotation matrices
D3DUtil_SetRotateXMatrix(RX, -camera_rotation.x);
D3DUtil_SetRotateYMatrix(RY, -camera_rotation.y);
D3DUtil_SetRotateZMatrix(RZ, -camera_rotation.z);
// apply rotate matrices
D3DMath_MatrixMultiply(view_matrix, view_matrix, RY);
D3DMath_MatrixMultiply(view_matrix, view_matrix, RX);
D3DMath_MatrixMultiply(view_matrix, view_matrix, RZ);
lpDevice->SetTransform(D3DTRANSFORMSTATE_VIEW,&view_matrix);
-----------------------------
doctor_b@doctor.com