From 45f368f51efaa1468c7f6e2a9c11dd55049389e1 Mon Sep 17 00:00:00 2001
From: "Olivier J.N. Bertrand" <olivier.bertrand@uni-bielefeld.de>
Date: Fri, 13 Jul 2018 22:33:11 +0200
Subject: [PATCH] Initrot matrx should be apply prior to orientation matrix

---
 navipy/sensors/renderer.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/navipy/sensors/renderer.py b/navipy/sensors/renderer.py
index b0e282d..492237f 100644
--- a/navipy/sensors/renderer.py
+++ b/navipy/sensors/renderer.py
@@ -569,7 +569,10 @@ class BlenderRender(AbstractRender):
             axes=convention)
         if self._renderaxis == '+x':
             initrot = quatmatrix([0.5, 0.5, -0.5, -0.5])
-            rotmat[:3, :3] = initrot[:3, :3].dot(rotmat[:3, :3])
+            # The camera is aligned in -z
+            # A rotation along z wll thus roll the camera
+            # Althougth the camera should yaw in such case
+            rotmat[:3, :3] = rotmat[:3,:3].dot(initrot[:3, :3])
         # matrix_world in blender are column-major order
         # and numpy row-major order
         self.camera.matrix_world = np.transpose(rotmat)
-- 
GitLab