Direct3DRMFrameInterpolator

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 Direct3DRMFrame3 object can be attached to a Direct3DRMFrameInterpolator object. For more information on interpolators, see Interpolators in Further Reading.

Direct3DRMFrameInterpolator contains the following methods.

Attaching objects AttachObject
DetachObject
GetAttachedObjects
Background SetSceneBackground
SetSceneBackgroundRGB
Color SetColor
SetColorRGB
Fog SetSceneFogColor
SetSceneFogParams
Interpolating GetIndex
Interpolate
SetIndex
Positioning and movement SetOrientation
SetPosition
SetQuaternion
SetRotation
SetVelocity

In addition, Direct3DRMFrameInterpolator inherits the following methods from the Direct3DRMObject interface.

Direct3DRMFrameInterpolator.AttachObject

Direct3DRMFrameInterpolator

Connects an object to the interpolator.

Syntax

object.AttachObject(mObject As Direct3DRMObject)

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator 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 Direct3DRMFrame3 object can be attached to a Direct3DRMFrameInterpolator object.

Direct3DRMFrameInterpolator.DetachObject

Direct3DRMFrameInterpolator

Detaches an object from the interpolator.

Syntax

object.DetachObject(mObject As Direct3DRMObject)

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator object.
mObject
Direct3DRMObject object to detach from the interpolator.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Direct3DRMFrameInterpolator.GetAttachedObjects

Direct3DRMFrameInterpolator

Retrieves the objects currently attached to the interpolator.

Syntax

object.GetAttachedObjects( ) As Direct3DRMObjectArray

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator object.

Return Value

Returns a Direct3DRMObjectArray object.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Direct3DRMFrameInterpolator.GetIndex

Direct3DRMFrameInterpolator

Retrieves the interpolator's current internal index (time).

Syntax

object.GetIndex( ) As Single

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator 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.

Direct3DRMFrameInterpolator.Interpolate

Direct3DRMFrameInterpolator

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 Direct3DRMFrameInterpolator 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.

Direct3DRMFrameInterpolator.SetColor

Direct3DRMFrameInterpolator

Adds a color key to a Direct3DRMFrameInterpolator object.

Syntax

object.SetColor(c As Long)

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator object.
c
New color for the frame. Be sure to set the alpha component as well as the red, green, and blue color components or your objects might not be visible. To specify an object's color, including the alpha component, call the CreateColorRGBA method from the DirectX7 interface on the object.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Direct3DRMFrameInterpolator.SetColorRGB

Direct3DRMFrameInterpolator

Adds an RGB color key to a Direct3DRMFrameInterpolator object.

Syntax

object.SetColorRGB(r As Single,
  g As Single,
  b As Single)

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator object.
r, g, b
New color for the frame. Each component of the color should be in the range 0.0 to 1.0.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Direct3DRMFrameInterpolator.SetIndex

Direct3DRMFrameInterpolator

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 Direct3DRMFrameInterpolator 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.

Direct3DRMFrameInterpolator.SetOrientation

Direct3DRMFrameInterpolator

Adds an orientation key to a Direct3DRMFrameInterpolator object.

Syntax

object.SetOrientation(reference As Direct3DRMFrame3,
  dx As Single,
  dy As Single,
  dz As Single,
  ux As Single,
  uy As Single,
  uz As Single)

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator object.
reference
Variable that represents the Direct3DRMFrame3 object to be used as the reference.
dx, dy, dz
New z-axis for the frame. Each component of the vector should be in the range ­1.0 to 1.0.
ux, uy, uz
New y-axis for the frame. Each component of the vector should be in the range ­1.0 to 1.0.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Remarks

The default orientation of a frame has a direction vector of [0, 0, 1] and an up vector of [0, 1, 0].

If [ux, uy, uz] is parallel to [dx, dy, dz], the D3DRMERR_BADVALUE error value is returned; otherwise, the [ux, uy, uz] vector passed is projected onto the plane that is perpendicular to [dx, dy, dz].

Direct3DRMFrameInterpolator.SetPosition

Direct3DRMFrameInterpolator

Adds a position key to a Direct3DRMFrameInterpolator object.

Syntax

object.SetPosition(reference As Direct3DRMFrame3,
  x As Single,
  y As Single,
  z As Single)

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator object.
reference
Variable that represents the Direct3DRMFrame3 object to be used as the reference.
x, y, z
New position for the frame. Position has no units. Use the viewing frustum to choose reasonable numbers.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Direct3DRMFrameInterpolator.SetQuaternion

Direct3DRMFrameInterpolator

Sets a frame's orientation relative to a reference frame, using a unit quaternion.

Syntax

object.SetQuaternion(reference As Direct3DRMFrame3,
  quat As D3DRMQUATERNION)

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator object.
reference
Variable that represents the Direct3DRMFrame3 object to be used as the reference.
quat
D3DRMQUATERNION type used to set the frame's orientation.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Remarks

A quaternion is a four-valued vector that can be used to represent any rotation and has properties that are useful when interpolating between orientations. A quaternion is a unit quaternion if s**2 + x**2 + y**2 + z**2 = 1.

Direct3DRMFrameInterpolator.SetRotation

Direct3DRMFrameInterpolator

Sets a frame rotating by the given angle around the given vector at each call to the Direct3DRM3.Tick or Direct3DRMFrame3.Move method. The direction vector [x, y, z] is defined in the reference frame.

Syntax

object.SetRotation(reference As Direct3DRMFrame3,
  x As Single,
  y As Single,
  z As Single,
  theta As Single)

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator object.
reference
Variable that represents the Direct3DRMFrame3 object to be used as the reference.
x, y, z
Vector about which rotation occurs. Valid values are in the range ­1.0 to 1.0.
theta
Rotation angle, in radians. The larger the angle, the faster an object rotates. The Move and Tick methods scale this value.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Remarks

The specified rotation changes the matrix with every render tick.

Direct3DRMFrameInterpolator.SetSceneBackground

Direct3DRMFrameInterpolator

Adds a background color key to a Direct3DRMFrameInterpolator object.

Syntax

object.SetSceneBackground(c As Long)

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator object.
c
New color for the background. To specify an object's color, including the alpha component, call the CreateColorRGBA method from the DirectX7 interface on the object.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Direct3DRMFrameInterpolator.SetSceneBackgroundRGB

Direct3DRMFrameInterpolator

Adds a background RGB color key to a Direct3DRMFrameInterpolator object.

Syntax

object.SetSceneBackgroundRGB(r As Single,
  g As Single,
  b As Single)

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator object.
r, g, b
New color for the background. Each red, green, and blue component of the color should be in the range 0.0 to 1.0.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Direct3DRMFrameInterpolator.SetSceneFogColor

Direct3DRMFrameInterpolator

Adds a fog color key to a Direct3DRMRFrameInterpolator object.

Syntax

object.SetSceneFogColor(c As Long)

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator object.
c
New color for the fog.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Direct3DRMFrameInterpolator.SetSceneFogParams

Direct3DRMFrameInterpolator

Adds a fog parameters key to a Direct3DRMRFrameInterpolator object.

Syntax

object.SetSceneFogParams(start As Single,
  End As Single,
  density As Single)

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator object.
start, End
Fog start and end points for linear fog mode. These settings determine the distance from the camera at which fog effects first become visible, and the distance at which fog reaches its maximum density.
density
Fog density for the exponential fog modes. This value should be in the range 0 through 1.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.

Direct3DRMFrameInterpolator.SetVelocity

Direct3DRMFrameInterpolator

Sets the velocity of the given frame relative to the reference frame. The frame will be moved by the vector [x, y, z] with respect to the reference frame at each successive call to the Direct3DRM3.Tick or Direct3DRMFrame3.Move method.

Syntax

object.SetVelocity(reference As Direct3DRMFrame3,
  x As Single,
  y As Single,
  z As Single,
  with_rotation As CONST_DBOOLFLAGS)

Parts

object
Object expression that resolves to a Direct3DRMFrameInterpolator object.
reference
Direct3DRMFrame3 object to be used as the reference.
x, y, z
New velocity for the frame. Rotational velocity has no units and can be any value. The Move and Tick methods scale this value.
with_rotation
Flag specifying whether the rotational velocity of the object is taken into account when setting the linear velocity. If set to D_TRUE, the object's rotational velocity is included in the calculation; otherwise, set to D_FALSE.

Error Values

For a list of possible errors, see Direct3D Retained Mode Error Values.


Top of Page Top of Page
© 1999 Microsoft and/or its suppliers. All rights reserved. Terms of Use.