Click or drag to resize
SoSpotLight Class

Node representing a spotlight source.

Inheritance Hierarchy

Namespace: OIV.Inventor.Nodes
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 10.12.3.0 (10.12.3.0)
Syntax
public class SoSpotLight : SoLight

The SoSpotLight type exposes the following members.

Constructors
  NameDescription
Public methodSoSpotLight

Creates a spotlight source node with default settings.

Top
Methods
  NameDescription
Public methodAffectsState

Returns true if a node has an effect on the state during traversal.

(Inherited from SoNode.)
Public methodCallback
(Inherited from SoLight.)
Public methodCopy
Calls Copy(false).
(Inherited from SoNode.)
Public methodCopy(Boolean)

Creates and returns an exact copy of the node.

(Inherited from SoNode.)
Public methodCopyFieldValues(SoFieldContainer)
Calls CopyFieldValues(fc, false).
(Inherited from SoFieldContainer.)
Public methodCopyFieldValues(SoFieldContainer, Boolean)

Copies the contents of fc's fields into this object's fields.

(Inherited from SoFieldContainer.)
Public methodDispose
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.)
Public methodDistribute
(Inherited from SoNode.)
Public methodDoAction
(Inherited from SoLight.)
Public methodEnableNotify

Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false).

(Inherited from SoFieldContainer.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFieldsAreEqual

Returns true if this object's fields are exactly equal to fc's fields.

(Inherited from SoFieldContainer.)
Public methodGet

Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.

(Inherited from SoFieldContainer.)
Public methodGetAllFields

Returns a list of fields, including the eventIn's and eventOut's.

(Inherited from SoFieldContainer.)
Public methodGetAlternateRep

This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type).

(Inherited from SoNode.)
Public methodGetBoundingBox
(Inherited from SoNode.)
Public methodGetEventIn

Returns a the eventIn with the given name.

(Inherited from SoFieldContainer.)
Public methodGetEventOut

Returns the eventOut with the given name.

(Inherited from SoFieldContainer.)
Public methodGetField

Returns a the field of this object whose name is fieldName.

(Inherited from SoFieldContainer.)
Public methodGetFieldName

Returns the name of the given field in the fieldName argument.

(Inherited from SoFieldContainer.)
Public methodGetFields

Appends references to all of this object's fields to resultList, and returns the number of fields appended.

(Inherited from SoFieldContainer.)
Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetMatrix
(Inherited from SoNode.)
Public methodGetName

Returns the name of an instance.

(Inherited from SoBase.)
Public methodGetPrimitiveCount
(Inherited from SoNode.)
Public methodGetRenderEngineMode

Returns the supported Render engine mode.

(Inherited from SoNode.)
Public methodGetRenderUnitID
(Inherited from SoNode.)
Public methodGetStringName (Inherited from SoBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGLRender
Public methodGLRenderBelowPath
(Inherited from SoNode.)
Public methodGLRenderInPath
(Inherited from SoNode.)
Public methodGLRenderOffPath
(Inherited from SoNode.)
Public methodGrabEventsCleanup
(Inherited from SoNode.)
Public methodGrabEventsSetup
(Inherited from SoNode.)
Public methodHandleEvent
(Inherited from SoNode.)
Public methodHasDefaultValues

Returns true if all of the object's fields have their default values.

(Inherited from SoFieldContainer.)
Public methodIsBoundingBoxIgnoring

This method is used by getBoundingBox action traversal to know if the current node must be traversed or not, ie the bounding should be ignored.

(Inherited from SoNode.)
Public methodIsNotifyEnabled

Notification is the process of telling interested objects that this object has changed.

(Inherited from SoFieldContainer.)
Public methodIsOverride

Returns the state of the override flag.

(Inherited from SoNode.)
Public methodIsSynchronizable

Gets the ScaleViz synchronizable state of this object.

(Inherited from SoBase.)
Public methodPick
(Inherited from SoNode.)
Public methodRayPick
(Inherited from SoNode.)
Public methodSearch
(Inherited from SoNode.)
Public methodSet

Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.

(Inherited from SoFieldContainer.)
Public methodSetName (Inherited from SoBase.)
Public methodSetOverride

Turns the override flag on or off.

(Inherited from SoNode.)
Public methodSetSynchronizable

Sets this to be a ScaleViz synchronizable object.

(Inherited from SoBase.)
Public methodSetToDefaults

Sets all fields in this object to their default values.

(Inherited from SoFieldContainer.)
Public methodToString
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.)
Public methodTouch

Marks an instance as modified, simulating a change to it.

(Inherited from SoNode.)
Public methodWrite
(Inherited from SoNode.)
Top
Properties
  NameDescription
Public propertycolor

Light source illumination color.

(Inherited from SoLight.)
Public propertycutOffAngle

