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 Direct3DRMMaterial2 object can be attached to a Direct3DRMMaterialInterpolator object. For more information on interpolators, see Interpolators in Further Reading.
Direct3DRMMaterialInterpolator contains the following methods.
Attaching objects AttachObject DetachObject GetAttachedObjects Emission SetEmissive Interpolating GetIndex Interpolate SetIndex Power for specular exponent SetPower Specular SetSpecular
In addition, Direct3DRMMaterialInterpolator 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 Direct3DRMMaterialInterpolator 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 Direct3DRMMaterial2 object can be attached to a Direct3DRMMaterialInterpolator object.
Detaches an object from the interpolator.
Syntax
object.DetachObject(mObject As Direct3DRMObject)
Parts
- object
- Object expression that resolves to a Direct3DRMMaterialInterpolator 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 Direct3DRMMaterialInterpolator 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 Direct3DRMMaterialInterpolator 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 Direct3DRMMaterialInterpolator 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 an emissive property key to a Direct3DRMMaterialInterpolator object.
Syntax
object.SetEmissive(r As Single, g As Single, b As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMMaterialInterpolator object.
- r, g, and b
- Red, green, and blue components of the emissive color.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
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 Direct3DRMMaterialInterpolator 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 spectral power key to a Direct3DRMMaterialInterpolator object.
Syntax
object.SetPower(power As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMMaterialInterpolator object.
- power
- New specular exponent.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
In the specular property of a material, the value of the power parameter will determine the sharpness of specular highlights. A value of 5 gives a metallic appearance, and higher values give a more plastic appearance.
Adds a spectral color key to a Direct3DRMMaterialInterpolator object.
Syntax
object.SetSpecular(r As Single, g As Single, b As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMMaterialInterpolator object.
- r, g, and b
- Red, green, and blue components of the color of the specular highlights.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.