I'm trying to get the matrix from the active camera view in a scene, I can get the matrix from a camera in the scene fairly easily and from the viewport in perspective mode.
I'm running into trouble when getting the matrix from the viewport camera when it is one of the other modes: top, right, front, etc.
I tried using the code from the BaseView/BaseDraw Manual to get the matrix.
BaseDraw* const baseDraw = doc->GetActiveBaseDraw(); if (baseDraw == nullptr) return maxon::IllegalArgumentError(MAXON_SOURCE_LOCATION); BaseObject* const cameraObject = baseDraw->GetEditorCamera(); // move active object into the camera view const Matrix cameraMatrix = cameraObject->GetMg();
It works properly when the camera is in "Perspective" mode, in every other mode the angle from the matrix is not the right result. Is there another way that I should be doing this?
Any help would be greatly appreciated.