ViewMatrix.SetEuler doesn't work

Hello, I want to change the orientation of the camera via .Net, but this code does only change the Orthographic value:

        ICamera cam = _app.ActiveWindow.Camera;
        cam.IsOrthographic = true;
        Vector3 orientation = new Vector3(-45, 45, 90);
        cam.ViewMatrix.SetEuler(orientation);

        IoC.Get<IRenderService>().RequestRender();

Since the matrix is not a reference type, you should set it back to the camera:

        ICamera cam = _app.ActiveWindow.Camera;
        cam.IsOrthographic = true;
        Vector3 orientation = new Vector3(-45, 45, 90);

        // Get the matrix
        var mat = cam.ViewMatrix;
        mat.SetEuler(orientation);

        // Set it back
        cam.ViewMatrix = mat;

        IoC.Get<IRenderService>().RequestRender();
1 Like

Thank you very much for the fast response! This solved the issue.