Interpolators provide a way of storing actions and applying them to objects with automatic calculation of in-between values. With an interpolator you can blend colors, move objects smoothly between positions, morph meshes, and perform many other transformations.
A Direct3DRMLight object can be attached to a Direct3DRMLightInterpolator object. For more information on interpolators, see Interpolators in Further Reading.
The Direct3DRMLightInterpolator interface contains the following methods.
Attaching objects AttachObject DetachObject GetAttachedObjects Attenuation SetConstantAttenuation SetLinearAttenuation SetQuadraticAttenuation Color SetColor SetColorRGB Interpolating GetIndex Interpolate SetIndex Range SetRange Spotlight options SetPenumbra SetUmbra
In addition, Direct3DRMLightInterpolator inherits the following methods from the Direct3DRMObject interface.
Connects an object to the interpolator.
Syntax
object.AttachObject(mObject As Direct3DRMObject)
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
- mObject
- Direct3DRMObject object to attach to the interpolator.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
The attached object can be another interpolator or an object of type x where the interpolator is of type xInterpolator. For example, a Direct3DRMLight object can be attached to a Direct3DRMLightInterpolator object.
Detaches an object from the interpolator.
Syntax
object.DetachObject(mObject As Direct3DRMObject)
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
- mObject
- Direct3DRMObject object to detach from the interpolator.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Retrieves the objects currently attached to the interpolator.
Syntax
object.GetAttachedObjects( ) As Direct3DRMObjectArray
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
Return Value
Returns a Direct3DRMObjectArray object.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Retrieves the interpolator's current internal index (time).
Syntax
object.GetIndex( ) As Single
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
Return Value
Returns a value that contains the interpolator's current internal index.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
Every key stored in an interpolator has an index value. When a key is recorded (by using a method), the key is stamped with the current interpolator index value. The key's index value does not change after being stamped.
Generates a series of actions by interpolating between keys stored in the interpolator. The actions are then applied to the specified object. If no object is specified, the actions are applied to the currently attached objects.
Syntax
object.Interpolate(val As Single, mObject As Direct3DRMObject, options As CONST_D3DRMINTERPOLATIONFLAGS)
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
- val
- Value that contains the interpolator's current internal index.
- mObject
- Direct3DRMObject object that will be assigned interpolated values for all properties stored in the interpolator. Can be NOTHING, in which case the property values of all attached objects will be set to interpolated values.
- options
- One of the values from the CONST_D3DRMINTERPOLATIONFLAGS enumerated type that controls the kind of interpolation done.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Adds a color key to a Direct3DRMLightInterpolator object.
Syntax
object.SetColor(c As Long)
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
- c
- New color for the light. Make sure to set the alpha component as well as the red, green, and blue color components or your objects might not be visible. Colors are represented by a Long, consisting of 4 bytes. The high byte is the alpha component and the subsequent bytes define red, green, and blue. Use CreateColorRGBA from the DirectX7 object to more easily construct a color or use SetColorRGB if you only want full alpha.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Adds an RGB color key to a Direct3DRMLightInterpolator object.
Syntax
object.SetColorRGB(r As Single, g As Single, b As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
- r, g, and b
- New red, green, and blue color components for the light.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Adds a constant attenuation key to a Direct3DRMLightInterpolator object.
Syntax
object.SetConstantAttenuation(atn As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
- atn
- New constant attenuation factor.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
Lights that have a location (those that are not infinitely far away) can have attenuation factors to calculate the attenuation of the light based on the distance from the light.
The formula for the total attenuation factor is:
1 / [constant_attenuation_factor + distance * linear_attenuation_factor + (distance**2) * quadratic_attenuation_factor]
The total attenuation factor cannot be greater than 1. When attenuation factors are not provided, the default values are 1.0 for the constant attenuation factor, 0.0 for the linear attenuation factor, and 0.0 for the quadratic attenuation factor.
Sets the interpolator's internal index (time) to the specified value. If other interpolators are attached to the interpolator, this method recursively synchronizes their indices to the same value.
Syntax
object.SetIndex(val As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
- val
- Time to set for the interpolator's internal index.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
Every key stored in an interpolator has an index value. When a key is recorded (by using a method), the key is stamped with the current interpolator index value. The key's index value does not change after being stamped.
Adds a linear attenuation key to a Direct3DRMLightInterpolator object.
Syntax
object.SetLinearAttenuation(atn As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
- atn
- New linear attenuation factor.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
Lights that have a location (those that are not infinitely far away) can have attenuation factors to calculate the attenuation of the light based on distance from the light.
The formula for the total attenuation factor is:
1 / [constant_attenuation_factor + distance * linear_attenuation_factor + (distance**2) * quadratic_attenuation_factor]
The total attenuation factor cannot be greater than 1. When attenuation factors are not provided, the default values are 1.0 for the constant attenuation factor, 0.0 for the linear attenuation factor, and 0.0 for the quadratic attenuation factor.
Adds a penumbra angle key to a Direct3DRMLightInterpolator object.
Syntax
object.SetPenumbra(p As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
- p
- New penumbra angle, in radians. This angle must be greater than or equal to the angle of the umbra. If you set the penumbra angle to less than the umbra angle, the umbra angle will be set equal to the penumbra angle. The default value is 0.5 radians.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Adds a quadratic attenuation key to a Direct3DRMLightInterpolator object.
Syntax
object.SetQuadraticAttenuation(atn As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
- atn
- New quadratic attenuation factor.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
Lights that have a location (those that are not infinitely far away) can have attenuation factors to calculate the attenuation of the light based on distance from the light.
The formula for the total attenuation factor is:
1 / [constant_attenuation_factor + distance * linear_attenuation_factor + (distance**2) * quadratic_attenuation_factor]
The total attenuation factor cannot be greater than 1. When attenuation factors are not provided, the default values are 1.0 for the constant attenuation factor, 0.0 for the linear attenuation factor, and 0.0 for the quadratic attenuation factor.
See Also
Adds a range key to a Direct3DRMLightInterpolator object.
Syntax
object.SetRange(mg As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
- mg
- New range. The default value is 256 modeling-space units.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
The range property is for spotlights only.
Adds an umbra angle key to a Direct3DRMLightInterpolator object.
Syntax
object.SetUmbra(u As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMLightInterpolator object.
- u
- New umbra angle, in radians. This angle must be less than or equal to the angle of the penumbra. If you set the umbra angle to greater than the penumbra angle, the penumbra angle will be set equal to the umbra angle. The default value is 0.4 radians.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Top of Page
© 1999 Microsoft and/or its suppliers. All rights reserved. Terms of Use.