[vtk-developers] vtkInteractorStyleFlight doesn't work?
Prabhu Ramachandran
prabhu at aero.iitm.ernet.in
Sat Jul 6 05:27:47 EDT 2002
hi,
I was just playing with the various interactor styles and found that
the InteractorStyleFlight was not working as I expected. I found that
the other styles worked fine (Joystick, trackball, unicam and
terrain). Maybe I'm doing something wrong?
Here is a small Python code snippet that shows how I tested.
prabhu
# --- cut here ---
import Tkinter, vtk
from vtk.tk.vtkTkRenderWindowInteractor import vtkTkRenderWindowInteractor
def vtkRenderWindowInteractorConeExample():
"""Like it says, just a simple example
"""
# create root window
root = Tkinter.Tk()
# create vtkTkRenderWidget
pane = vtkTkRenderWindowInteractor(root, width=300, height=300)
pane.Initialize()
def quit(obj=root):
obj.quit()
pane.SetExitMethod(quit)
ren = vtk.vtkRenderer()
pane.GetRenderWindow().AddRenderer(ren)
s = vtk.vtkInteractorStyleFlight()
pane.SetInteractorStyle(s)
pane.Initialize()
print s
cone = vtk.vtkConeSource()
cone.SetResolution(8)
coneMapper = vtk.vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
coneActor = vtk.vtkActor()
coneActor.SetMapper(coneMapper)
ren.AddActor(coneActor)
# pack the pane into the tk root
pane.pack(fill='both', expand=1)
pane.Start()
# start the tk mainloop
root.mainloop()
if __name__ == "__main__":
vtkRenderWindowInteractorConeExample()
# --- cut here ---
More information about the vtk-developers
mailing list