diff --git a/navipy/resources/configs/BlenderRender.yaml b/navipy/resources/configs/BlenderRender.yaml index fca41dce31e94f5b256ec0ece8236290f8d2b049..569bbcfb118a499bc9d3e27f6cf14bc266d711b7 100644 --- a/navipy/resources/configs/BlenderRender.yaml +++ b/navipy/resources/configs/BlenderRender.yaml @@ -16,4 +16,6 @@ BlenderRender: # Number of rays (samples) used for redering # Higher number give better results, but # require more computation time. - samples: 30 \ No newline at end of file + samples: 30 + # maximum possible distance + worldlimit: 100 \ No newline at end of file diff --git a/navipy/sensors/renderer.py b/navipy/sensors/renderer.py index 07d6f1c1f83fa61aa5b7e7be0ba3d13a161c516c..8627ea65b91e70f558983d501b45ebe6030790da 100644 --- a/navipy/sensors/renderer.py +++ b/navipy/sensors/renderer.py @@ -549,13 +549,15 @@ class BlenderRender(AbstractRender): 'posorient must be of type array, list, or pandas Series') # Render rotmat = compose_matrix( - angles=[0, 0, 0], # posorient.loc[convention], + angles=posorient.loc[convention], translate=posorient.loc['location'], axes=convention) if self._renderaxis == '+x': initrot = quatmatrix([0.5, 0.5, -0.5, -0.5]) rotmat[:3, :3] = rotmat[:3, :3].dot(initrot[:3, :3]) - self.camera.matrix_world = rotmat + # matrix_world in blender are column-major order + # and numpy row-major order + self.camera.matrix_world = np.transpose(rotmat) bpy.ops.render.render() def scene(self, posorient): diff --git a/tutorials/01-building-arena.ipynb b/tutorials/01-building-arena.ipynb index 08c042445ad4516ff6d8829b7b7b197491684e40..a3a1348c374ffbbb4ff60f9599c2412a2748bbca 100644 --- a/tutorials/01-building-arena.ipynb +++ b/tutorials/01-building-arena.ipynb @@ -103,7 +103,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.5" + "version": "3.6.3" } }, "nbformat": 4,