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.
The IDirect3DRMInterpolator interface is a superset of the IDirect3DRMAnimation interface that increases the kinds of object parameters you can animate. While IDirect3DRMAnimation allows animation of an object's position, size, and orientation, IDirect3DRMInterpolator further enables animation of color, meshes, texture, and material.
For a conceptual overview, see IDirect3DRMInterpolator Overview.
In addition to the standard IUnknown and IDirect3DRMObject methods, IDirect3DRMInterpolator contains the following methods:
| Attaching Objects | AttachObject |
| DetachObject | |
| GetAttachedObjects | |
| Interpolating | GetIndex |
| Interpolate | |
| SetIndex |
The IDirect3DRMInterpolator interface, like all Component Object Model (COM) interfaces, inherits the IUnknown interface methods. The IUnknown interface supports the following three methods:
| AddRef |
| QueryInterface |
| Release |
In addition, IDirect3DRMInterpolator interface inherits the following methods from the IDirect3DRMObject interface:
| AddDestroyCallback |
| Clone |
| DeleteDestroyCallback |
| GetAppData |
| GetClassName |
| GetName |
| SetAppData |
| SetName |
Connects an object to the interpolator.
HRESULT AttachObject(
LPDIRECT3DRMOBJECT lpD3DRMObject
)
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
The attached object can be another interpolator or an object of type x where the interpolator is of type xInterpolator. For example, a Viewport can be attached to a ViewportInterpolator. The interpolator types are:
Detaches an object from the interpolator.
HRESULT DetachObject(
LPDIRECT3DRMOBJECT lpD3DRMObject
)
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves an array of objects currently attached to the interpolator.
HRESULT GetAttachedObjects(
LPDIRECT3DRMOBJECTARRAY lpD3DRMObjectArray
)
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the interpolator's current internal index (time).
D3DVALUE GetIndex( )
Returns a D3DVALUE that contains the interpolator's current internal index.
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.
HRESULT Interpolate(
D3DVALUE d3dVal,
LPDIRECT3DRMOBJECT lpD3DRMObject,
D3DRMINTERPOLATIONOPTIONS d3drmInterpFlags
)
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return 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.
HRESULT SetIndex(
D3DVALUE d3dVal
)
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
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.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.