I'm currently having an issue with moving the camera around the z-axis (roll). For debugging purposes, I have an object with which I've tested with all 3-axis rotation and movement and it's working as expected; the object in question as well as the camera class superseed a positions class for determining their position, rotation and scale.
Having finished cycling the frame, checking for potential changes in the values, the following multiplications are in place to update the class:
//Cycles and transforms the display device around the object.
HRESULT ThreeDPositions::cycle(DeviceManager* dManager){
//Compute matrix equations for rotation, scaling and placement.
D3DXMatrixScaling(&mScaling, scale.x, scale.y, scale.z);
D3DXMatrixRotationYawPitchRoll(&mRotation, rotation.y, rotation.x, rotation.z);
D3DXMatrixTranslation(&mTranslate, placement.x, placement.y, placement.z);
//Multiply each matrix for the final display.
mWorld = mRotation * mScaling * mTranslate;
//Transform the world device positioning matrix.
dManager->getDisplayDevice()->getD3dDevice()->SetTransform(D3DTS_WORLD, &mWorld);
return S_OK;
}
Having done that, the camera class then does the following:
//Transform the view matrix for an up to date display.
D3DXVec3TransformCoord(&vNewDir, &vStartDirection, ¤tPosition->getMRotation());
D3DXVec3Normalize(&vNormedNewDir, &vNewDir);
vNormedNewDir += currentPosition->getPlacement();
D3DXMatrixLookAtLH( &mView, ¤tPosition->getPlacement(), &vNewDir, &vUp);
where:
vStartDirection = D3DXVECTOR3(0.0f, 0.0f, 1.0f);
vUp = D3DXVECTOR3(0.0f, 1.0f, 0.0f);
I've checked and all of the placements for the camera, as well as rotations around the x/y axis are working correctly, strangely enough though, the z-axis rotation IS being updated (as shown by the object rotating around it correctly), yet the camera refuses to roll correctly.
Even with removing the D3DTS_WORLD transformation from the camera, no effect is seen.
Any help/pointers would be greatly appreciated.
edit:Also worthy of note is that upon testing via swapping the x/y values for rotation, z-axis rotation does happen; of course not correctly but it does point to an issue in the calculations rather then the system somehow disabling it.