Suppose I have a mesh (e.g. a sphere), which I want to render while performing a series of (non-rigid) deformations (as an animation). I would like to do this as a series of snapshots of an OffscreenRenderer.
However, as soon as I render the first image, I cannot modify the mesh's positions without destroying the renderer and creating a new one. Is there a way to do this with the same renderer?
Here's what I have been doing:
# Create my scene, Create my mesh, and add to scene
renderer = OffscreenRenderer(viewport_width=640*2, viewport_height=480*2)
image_1, _ = renderer.render(self.scene)
# deform in some way the positions to animate
node.mesh.primitives[-1].positions = np.sin(node.primitives[-1].positions)
#node.primitives[-1].normals = # re-calculate normals
del renderer;
renderer = OffscreenRenderer(viewport_width=640*2, viewport_height=480*2)
image_2, _ = self.renderer.render(self.scene)
Without re-instancing the renderer, image 2 is no different from image 1. What should I do to properly update the positions?
Hi,
Suppose I have a mesh (e.g. a sphere), which I want to render while performing a series of (non-rigid) deformations (as an animation). I would like to do this as a series of snapshots of an OffscreenRenderer. However, as soon as I render the first image, I cannot modify the mesh's positions without destroying the renderer and creating a new one. Is there a way to do this with the same renderer?
Here's what I have been doing:
Without re-instancing the renderer, image 2 is no different from image 1. What should I do to properly update the positions?