How to use python vtk to get the stereo effect?

435 views Asked by At

I got the vtk working for rendering 3D objects. Now I want to render it in stereo way. But cannot figure out how to do it I tried something like this

ren.ResetCamera()
window = vtk.vtkRenderWindow()
#window.GetStereoCapableWindow()

#window.StereoCapableWindowOn()

window.AddRenderer(ren)
window.SetStereoRender(1)

But it doesn't work. Any body can give some idea?

1

There are 1 answers

0
litaoshen On

This piece of code will guarantee it will work

window = vtk.vtkRenderWindow()
window.GetStereoCapableWindow()

window.StereoCapableWindowOn()

window.AddRenderer(ren)
window.SetStereoRender(1)
window.SetStereoTypeToInterlaced()