Thanks Diggsey, I'm trying that but I'm still doing something wrong, here is my code:
pData->bOverride = true;
// Initialize
D3DXVECTOR3 position = D3DXVECTOR3(0, 40, 0);
D3DXVECTOR3 look = D3DXVECTOR3(0, 0, 1);
D3DXVECTOR3 right = D3DXVECTOR3(1, 0, 0);
D3DXVECTOR3 up = D3DXVECTOR3(0, 1, 0);
// Change y-rotation
float yaw = 3.142;
D3DXMATRIX yawMatrix;
D3DXMatrixRotationAxis(&yawMatrix, &up, yaw);
D3DXVec3TransformCoord(&look, &look, &yawMatrix);
D3DXVec3TransformCoord(&right, &right, &yawMatrix);
////////////
float pitch = 0;
D3DXMATRIX pitchMatrix;
D3DXMatrixRotationAxis(&pitchMatrix, &right, pitch);
D3DXVec3TransformCoord(&look, &look, &pitchMatrix);
D3DXVec3TransformCoord(&up, &up, &pitchMatrix);
//////////////
float roll = 0;
D3DXMATRIX rollMatrix;
D3DXMatrixRotationAxis(&rollMatrix, &look, roll);
D3DXVec3TransformCoord(&right, &right, &rollMatrix);
D3DXVec3TransformCoord(&up, &up, &rollMatrix);
// Create custom matrix
D3DXMATRIX viewMatrix;
D3DXMatrixIdentity(&viewMatrix);
viewMatrix._11 = right.x; viewMatrix._12 = up.x; viewMatrix._13 = look.x;
viewMatrix._21 = right.y; viewMatrix._22 = up.y; viewMatrix._23 = look.y;
viewMatrix._31 = right.z; viewMatrix._32 = up.z; viewMatrix._33 = look.z;
viewMatrix._41 = - D3DXVec3Dot( &position, &right );
viewMatrix._42 = - D3DXVec3Dot( &position, &up );
viewMatrix._43 = - D3DXVec3Dot( &position, &look );
// override matrix
pData->matOverride = viewMatrix;
I run this at the start of every loop.
I pulled this off the internet so I only half understand it but the important thing is that it is not affecting my camera in any way, I know I have the pointer to the right camera as I have been able to change its position directly:
pData->vecPosition = D3DXVECTOR3(0, 50, 0);
But this is the only way I have been able to affect the camera so far.
EDIT updated code but still does not work.