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 Direct3DRMViewport2 object can be attached to a Direct3DRMViewportInterpolator object. For more information on interpolators, see Interpolators in Further Reading.
The Direct3DRMViewportInterpolator interface contains the following methods.
Attaching objects AttachObject DetachObject GetAttachedObjects Clipping planes SetBack SetFront Field of view SetField Interpolating GetIndex Interpolate SetIndex
In addition, Direct3DRMViewportInterpolator 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 Direct3DRMViewportInterpolator 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 Direct3DRMViewport2 object can be attached to a Direct3DRMViewportInterpolator object.
Detaches an object from the interpolator.
Syntax
object.DetachObject(mObject As Direct3DRMObject)
Parts
- object
- Object expression that resolves to a Direct3DRMViewportInterpolator 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 Direct3DRMViewportInterpolator 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 Direct3DRMViewportInterpolator 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 Direct3DRMViewportInterpolator 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 back clipping plane position key to a Direct3DRMViewportInterpolator object.
Syntax
object.SetBack(v As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMViewportInterpolator object.
- v
- Distance between the camera and the back clipping plane. The default value is 100. Reasonable values depend on other viewing frustum settings.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Adds a field of view key to a Direct3DRMViewportInterpolator object.
Syntax
object.SetField(v As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMViewportInterpolator object.
- v
- New field of view. This value is a fraction of the viewing angle. The default value is 0.5. If this value is less than or equal to zero, this method returns the D3DRMERR_BADVALUE error. The viewing angle is defined as 2 times the arctangent of the front clipping plane over the distance from the camera.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Adds a front clipping plane position key to a Direct3DRMViewportInterpolator object.
Syntax
object.SetFront(v As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMViewportInterpolator object.
- v
- Distance from the camera to the front clipping plane. The default value is 1.0. Reasonable values depend on other viewing frustum settings.
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 Direct3DRMViewportInterpolator 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.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.