Add a new light source
VO <ScenarioPath> LightSource {Add | Delete | Modify | DeleteAll} [{LightOption} <Parameter>]...
The VO LightSource command enables you to add a new light source, define its position, and specify its type as supported by OpenGL. You can also attach the light source to any object and apply it to any coordinate frame.
If DeleteAll is entered, the only valid {LightOption} is WindowID, specifying any other option will cause a Nack.
{LightOption} <Parameter> | Description |
---|---|
Name <LightSourceName> | User-defined name of the light source.
This option must be included if Add, Modify or Delete is selected.
Note: This option is required if Add, Delete or Modify is entered. |
Show {On | Off} | Uses the light source to illuminate the 3D Graphics window. Default if On. |
PosOffSet <Xvalue> <Yvalue> <Zvalue> | Specifies the distance offsets from the origin at which the light source displays. The offset is maintained in the specified reference system. Values are entered in Connect distance units. Default value is 0.0, 0.0, 0.0. |
Color {Color} | Specifies the color of the light. Default color is white. For valid {Color} options see Common Options. |
SpotCutOff <Value> | Specifies the maximum spread angle of a light source. Valid range is 0 through 90 degrees. This option is valid only for spotlights. |
Intensity <Value> | Controls the intensity of the light source. Default value is 100.0. |
NegativeDirection {On | Off} | Reverses the direction of the light source. Valid only for directional and spotlights. Default is Off. |
Type {Directional | Positional | Spotlight} | Indicates the type of light source:
|
SystemDef "<TruncObjectPath> <SystemName> [System]" | Defines the position of the light
source. The default system definition is relative to the specified
CB fixed frame.
The <TruncObjectPath> can either be a truncated object path (Satellite/Satellite1) or a Central Body path (CentralBody/Earth). |
CrdnDef "<TruncObjectPath> <VectorName> [Vector]" | Defines the direction of the light
source. The default vector is from the sun to the earth.
The <TruncObjectPath> can either be a truncated object path (Satellite/Satellite1) or a Central Body path (CentralBody/Earth). |
ConstantAtten <Value> | Set the Constant attenuation value. <Value> must be greater or equal to 0.0. |
LinearAtten <Value> | Set the Linear attenuation value. <Value> must be greater or equal to 0.0. |
QuadraticAtten <Value> | Set the Quadratic attenuation value. <Value> must be greater or equal to 0.0. |
WindowID <WinNumber> | Specifies the 3D Graphics window where the light source is displayed. |
To create a default directional light source:
VO * Lightsource add name light1
To create a directional light source with a color specified:
VO * Lightsource add name light1 color blue
To create a spotlight with a cone angle of 0.25 and direct it towards the moon:
VO * Lightsource add name moonShine crdndef "CentralBody/Earth Moon" type spotlight spotcutoff .25 color green
To modify a spotlight in window 1, change its color to green, change the cone angle to 0.5, and direct it towards the moon:
VO * Lightsource modify name moonBeam windowID 1 crdndef "CentralBody/Earth Moon Vector" type spotlight spotcutoff .5 color green
To modify the LightSrc0 spotlight to point to a facility on the globe:
VO * Lightsource modify name LightSrc0 type spotlight crdndef "Facility/Facility1 Position Vector"
To add a spotlight to window 1 with a spotcutoff of 90.0, a color of yellow, an intensity of 400, its position changed to a Satellite, and pointing to a facility on the globe:
VO * Lightsource add name LightSrc0 windowID 1 type spotlight color yellow systemdef "Satellite/Satellite1 Body" crdndef "Facility/Facility1 Position" Spotcutoff 90.0 Intensity 400
To delete all lightsources from VO window 2:
VO * LightSource DeleteAll WindowID 2
To add a spotlight and set it's attenuation values:
VO * Lightsource Add Name Test1 Type spotlight ConstantAtten 1.0 LinearAtten 0.0 QuadraticAtten 0.0
This command belongs to the following group(s):
9.0
STK Programming Interface 11.0.1