Commit 0a8bc7fc authored by Taddeus Kroes's avatar Taddeus Kroes

Folled around a bit with camera functions.

parent 3522e165
...@@ -16,8 +16,8 @@ def main(): ...@@ -16,8 +16,8 @@ def main():
ren = vtk.vtkRenderer() ren = vtk.vtkRenderer()
win = vtk.vtkRenderWindow() win = vtk.vtkRenderWindow()
win.AddRenderer(ren) win.AddRenderer(ren)
iren = vtk.vtkRenderWindowInteractor() #iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(win) #iren.SetRenderWindow(win)
# Read OBJ file # Read OBJ file
cubemapper = read_obj('cube.obj') cubemapper = read_obj('cube.obj')
...@@ -27,9 +27,23 @@ def main(): ...@@ -27,9 +27,23 @@ def main():
cubeactor.SetMapper(cubemapper) cubeactor.SetMapper(cubemapper)
ren.AddActor(cubeactor) ren.AddActor(cubeactor)
iren.Initialize() #iren.Initialize()
win.Render() win.Render()
iren.Start() #iren.Start()
try:
cam = ren.GetActiveCamera()
while True:
win.Render()
# Rotate
cam.Roll(.01)
#cam.Elevation(.01)
#cam.Azimuth(.01)
except KeyboardInterrupt:
return
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment