Rendering An Actor Created Within A Vtkcommand (callback)
I am attempting to write a program that displays and cycles through images of different file formats when the arrow keys are pressed. I have found that setting up my reader->map
Solution 1:
Well, you definitely can add or remove actors inside a callback. To render the scene again immediately, simply call iren.Render()
.
When you start a renderer without any visible actors and without an explicitly defined camera, then ResetCamera
is typically required. Automatic ResetCamera
is only called once during the initialization, and this is the reason, why calling foo()
before iren.Start()
makes the object visible.
def foo():
LoadNifti()
ren.AddActor(actor)
ren.ResetCamera() # should that be necessary
iren.Render()
Post a Comment for "Rendering An Actor Created Within A Vtkcommand (callback)"