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

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

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

revision 1077 by jongui, Fri Mar 16 05:00:32 2007 UTC revision 1078 by jongui, Thu Apr 5 06:18:47 2007 UTC
# Line 8  from constant import Viewport Line 8  from constant import Viewport
8    
9  class Light:  class Light:
10      """      """
11      Class that defines a light. A light controls the source of light for the      Class that defines a light. A light controls the lighting for the
12      rendered object and works in a similar way to L{Camera <camera.Camera>}.      rendered object and works in a similar way to L{Camera <camera.Camera>}.
13      """      """
14    
# Line 22  class Light: Line 22  class Light:
22          @param scene: Scene in which components are to be added to            @param scene: Scene in which components are to be added to  
23          @type data_collector: L{DataCollector <datacollector.DataCollector>}          @type data_collector: L{DataCollector <datacollector.DataCollector>}
24              object              object
25          @param data_collector: Source of data for visualization          @param data_collector: Source of data for vizualization
26          @type viewport: L{Viewport <constant.Viewport>} constant          @type viewport: L{Viewport <constant.Viewport>} constant
27          @param viewport: Viewport in which objects are to be rendered on          @param viewport: Viewport in which objects are to be rendered on
28          """          """
# Line 71  class Light: Line 71  class Light:
71    
72          self.__vtk_light.SetPosition(position._getGlobalPosition())          self.__vtk_light.SetPosition(position._getGlobalPosition())
73    
74      # Elevation and azimuth is set to zero so that users do not necessarily      # Elevation and azimuth is set to zero so that users do not
75      # have to change both at the same time.      # have to change both at the same time.
76      def setAngle(self, elevation = 0, azimuth = 0):      def setAngle(self, elevation = 0, azimuth = 0):
77          """          """
78          An alternative to set the position and focal point of the light          An alternative to set the position and focal point of the light
79          based on the specified elevation and azimuth degrees.          by using the elevation and azimuth.
80    
81          @type elevation: Number          @type elevation: Number
82          @param elevation: Degree to rotate the light to the top and bottom          @param elevation: Degree to rotate the light to the top and bottom
# Line 84  class Light: Line 84  class Light:
84          @param azimuth: Degree to rotate the light to the left and right          @param azimuth: Degree to rotate the light to the left and right
85          """          """
86    
87          # NOTE: The elevation angle of light does not seem to suffer the same          # NOTE: The elevation angle of light does not appear to suffer the same
88          # constraint as the elevation angle of camera where the elevation          # constraint as the elevation angle of camera where the elevation
89          # angle is constraint between 90/-90.          # angle is constraint between 90/-90.
90          self.__vtk_light.SetDirectionAngle(elevation, azimuth)          self.__vtk_light.SetDirectionAngle(elevation, azimuth)

Legend:
Removed from v.1077  
changed lines
  Added in v.1078

  ViewVC Help
Powered by ViewVC 1.1.26