World matrix of camera
-
On 16/05/2013 at 06:45, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14+
Platform: Windows ;
Language(s) :---------
How can I get the world matrix of the scene camera in a parallel view such as Left?BaseObject->GetMg() on the scenecamera returns the rotation portion as an identify matrix.
Markus
-
On 16/05/2013 at 06:52, xxxxxxxx wrote:
The matrix does not only contain the rotation and with it the scale, but also the position. You can
access it via the off attribute.Best,
-Niklas -
On 17/05/2013 at 03:18, xxxxxxxx wrote:
Sorry. I don't understand.
I have a "Left" Camera.
I do:BaseDraw* editor = doc->GetActiveBaseDraw();
if (!editor)
return false;
cam = editor->GetSceneCamera(doc);
if (!cam)
return false;
Matrix camRotMat = cam->GetMg();I get:
[1 0 0
0 1 0
0 0 1
0 0 0]Which is obviously wrong.
-
On 17/05/2013 at 03:33, xxxxxxxx wrote:
the matrix is correct. orthogonal cameras are not aligned like perspective cameras. every
orthogonal has that matrix unless you do specifically rotate them.edit : the offset can vary of course ...
-
On 17/05/2013 at 04:35, xxxxxxxx wrote:
Sorry I totally disagree that the matrix is correct.
How can I offset the camera to the right if I don't know which axis that is?
i.e.
CameraObject->SetOffset(CameraObject->GetOffset() + Vector(100,0,0))only moves the camera left in the "Front", "Top" and "Botton: cameras (because the x-axis is to the right)
Or is there another way of doing this?
-
On 21/05/2013 at 10:40, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Or is there another way of doing this?
Yep. To get the correct camera matrix use the BaseView instead. There the GetMg() function also gets the global object matrix of the current camera object. But this time it is correct.