Angle (in radians) outside of which intensity is zero, measured from the center axis of the cone to an edge.

Public propertydirection

Principal direction of illumination (center axis of cone).

Public propertydropOffRate

Rate of intensity drop-off per change in angle from primary direction: 0 = constant intensity, 1 = very sharp drop-off.

Public propertyintensity

Illumination intensity of light source.

(Inherited from SoLight.)
Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Public propertylocation

Location of the source.

Public propertyon

Determines whether the source is active or inactive.

(Inherited from SoLight.)
Public propertyUserData
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.)
Top
Remarks

This node defines a spotlight style light source. A spotlight is placed at a fixed location in 3-space and illuminates in a cone along a particular direction. The intensity of the illumination drops off exponentially as a ray of light diverges from this direction toward the edges of the cone. The rate of drop-off and the angle of the cone are controlled by the OIV.Inventor.Nodes.SoSpotLight.dropOffRate and OIV.Inventor.Nodes.SoSpotLight.cutOffAngle fields.

A light node defines an illumination source that may affect subsequent shapes in the scene graph, depending on the current lighting model. Light sources are affected by the current transformation. A light node under an OIV.Inventor.Nodes.SoSeparator does not affect any objects outside that separator. Lights may be grouped under an OIV.Inventor.Nodes.SoGroup node and still affect the rest of the scene graph. The viewer classes automatically create a directional light, called the headlight, that is automatically updated to shine in the same direction the camera is pointed.

You can also use a node kit to create a light. See the reference page for OIV.Inventor.Nodekits.SoLightKit.

The lighting model can be changed using an OIV.Inventor.Nodes.SoLightModel node. Effectively lighting is enabled by default (default model is PER_VERTEX_PHONG), but can be turned off by setting the lighting model to BASE_COLOR. In this case the object's diffuse color is used without modification. This can be useful for axes and annotations.

An OIV.Inventor.Nodes.SoEnvironment node can be used to specify additional options related to lighting:

  • The ambient light component of the Phong reflection model.

  • Light attenuation for OIV.Inventor.Nodes.SoPointLight and OIV.Inventor.Nodes.SoSpotLight nodes.

  • Ambient occlusion.

When lighting is enabled, the appearance of most geometry depends on the normal vectors specified (or computed) for the geometry. See OIV.Inventor.Nodes.SoShapeHints for a discussion of normal computation and the concept of "crease angle". By default lighting is only computed for the "front" face of most geometry (there are some exceptions like OIV.VolumeViz.Nodes.SoOrthoSlice). Which face is the front depends on the vertex ordering. Also see OIV.Inventor.Nodes.SoShapeHints to control vertex ordering and to enable "two sided" lighting. Lighting of line geometry is affected by the tangent values, if any, specified with OIV.Inventor.Nodes.SoVertexProperty.

The color components specified for lights mean something different than for materials. For a light, the numbers correspond to a percentage of full intensity for each color. If the R, G, and B values for a light's color are all 1.0, the light is the brightest possible white. If the values are 0.5, the color is still white, but only at half intensity, so it appears gray. If R=G=1 and B=0 (full red and green with no blue), the light appears yellow. The intensity can also be modulated using the intensity field.

For materials, the numbers correspond to the reflected percentages of those colors. So if R=1, G=0.5, and B=0 for a material, that material reflects all the incoming red light, half the incoming green, and none of the incoming blue light. In other words, if an OpenGL light has components (LR, LG, LB), and a material has corresponding components (MR, MG, MB), then, ignoring all other reflectivity effects, the light that arrives at the eye is given by (LR*MR, LG*MG, LB*MB). As a result, for example, shining a pure blue light on a pure red cone has no visible effect.

Similarly, if you have two lights that send (R1, G1, B1) and (R2, G2, B2) to the eye, the components are added, giving (R1+R2, G1+G2, B1+B2). If any of the sums are greater than 1 (corresponding to a color brighter than the hardware can display), the component is clamped to 1.

The maximum number of lights depends on the hardware, but at least eight simultaneous lights are supported.

Note: By default lighting is only computed at the vertices of the geometry and the resulting colors are interpolated across the geometry. As a result, the illumination cone of a spotlight may not be visible unless the geometry is highly tesselated.

FILE FORMAT/DEFAULT

SpotLight {
on true
intensity 1
color 1 1 1
location 0 0 1
direction 0 0 -1
dropOffRate 0
cutOffAngle 0.785398
}

ACTION BEHAVIOR

OIV.Inventor.Actions.SoGLRenderAction Activates this light (if so specified) during traversal. All shape nodes that come after this light in the scene graph are illuminated by this light. The light's location is affected by the current transformation. Sets: OIV.Inventor.Elements.SoLightElement, SoLightIdElement

See Also