I have been trying to generate a view matrix from a matrix that contains a rotation and position. When it is generate and I use it for anything then all of the calculations for everything else seem to be off in the y direction. I seem to have narrowed it down to the generation of my view matrix and was hoping if anyone could point out the flaw in this.
/// generate the right, up and look at from the camera matrix
right.x = cameraMatrix->_11;
right.y = cameraMatrix->_12;
right.z = cameraMatrix->_13;
up.x = cameraMatrix->_21;
up.y = cameraMatrix->_22;
up.z = cameraMatrix->_23;
lookAt.x = cameraMatrix->_31;
lookAt.y = cameraMatrix->_32;
lookAt.z = cameraMatrix->_33;
/// normalize the vectors to keep them unit length
NormalizeVector(&lookAt, &lookAt);
Cross(&up, &lookAt, &right);
NormalizeVector(&up, &up);
Cross(&right, &up, &lookAt);
NormalizeVector(&right, &right);
/// build the view matrix
viewMatrix._11 = right.x;
viewMatrix._21 = right.y;
viewMatrix._31 = right.z;
viewMatrix._12 = up.x;
viewMatrix._22 = up.y;
viewMatrix._32 = up.z;
viewMatrix._13 = lookAt.x;
viewMatrix._23 = lookAt.y;
viewMatrix._33 = lookAt.z;
viewMatrix._41 = -Dot(&cameraPosition, &right);
viewMatrix._42 = -Dot(&cameraPosition, &up);
viewMatrix._43 = -Dot(&cameraPosition, &lookAt);
viewMatrix._44 = 1.0f;
/// make sure these are empty
viewMatrix._14 = 0.0f;
viewMatrix._24 = 0.0f;
viewMatrix._34 = 0.0f;