I think I'm close, but it still isn't quite working. The bulk of the code is in my Camera update method:
Code: Select all
rot_matrix.setRotationDegrees(target->getRotation());
rot_matrix.transformVect(offset);
view_matrix = rot_matrix.buildCameraLookAtMatrixRH(
offset + target->getPosition(),
target->getPosition(),
vector3df(0, 1, 0));
proj_matrix = rot_matrix.buildProjectionMatrixPerspectiveFovRH(
node->getFOV(),
node->getAspectRatio(),
node->getNearValue(), node->getFarValue());
node->setProjectionMatrix(proj_matrix);
node->setPosition(offset + target->getPosition());
node->setTarget(target->getPosition());
Any suggestions would be much appreciated. I'm only just beginning to the get the idea of the view and projection matrices.