FreeMat
|
Section: Visualization Toolkit Rendering Classes
vtkLight is a virtual light for 3D rendering. It provides methods to locate and point the light, turn it on and off, and set its brightness and color. In addition to the basic infinite distance point light source attributes, you also can specify the light attenuation values and cone angle. These attributes are only used if the light is a positional light. The default is a directional light (e.g. infinite point light source).
Lights have a type that describes how the light should move with respect to the camera. A Headlight is always located at the current camera position and shines on the camera's focal point. A CameraLight also moves with the camera, but may not be coincident to it. CameraLights are defined in a normalized coordinate space where the camera is located at (0, 0, 1), the camera is looking at (0, 0, 0), and up is (0, 1, 0). Finally, a SceneLight is part of the scene itself and does not move with the camera. (Renderers are responsible for moving the light based on its type.)
Lights have a transformation matrix that describes the space in which they are positioned. A light's world space position and focal point are defined by their local position and focal point, transformed by their transformation matrix (if it exists).
To create an instance of class vtkLight, simply invoke its constructor as follows
obj = vtkLight
The class vtkLight has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, obj
is an instance of the vtkLight class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkLight = obj.NewInstance ()
vtkLight = obj.SafeDownCast (vtkObject o)
vtkLight = obj.ShallowClone ()
- Create a new light object with the same light parameters than the current object (any ivar from the superclasses (vtkObject and vtkObjectBase), like reference counting, timestamp and observers are not copied). This is a shallow clone (TransformMatrix is referenced) obj.Render (vtkRenderer , int )
- Abstract interface to renderer. Each concrete subclass of vtkLight will load its data into the graphics system in response to this method invocation. The actual loading is performed by a vtkLightDevice subclass, which will get created automatically. obj.SetAmbientColor (double , double , double )
- Set/Get the color of the light. It is possible to set the ambient, diffuse and specular colors separately. The SetColor() method sets the diffuse and specular colors to the same color (this is a feature to preserve backward compatbility.) obj.SetAmbientColor (double a[3])
- Set/Get the color of the light. It is possible to set the ambient, diffuse and specular colors separately. The SetColor() method sets the diffuse and specular colors to the same color (this is a feature to preserve backward compatbility.) double = obj. GetAmbientColor ()
- Set/Get the color of the light. It is possible to set the ambient, diffuse and specular colors separately. The SetColor() method sets the diffuse and specular colors to the same color (this is a feature to preserve backward compatbility.) obj.SetDiffuseColor (double , double , double )
- Set/Get the color of the light. It is possible to set the ambient, diffuse and specular colors separately. The SetColor() method sets the diffuse and specular colors to the same color (this is a feature to preserve backward compatbility.) obj.SetDiffuseColor (double a[3])
- Set/Get the color of the light. It is possible to set the ambient, diffuse and specular colors separately. The SetColor() method sets the diffuse and specular colors to the same color (this is a feature to preserve backward compatbility.) double = obj. GetDiffuseColor ()
- Set/Get the color of the light. It is possible to set the ambient, diffuse and specular colors separately. The SetColor() method sets the diffuse and specular colors to the same color (this is a feature to preserve backward compatbility.) obj.SetSpecularColor (double , double , double )
- Set/Get the color of the light. It is possible to set the ambient, diffuse and specular colors separately. The SetColor() method sets the diffuse and specular colors to the same color (this is a feature to preserve backward compatbility.) obj.SetSpecularColor (double a[3])
- Set/Get the color of the light. It is possible to set the ambient, diffuse and specular colors separately. The SetColor() method sets the diffuse and specular colors to the same color (this is a feature to preserve backward compatbility.) double = obj. GetSpecularColor ()
- Set/Get the color of the light. It is possible to set the ambient, diffuse and specular colors separately. The SetColor() method sets the diffuse and specular colors to the same color (this is a feature to preserve backward compatbility.) obj.SetColor (double , double , double )
- Set/Get the color of the light. It is possible to set the ambient, diffuse and specular colors separately. The SetColor() method sets the diffuse and specular colors to the same color (this is a feature to preserve backward compatbility.) obj.SetColor (double a[3])
- Set/Get the color of the light. It is possible to set the ambient, diffuse and specular colors separately. The SetColor() method sets the diffuse and specular colors to the same color (this is a feature to preserve backward compatbility.) obj.GetColor (double rgb[3])
- Set/Get the color of the light. It is possible to set the ambient, diffuse and specular colors separately. The SetColor() method sets the diffuse and specular colors to the same color (this is a feature to preserve backward compatbility.) double = obj.GetColor ()
- Set/Get the color of the light. It is possible to set the ambient, diffuse and specular colors separately. The SetColor() method sets the diffuse and specular colors to the same color (this is a feature to preserve backward compatbility.) obj.SetPosition (double , double , double )
- Set/Get the position of the light. Note: The position of the light is defined in the coordinate space indicated by its transformation matrix (if it exists). Thus, to get the light's world space position, use vtkGetTransformedPosition() instead of vtkGetPosition(). obj.SetPosition (double a[3])
- Set/Get the position of the light. Note: The position of the light is defined in the coordinate space indicated by its transformation matrix (if it exists). Thus, to get the light's world space position, use vtkGetTransformedPosition() instead of vtkGetPosition(). double = obj. GetPosition ()
- Set/Get the position of the light. Note: The position of the light is defined in the coordinate space indicated by its transformation matrix (if it exists). Thus, to get the light's world space position, use vtkGetTransformedPosition() instead of vtkGetPosition(). obj.SetPosition (float a)
- Set/Get the position of the light. Note: The position of the light is defined in the coordinate space indicated by its transformation matrix (if it exists). Thus, to get the light's world space position, use vtkGetTransformedPosition() instead of vtkGetPosition(). obj.SetFocalPoint (double , double , double )
- Set/Get the point at which the light is shining. Note: The focal point of the light is defined in the coordinate space indicated by its transformation matrix (if it exists). Thus, to get the light's world space focal point, use vtkGetTransformedFocalPoint() instead of vtkGetFocalPoint(). obj.SetFocalPoint (double a[3])
- Set/Get the point at which the light is shining. Note: The focal point of the light is defined in the coordinate space indicated by its transformation matrix (if it exists). Thus, to get the light's world space focal point, use vtkGetTransformedFocalPoint() instead of vtkGetFocalPoint(). double = obj. GetFocalPoint ()
- Set/Get the point at which the light is shining. Note: The focal point of the light is defined in the coordinate space indicated by its transformation matrix (if it exists). Thus, to get the light's world space focal point, use vtkGetTransformedFocalPoint() instead of vtkGetFocalPoint(). obj.SetFocalPoint (float a)
- Set/Get the point at which the light is shining. Note: The focal point of the light is defined in the coordinate space indicated by its transformation matrix (if it exists). Thus, to get the light's world space focal point, use vtkGetTransformedFocalPoint() instead of vtkGetFocalPoint(). obj.SetIntensity (double )
- Set/Get the brightness of the light (from one to zero). double = obj.GetIntensity ()
- Set/Get the brightness of the light (from one to zero). obj.SetSwitch (int )
- Turn the light on or off. int = obj.GetSwitch ()
- Turn the light on or off. obj.SwitchOn ()
- Turn the light on or off. obj.SwitchOff ()
- Turn the light on or off. obj.SetPositional (int )
- Turn positional lighting on or off. int = obj.GetPositional ()
- Turn positional lighting on or off. obj.PositionalOn ()
- Turn positional lighting on or off. obj.PositionalOff ()
- Turn positional lighting on or off. obj.SetExponent (double )
- Set/Get the exponent of the cosine used in positional lighting. double = obj.GetExponentMinValue ()
- Set/Get the exponent of the cosine used in positional lighting. double = obj.GetExponentMaxValue ()
- Set/Get the exponent of the cosine used in positional lighting. double = obj.GetExponent ()
- Set/Get the exponent of the cosine used in positional lighting. obj.SetConeAngle (double )
- Set/Get the lighting cone angle of a positional light in degrees. This is the angle between the axis of the cone and a ray along the edge of the cone. A value of 180 indicates that you want no spot lighting effects just a positional light. double = obj.GetConeAngle ()
- Set/Get the lighting cone angle of a positional light in degrees. This is the angle between the axis of the cone and a ray along the edge of the cone. A value of 180 indicates that you want no spot lighting effects just a positional light. obj.SetAttenuationValues (double , double , double )
- Set/Get the quadratic attenuation constants. They are specified as constant, linear, and quadratic, in that order. obj.SetAttenuationValues (double a[3])
- Set/Get the quadratic attenuation constants. They are specified as constant, linear, and quadratic, in that order. double = obj. GetAttenuationValues ()
- Set/Get the quadratic attenuation constants. They are specified as constant, linear, and quadratic, in that order. obj.SetTransformMatrix (vtkMatrix4x4 )
- Set/Get the light's transformation matrix. If a matrix is set for a light, the light's parameters (position and focal point) are transformed by the matrix before being rendered. vtkMatrix4x4 = obj.GetTransformMatrix ()
- Set/Get the light's transformation matrix. If a matrix is set for a light, the light's parameters (position and focal point) are transformed by the matrix before being rendered. obj.GetTransformedPosition (double a[3])
- Get the position of the light, modified by the transformation matrix (if it exists). double = obj.GetTransformedPosition ()
- Get the position of the light, modified by the transformation matrix (if it exists). obj.GetTransformedFocalPoint (double a[3])
- Get the focal point of the light, modified by the transformation matrix (if it exists). double = obj.GetTransformedFocalPoint ()
- Get the focal point of the light, modified by the transformation matrix (if it exists). obj.SetDirectionAngle (double elevation, double azimuth)
- Set the position and focal point of a light based on elevation and azimuth. The light is moved so it is shining from the given angle. Angles are given in degrees. If the light is a positional light, it is made directional instead. obj.SetDirectionAngle (double ang[2])
- Set the position and focal point of a light based on elevation and azimuth. The light is moved so it is shining from the given angle. Angles are given in degrees. If the light is a positional light, it is made directional instead. obj.DeepCopy (vtkLight light)
- Perform deep copy of this light. obj.SetLightType (int )
- Set/Get the type of the light. A SceneLight is a light located in the world coordinate space. A light is initially created as a scene light.
A Headlight is always located at the camera and is pointed at the camera's focal point. The renderer is free to modify the position and focal point of the camera at any time.
A CameraLight is also attached to the camera, but is not necessarily located at the camera's position. CameraLights are defined in a coordinate space where the camera is located at (0, 0, 1), looking towards (0, 0, 0) at a distance of 1, with up being (0, 1, 0).
Note: Use SetLightTypeToSceneLight, rather than SetLightType(3), since the former clears the light's transform matrix.
int = obj.GetLightType ()
- Set/Get the type of the light. A SceneLight is a light located in the world coordinate space. A light is initially created as a scene light.
A Headlight is always located at the camera and is pointed at the camera's focal point. The renderer is free to modify the position and focal point of the camera at any time.
A CameraLight is also attached to the camera, but is not necessarily located at the camera's position. CameraLights are defined in a coordinate space where the camera is located at (0, 0, 1), looking towards (0, 0, 0) at a distance of 1, with up being (0, 1, 0).
Note: Use SetLightTypeToSceneLight, rather than SetLightType(3), since the former clears the light's transform matrix.
obj.SetLightTypeToHeadlight ()
- Set/Get the type of the light. A SceneLight is a light located in the world coordinate space. A light is initially created as a scene light.
A Headlight is always located at the camera and is pointed at the camera's focal point. The renderer is free to modify the position and focal point of the camera at any time.
A CameraLight is also attached to the camera, but is not necessarily located at the camera's position. CameraLights are defined in a coordinate space where the camera is located at (0, 0, 1), looking towards (0, 0, 0) at a distance of 1, with up being (0, 1, 0).
Note: Use SetLightTypeToSceneLight, rather than SetLightType(3), since the former clears the light's transform matrix.
obj.SetLightTypeToSceneLight ()
- Set/Get the type of the light. A SceneLight is a light located in the world coordinate space. A light is initially created as a scene light.
A Headlight is always located at the camera and is pointed at the camera's focal point. The renderer is free to modify the position and focal point of the camera at any time.
A CameraLight is also attached to the camera, but is not necessarily located at the camera's position. CameraLights are defined in a coordinate space where the camera is located at (0, 0, 1), looking towards (0, 0, 0) at a distance of 1, with up being (0, 1, 0).
Note: Use SetLightTypeToSceneLight, rather than SetLightType(3), since the former clears the light's transform matrix.
obj.SetLightTypeToCameraLight ()
- Query the type of the light. int = obj.LightTypeIsHeadlight ()
- Query the type of the light. int = obj.LightTypeIsSceneLight ()
- Query the type of the light. int = obj.LightTypeIsCameraLight ()
- Query the type of the light.