Skip to content
Snippets Groups Projects
Commit b0debcf1 authored by Olivier Bertrand's avatar Olivier Bertrand
Browse files

Correct typo in renderer

The matrix_world of the camera in Blender is column-major ordered and not row-ordered as in python
Thus the tranpose is given as matrix_world
parent ca44fec2
No related branches found
No related tags found
No related merge requests found
...@@ -16,4 +16,6 @@ BlenderRender: ...@@ -16,4 +16,6 @@ BlenderRender:
# Number of rays (samples) used for redering # Number of rays (samples) used for redering
# Higher number give better results, but # Higher number give better results, but
# require more computation time. # require more computation time.
samples: 30 samples: 30
\ No newline at end of file # maximum possible distance
worldlimit: 100
\ No newline at end of file
...@@ -549,13 +549,15 @@ class BlenderRender(AbstractRender): ...@@ -549,13 +549,15 @@ class BlenderRender(AbstractRender):
'posorient must be of type array, list, or pandas Series') 'posorient must be of type array, list, or pandas Series')
# Render # Render
rotmat = compose_matrix( rotmat = compose_matrix(
angles=[0, 0, 0], # posorient.loc[convention], angles=posorient.loc[convention],
translate=posorient.loc['location'], translate=posorient.loc['location'],
axes=convention) axes=convention)
if self._renderaxis == '+x': if self._renderaxis == '+x':
initrot = quatmatrix([0.5, 0.5, -0.5, -0.5]) initrot = quatmatrix([0.5, 0.5, -0.5, -0.5])
rotmat[:3, :3] = rotmat[:3, :3].dot(initrot[:3, :3]) 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() bpy.ops.render.render()
def scene(self, posorient): def scene(self, posorient):
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.6.5" "version": "3.6.3"
} }
}, },
"nbformat": 4, "nbformat": 4,
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment