/[escript]/trunk/pyvisi/py_src/camera.py
ViewVC logotype

Diff of /trunk/pyvisi/py_src/camera.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 881 by jongui, Wed Oct 25 03:56:34 2006 UTC revision 882 by jongui, Fri Oct 27 08:15:33 2006 UTC
# Line 94  class Camera: Line 94  class Camera:
94              position.getZCoor())              position.getZCoor())
95          self.resetCamera()          self.resetCamera()
96    
     def zoom(self, factor):  
         """  
         Zoom in and out of the rendered object.  
         @type factor: Number  
         @param factor: Amount to zoom in and out  
         """  
   
         self.vtk_camera.Zoom(factor)  
         self.resetCamera()  
   
97      def azimuth(self, angle):      def azimuth(self, angle):
98          """          """
99          Rotate the camera to the left and right.          Rotate the camera to the left and right.
# Line 122  class Camera: Line 112  class Camera:
112          """          """
113    
114          self.vtk_camera.Elevation(angle)          self.vtk_camera.Elevation(angle)
115            # Recompute the view up vector. If not used the elevation angle cannot
116            # cannot exceed 87/-87 degrees. Otherwise a warning resetting the
117            # view up will be thrown and the rendered object may be incorrect.
118            # With the view up recomputed, the elevation angle can reach between
119            # 90/-90 degress. More than that, the rendered object may be incorrect.
120            self.vtk_camera.OrthogonalizeViewUp()
121          self.resetCamera()          self.resetCamera()
122    
   
123      def roll(self, angle):      def roll(self, angle):
124          """          """
125          Roll the camera to the left and right.          Roll the camera to the left and right.
# Line 132  class Camera: Line 127  class Camera:
127          @param angle: Degree to turn the camera          @param angle: Degree to turn the camera
128          """          """
129    
130          self.vtk_camera.Roll(angle)          self.vtk_camera.Roll(-angle)
         self.resetCamera()  
   
     def dolly(self, distance):  
         """  
         Move the camera towards and away from the focal point along the normal.  
         @type distance: Number  
         @param distance: Amount to move towards and away  
         """  
           
         self.vtk_camera(distance)  
131          self.resetCamera()          self.resetCamera()
132    
133      def backView(self):      def backView(self):
# Line 158  class Camera: Line 143  class Camera:
143          View the top of the rendered object.          View the top of the rendered object.
144          """          """
145    
146          self.elevation(90)          self.elevation(90)
147          self.resetCamera()          self.resetCamera()
148    
149      def bottomView(self):      def bottomView(self):
# Line 166  class Camera: Line 151  class Camera:
151          View the bottom of the rendered object.          View the bottom of the rendered object.
152          """          """
153    
154          self.elevation(-90)          self.elevation(-90)
155          self.resetCamera()          self.resetCamera()
156    
157      def leftView(self):      def leftView(self):
# Line 185  class Camera: Line 170  class Camera:
170          self.azimuth(90)          self.azimuth(90)
171          self.resetCamera()          self.resetCamera()
172    
173        def isometricView(self):
174            """
175            View the isometric side of the rendered object.            
176            """
177        
178            self.roll(-45)
179            self.elevation(-45)
180    
181      def resetCamera(self):      def resetCamera(self):
182          """          """
183          Repositions the camera so that all actors can be seen. Needs to          Repositions the camera so that all actors can be seen. Needs to
# Line 194  class Camera: Line 187  class Camera:
187          self.scene.getRenderer().ResetCamera()            self.scene.getRenderer().ResetCamera()  
188    
189    
     #def isometricView(self):  
     #   self.elevation(-50)  
         #self.roll(30)  
         #self.azimuth(-90)  

Legend:
Removed from v.881  
changed lines
  Added in v.882

  ViewVC Help
Powered by ViewVC 1.1.26