IDirect3DRMFrame3 Methods N to Z

This section contains the reference pages for the methods of the IDirect3DRMFrame3 interface that begin with the letters N through Z.

IDirect3DRMFrame3::RayPick

IDirect3DRMFrame3

Searches the hierarchy starting at this Direct3DRMFrame3 object and calculates the intersections between any visuals and the ray specified by the dvPosition and dvDirection parameters in the coordinate space specified by the lpRefFrame parameter.

Syntax

HRESULT RayPick(
  LPDIRECT3DRMFRAME3 lpRefFrame,
  LPD3DRMRAY ray,
  DWORD dwFlags,
  LPD3DRMPICKED2ARRAY *lplpPicked2Array
  );

Parameters

lpRefFrame
Address of the Direct3DRMFrame3 object that contains the ray.
ray
Pointer to a D3DRMRAY structure that contains two D3DVECTOR structures. The first D3DVECTOR structure is the vector direction of the ray. The second D3DVECTOR structure is the position of the origin of the ray.
dwFlags
Can be one of the following values:
D3DRMRAYPICK_ONLYBOUNDINGBOXES – Only intersections with bounding boxes of the visuals in the hierarchy are returned. Does not check for exact face intersections.
D3DRMRAYPICK_IGNOREFURTHERPRIMITIVES – Only the closest visual that intersects the ray is returned. Ignores visuals farther away than the closest one found so far in a search.
D3DRMRAYPICK_INTERPOLATEUV – Interpolate texture coordinates.
D3DRMRAYPICK_INTERPOLATECOLOR – Interpolate color.
D3DRMRAYPICK_INTERPOLATENORMAL – Interpolate normal.
lplpPicked2Array
The address of a pointer to be initialized with a valid pointer to the IDirect3DRMPicked2Array interface. You then use the IDirect3DRMPicked2Array::GetPick method to retrieve a visual object, an IDirect3DRMFrameArray interface, and a D3DRMPICKDESC2 structure. The array of frames is the path through the hierarchy leading to the visual object that intersected the ray. The D3DRMPICKDESC2 structure contains the face and group identifiers, pick position, horizontal and vertical texture coordinates for the vertex, vertex normal, and color of the intersected objects.

If you specify D3DRMRAYPICK_ONLYBOUNDINGBOXES, the texture, normal, and color data in the D3DRMPICKDESC2 structure will be invalid.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

There are two kinds of flags: optimization flags and interpolation flags. Optimization flags allow you to limit the search and therefore make it faster. Interpolation flags specify what to interpolate if a primitive is hit. The three interpolation choices are color, normal, and texture coordinates.

The ray is specified in the reference frame coordinate space (pointed to by lpRefFrame). If the reference frame is NULL, the ray is specified in world coordinates.

IDirect3DRMFrame3::Save

IDirect3DRMFrame3

Saves a Direct3DRMFrame3 object to the specified file.

Syntax

HRESULT Save(
  LPCSTR lpFilename,
  D3DRMXOFFORMAT d3dFormat,
  D3DRMSAVEOPTIONS d3dSaveFlags
  );

Parameters

lpFilename
Address specifying the name of the created file. This file must have a .x file name extension.
d3dFormat
D3DRMXOF_TEXT value from the D3DRMXOFFORMAT enumerated type.
d3dSaveFlags
Value of the D3DRMSAVEOPTIONS type describing the save options.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

IDirect3DRMFrame3::SetAxes

IDirect3DRMFrame3

Sets the vectors that define a coordinate space by which the IDirect3DRMFrame3::SetOrientation vectors are transformed.

Syntax

HRESULT SetAxes(
  D3DVALUE dx,
  D3DVALUE dy,
  D3DVALUE dz,
  D3DVALUE ux,
  D3DVALUE uy,
  D3DVALUE uz
  );

Parameters

dx, dy, dz
The z-axis for the frame. Default is (0,0,1).
ux, uy, uz
The y-axis for the frame. Default is (0,1,0).

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

This method helps support both left-handed and right-handed coordinate systems. This method also allows you to specify that the negative z-axis represents the front of the object.

The IDirect3DRMFrame3::SetOrientation direction (rvDx, rvDy, rvDz) and up (rvUx, rvUy, rvUz) vectors are transformed according to the value of the SetAxes vectors.

The axes are inherited by child frames as specified in IDirect3DRMFrame3::SetInheritAxes.

See Also

IDirect3DRMFrame3::GetAxes, IDirect3DRMFrame3::GetInheritAxes, IDirect3DRMFrame3::SetInheritAxes

IDirect3DRMFrame3::SetBox

IDirect3DRMFrame3

Sets the box to be used in bounding-box testing. In order for the bounding box to be valid, its minimum x must be less than or equal to its maximum x, minimum y must be less than or equal to its maximum y, and minimum z must be less than or equal to its maximum z.

Syntax

HRESULT SetBox(
  D3DRMBOX *lpD3DRMBox
  );

Parameters

lpD3DRMBox
Address of a D3DRMBOX structure that contains the bounding-box coordinates.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

This method supports a bounding box on a frame for hierarchical culling. For a bounding box to be enabled, the IDirect3DRMFrame3::SetBoxEnable method must be used to set the enable flag to TRUE. By default, the box-enable flag is FALSE.

See Also

IDirect3DRMFrame3::GetBox, IDirect3DRMFrame3::SetBoxEnable, IDirect3DRMFrame3::GetBoxEnable

IDirect3DRMFrame3::SetBoxEnable

IDirect3DRMFrame3

Enables or disables bounding-box testing for this Direct3DRMFrame3 object. Bounding-box testing cannot be enabled unless a valid bounding box has already been set on the frame.

Syntax

HRESULT SetBoxEnable(
  BOOL bEnableFlag
  );

Parameters

bEnableFlag
Flag specifying whether bounding boxes are enabled or not. TRUE to enable a bounding box. FALSE if a bounding box is not enabled. Default is FALSE.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

For a bounding box to be enabled, this method must be used to set the enable flag to TRUE. By default, the box-enable flag is FALSE.

Bounding-box testing is performed as follows: At render time, the bounding box is transformed into model space and checked for intersection with the viewing frustum. If the entire box is outside of the viewing frustum, none of the visuals in the frame, or in any child frame, are rendered. Otherwise, rendering continues as normal.

Enabling bounding-box testing with a box of {0,0,0,0} completely prevents a frame from being rendered.

See Also

IDirect3DRMFrame3::GetBoxEnable, IDirect3DRMFrame3::GetBox, IDirect3DRMFrame3::SetBox

IDirect3DRMFrame3::SetColor

IDirect3DRMFrame3

Sets the color of the frame. This color is used for meshes in the frame when the D3DRMMATERIALMODE enumerated type is D3DRMMATERIAL_FROMFRAME.

Syntax

HRESULT SetColor(
  D3DCOLOR rcColor
  );

Parameters

rcColor
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. The RGBA_MAKE DirectX macro allows you to specify these values.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

This method is also used to add a color key to a DIRECT3DRMFRAMEINTERPOLATOR object. By default, the color is white.

See Also

IDirect3DRMFrame3::GetColor, IDirect3DRMFrame3::SetMaterialMode

IDirect3DRMFrame3::SetColorRGB

IDirect3DRMFrame3

Sets the color of the frame. This color is used for meshes in the frame when the D3DRMMATERIALMODE enumerated type is D3DRMMATERIAL_FROMFRAME.

Syntax

HRESULT SetColorRGB(
  D3DVALUE rvRed,
  D3DVALUE rvGreen,
  D3DVALUE rvBlue
  );

Parameters

rvRed, rvGreen, and rvBlue
New color for the frame. Each component of the color should be in the range 0.0 to 1.0.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

This method is also used to add an RGB color key to a DIRECT3DRMFRAMEINTERPOLATOR object.

See Also

IDirect3DRMFrame3::SetMaterialMode

IDirect3DRMFrame3::SetInheritAxes

IDirect3DRMFrame3

Specifies whether the axes for the frame are inherited from the parent frame.

Syntax

HRESULT SetInheritAxes(
  BOOL inherit_from_parent
  );

Parameters

inherit_from_parent
Flag indicating whether the frame should inherit axes from its parent. If TRUE, the frame inherits axes (the default). If FALSE, the frame does not inherit axes.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

By default, the axes are inherited from the parent. If a frame is set to inherit from the parent, and there is no parent, the frame acts as if it inherits from a parent with the default axes (direction=(0,0,1) and up=(0,1,0)). This method allows a single policy for axes to be set at the root of the hierarchy.

See Also

IDirect3DRMFrame3::GetInheritAxes, IDirect3DRMFrame3::GetAxes, IDirect3DRMFrame3::SetAxes

IDirect3DRMFrame3::SetMaterial

IDirect3DRMFrame3

Sets the material of the Direct3DRMFrame2 object.

Syntax

HRESULT SetMaterial(
  LPDIRECT3DRMMATERIAL2 *lplpMaterial
  );

Parameters

lplpMaterial
Address of the Direct3DRMMaterial object that will be applied to the frame.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

See Also

IDirect3DRMFrame3::GetMaterial

IDirect3DRMFrame3::SetMaterialMode

IDirect3DRMFrame3

Sets the material mode for a frame. The material mode determines the source of material information for visuals rendered with the frame.

Syntax

HRESULT SetMaterialMode(
  D3DRMMATERIALMODE rmmMode
  );

Parameters

rmmMode
One of the members of the D3DRMMATERIALMODE enumerated type. By default, the mode is D3DRMMATERIAL_FROMMESH.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

See Also

IDirect3DRMFrame3::GetMaterialMode

IDirect3DRMFrame3::SetMaterialOverride

IDirect3DRMFrame3

Enables you to set specific material attributes. For example, this method enables you to override only the emissive property of materials.

Syntax

HRESULT SetMaterialOverride(
  LPD3DRMMATERIALOVERRIDE lpdmOverride);

Parameters

lpdmOverride
Pointer to a D3DRMMATERIALOVERRIDE structure that describes the properties to be overridden.

Return Value

Returns one of the following values:
 
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DD_OK

Remarks

The override always overrides everything down the hierarchy. If you override the emissive property in one frame, any attempts to override the same property farther down the hierarchy will be ignored. This override also takes precedence over standard frame overrides, as well as material properties on specific meshes. Overrides such as SetMaterial and SetTexture have no effect on the behavior of this method.

This method was introduced with DirectX version 6.0.

See Also

GetMaterialOverride

IDirect3DRMFrame3::SetOrientation

IDirect3DRMFrame3

Aligns a frame so that its z-direction points along the direction vector [rvDx, rvDy, rvDz] and its y-direction aligns with the vector [rvUx, rvUy, rvUz].

Syntax

HRESULT SetOrientation(
  LPDIRECT3DRMFRAME3 lpRef,
  D3DVALUE rvDx,
  D3DVALUE rvDy,
  D3DVALUE rvDz,
  D3DVALUE rvUx,
  D3DVALUE rvUy,
  D3DVALUE rvUz
  );

Parameters

lpRef
Address of a variable that represents the Direct3DRMFrame object to be used as the reference. This can be NULL. If NULL, the method uses its own local transform matrix instead of using the reference frame's transform matrix.
rvDx, rvDy, and rvDz
New z-axis for the frame. Each component of the vector should be in the range -1.0 to 1.0.
rvUx, rvUy, and rvUz
New y-axis for the frame. Each component of the vector should be in the range -1.0 to 1.0.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return 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 [rvUx, rvUy, rvUz] is parallel to [rvDx, rvDy, rvDz], the D3DRMERR_BADVALUE error value is returned; otherwise, the [rvUx, rvUy, rvUz] vector passed is projected onto the plane that is perpendicular to [rvDx, rvDy, rvDz].

This method is also used to add an orientation key to a Direct3DRMFrameInterpolator object.

Prior to DirectX version 6.0, SetOrientation did not respect scale and shear. This was fixed in DirectX version 6.0.

The following code fragment calls SetOrientation to set the default orientation. It assumes the camera and scene frames have already been created using the IDirect3DRM3::CreateFrame method.

LPDIRECT3DRMFRAME3 camera;
LPDIRECT3DRMFRAME3 scene;

if (FAILED(camera->SetOrientation(scene, D3DVAL(0), D3DVAL(0), D3DVAL(1),
                                  D3DVAL(0), D3DVAL(1), D3DVAL(0)))
{
    // error
}

See Also

IDirect3DRMFrame3::GetOrientation

IDirect3DRMFrame3::SetPosition

IDirect3DRMFrame3

Sets the position of a frame relative to the frame of reference. It places the frame a distance of [rvX, rvY, rvZ] from the reference. When a child frame is created within a parent, it is placed at [0, 0, 0] in the parent frame.

Syntax

HRESULT SetPosition(
  LPDIRECT3DRMFRAME3 lpRef,
  D3DVALUE rvX,
  D3DVALUE rvY,
  D3DVALUE rvZ
  );

Parameters

lpRef
Address of a variable that represents the Direct3DRMFrame object to be used as the reference. This can be NULL. If NULL, the method uses its own local transform matrix instead of using the reference frame's transform matrix.
rvX, rvY, and rvZ
New position for the frame. Position has no units. Use the viewing frustrum to choose reasonable numbers. For more information, see Viewports.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

This method is also used to add a position key to a Direct3DRMFrameInterpolator object.

The following code fragment calls SetPosition. It assumes the camera and scene frames have already been created using the IDirect3DRM3::CreateFrame method.

LPDIRECT3DRMFRAME3 camera;
LPDIRECT3DRMFRAME3 scene;

if (FAILED(camera->SetPosition(scene, D3DVAL(0), D3DVAL(0), -D3DVAL(10)))
{
    // error
}

See Also

IDirect3DRMFrame3::GetPosition

IDirect3DRMFrame3::SetQuaternion

IDirect3DRMFrame3

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

Syntax

HRESULT SetQuaternion(
  LPDIRECT3DRMFRAME3 lpRef,
  D3DRMQUATERNION *quat
  )

Parameters

lpRef
Address of a variable that represents the Direct3DRMFrame2 object to be used as the reference. This can be NULL. If NULL, the method uses its own local transform matrix instead of using the reference frame's transform matrix.
quat
A D3DRMQUATERNION structure that holds the unit quaternion.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

A quaternion is a four-valued vector that can be used to represent any rotation and that 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.

The function D3DRMQuaternionFromRotation can be used to generate unit quaternions from arbitrary rotation values.

The SetQuaternion method is supported by FrameInterpolators. See Interpolators for more information about interpolators.

IDirect3DRMFrame3::SetRotation

IDirect3DRMFrame3

Sets a frame rotating by the given angle around the given vector at each call to the IDirect3DRM3::Tick or IDirect3DRMFrame3::Move method. The direction vector [rvX, rvY, rvZ] is defined in the reference frame.

Syntax

HRESULT SetRotation(
  LPDIRECT3DRMFRAME3 lpRef,
  D3DVALUE rvX,
  D3DVALUE rvY,
  D3DVALUE rvZ,
  D3DVALUE rvTheta
  );

Parameters

lpRef
Address of a variable that represents the Direct3DRMFrame object to be used as the reference. This can be NULL. If NULL, the method uses its own local transform matrix instead of using the reference frame's transform matrix.
rvX, rvY, and rvZ
Vector about which rotation occurs. Valid values are in the range -1.0 to 1.0.
rvTheta
Rotation angle, in radians. The larger the angle, the faster an object rotates. The IDirect3DRMFrame3::Move and IDirect3DRM3::Tick methods scale this value.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

The specified rotation changes the matrix with every render tick, unlike the IDirect3DRMFrame3::AddRotation method, which changes the objects in the frame only once.

The following code fragment calls SetRotation. It assumes the child and scene frames have already been created using the IDirect3DRM3::CreateFrame method.

LPDIRECT3DRMFRAME3 child;
LPDIRECT3DRMFRAME3 scene;

if (FAILED(child->SetRotation(scene, D3DVAL(0), D3DVAL(1), D3DVAL(1), D3DVAL(0.02)))
{
    // error
}

See Also

IDirect3DRMFrame3::AddRotation, IDirect3DRMFrame3::GetRotation

IDirect3DRMFrame3::SetSceneBackground

IDirect3DRMFrame3

Sets the background color of a scene.

Syntax

HRESULT SetSceneBackground(
  D3DCOLOR rcColor
  );

Parameters

rcColor
New color for the background.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

This method is also used to add a background color key to a Direct3DRMFrameInterpolator object.

IDirect3DRMFrame3::SetSceneBackgroundDepth

IDirect3DRMFrame3

Specifies a background-depth buffer for a scene.

Syntax

HRESULT SetSceneBackgroundDepth(
  LPDIRECTDRAWSURFACE lpImage
  );

Parameters

lpImage
Address of a DirectDraw surface that will store the new background depth for the scene.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

The image must have a depth of 16 bits per pixel. If the image and viewport sizes are different, the image is scaled first. For best performance when animating the background-depth buffer, the image should be the same size as the viewport. This enables the depth buffer to be updated directly from the image memory without incurring extra overhead.

See Also

IDirect3DRMFrame3::GetSceneBackgroundDepth

IDirect3DRMFrame3::SetSceneBackgroundImage

IDirect3DRMFrame3

This method is obsolete and should not be used. It does not have the same behavior it did in DirectX version 5 because of changes in rasterizers. Rather than use this method you should do a blit (bit block transfer) to the screen for your background.

Syntax

HRESULT SetSceneBackgroundImage(
  LPDIRECT3DRMTEXTURE3 lpTexture
  );

Parameters

lpTexture
Address of a Direct3DRMTexture object that will contain the new background scene.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

This method is obsolete. It does not have the same behavior it did in DirectX version 5.

IDirect3DRMFrame3::SetSceneBackgroundRGB

IDirect3DRMFrame3

Sets the background color of a scene.

Syntax

HRESULT SetSceneBackgroundRGB(
  D3DVALUE rvRed,
  D3DVALUE rvGreen,
  D3DVALUE rvBlue
  );

Parameters

rvRed, rvGreen, and rvBlue
New color for the background. Each component of the color should be in the range 0.0 to 1.0.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

This method is also used to add a background RGB color key to a Direct3DRMFrameInterpolator object.

IDirect3DRMFrame3::SetSceneFogColor

IDirect3DRMFrame3

Sets the fog color of a scene.

Syntax

HRESULT SetSceneFogColor(
  D3DCOLOR rcColor
  );

Parameters

rcColor
New color for the fog.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

This method is also used to add a fog color key to a Direct3DRMRFrameInterpolator object. By default, the color is white.

IDirect3DRMFrame3::SetSceneFogEnable

IDirect3DRMFrame3

Sets the fog-enable state.

Syntax

HRESULT SetSceneFogEnable(
  BOOL bEnable
  );

Parameters

bEnable
New fog-enable state.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

By default, fog is not enabled.

IDirect3DRMFrame3::SetSceneFogMethod

IDirect3DRMFrame3

Specifies whether fogging is to be performed via vertex fog or table fog.

Syntax

HRESULT SetSceneFogMethod(
  DWORD dwFlags);

Parameters

dwFlags
The currently defined flags are:
D3DRMFOGMETHOD_ANY
Indicates that Direct3D Retained Mode should choose an applicable method.
D3DRMFOGMETHOD_VERTEX
Use vertex fog.
D3DRMFOGMETHOD_TABLE
Use table fog.

Return Value

Returns one of the following values:
 
D3DRMERR_BADVALUE
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DD_OK

Remarks

The default behavior for Direct3DRMFrame objects created by the IDirect3DRM3 interface is D3DRMFOGMETHOD_ANY and the fog method will be chosen based on the capabilities of the device. If the device supports both vertex- and table-based fog then vertex fogging will be used. If the application requests table fog, but table fog is not available, vertex fog will be used. The default behavior for Direct3DRMFrame objects created with an IDirect3DRM or IDirect3DRM2 interface is D3DRMFOGMETHOD_VERTEX.

Remarks

This method was introduced with DirectX version 6.0.

IDirect3DRMFrame3::SetSceneFogMode

IDirect3DRMFrame3

Sets the fog mode.

Syntax

HRESULT SetSceneFogMode(
  D3DRMFOGMODE rfMode
  );

Parameters

rfMode
One of the members of the D3DRMFOGMODE enumerated type, specifying the new fog mode.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

See Also

IDirect3DRMFrame3::SetSceneFogParams

IDirect3DRMFrame3::SetSceneFogParams

IDirect3DRMFrame3

Sets the current fog parameters for this scene.

Syntax

HRESULT SetSceneFogParams(
  D3DVALUE rvStart,
  D3DVALUE rvEnd,
  D3DVALUE rvDensity
  );

Parameters

rvStart and rvEnd
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.
rvDensity
Fog density for the exponential fog modes. This value should be in the range 0 through 1.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

This method is also used to add a fog parameters key to a Direct3DRMRFrameInterpolator object.

See Also

D3DRMFOGMODE, IDirect3DRMFrame3::SetSceneFogMode

IDirect3DRMFrame3::SetSortMode

IDirect3DRMFrame3

Sets the sorting mode used to process child frames. You can use this method to change the properties of hidden-surface-removal algorithms.

Syntax

HRESULT SetSortMode(
  D3DRMSORTMODE d3drmSM
  );

Parameters

d3drmSM
One of the members of the D3DRMSORTMODE enumerated type, specifying the sorting mode. The default value is D3DRMSORT_FROMPARENT.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

See Also

IDirect3DRMFrame3::GetSortMode

IDirect3DRMFrame3::SetTexture

IDirect3DRMFrame3

Sets the texture of the frame.

Syntax

HRESULT SetTexture(
  LPDIRECT3DRMTEXTURE3 lpD3DRMTexture
  );

Parameters

lpD3DRMTexture
Address of a variable that represents the Direct3DRMTexture object to be used.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

Remarks

The texture is used for meshes in the frame when the D3DRMMATERIALMODE enumerated type is D3DRMMATERIAL_FROMFRAME. To disable the frame's texture, use a NULL texture.

See Also

IDirect3DRMFrame3::GetTexture, IDirect3DRMFrame3::SetMaterialMode

IDirect3DRMFrame3::SetTraversalOptions

IDirect3DRMFrame3

Specifies whether this frame is traversed during rendering and picking. In other words, using this API without a value of D3DRMFRAME_RENDERENABLE effectively switches the frame off for rendering. By default, the frame is enabled for rendering and picking.

Syntax

HRESULT SetTraversalOptions
(DWORD dwFlags);

Parameters

dwFlags
The currently defined flags are:
D3DRMFRAME_RENDERENABLE
Indicates render this frame or any children of this frame.
D3DRMFRAME_PICKENABLE
Indicates pick any visuals in this frame or any children of this frame.

Return Value

Returns one of the following values:
 
D3DRMERR_BADVALUE
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DD_OK

Remarks

This method was introduced with DirectX version 6.0.

IDirect3DRMFrame3::SetVelocity

IDirect3DRMFrame3

Sets the velocity of the given frame relative to the reference frame. The frame will be moved by the vector [rvX, rvY, rvZ] with respect to the reference frame at each successive call to the IDirect3DRM3::Tick or IDirect3DRMFrame3::Move method.

Syntax

HRESULT SetVelocity(
  LPDIRECT3DRMFRAME3 lpRef,
  D3DVALUE rvX,
  D3DVALUE rvY,
  D3DVALUE rvZ,
  BOOL fRotVel
  );

Parameters

lpRef
Address of a variable that represents the Direct3DRMFrame object to be used as the reference. This can be NULL. If NULL, the method uses its own local transform matrix instead of using the reference frame's transform matrix.
rvX, rvY, and rvZ
New velocity for the frame. Rotational velocity has no units and can be any value. The IDirect3DRMFrame3::Move and IDirect3DRM3::Tick methods scale this value.
fRotVel
Flag specifying whether the rotational velocity of the object is taken into account when setting the linear velocity. If TRUE, the object's rotational velocity is included in the calculation.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

See Also

IDirect3DRMFrame3::GetVelocity

IDirect3DRMFrame3::SetZbufferMode

IDirect3DRMFrame3

Sets the z-buffer mode; that is, whether z-buffering is enabled or disabled.

Syntax

HRESULT SetZbufferMode(
  D3DRMZBUFFERMODE d3drmZBM
  );

Parameters

d3drmZBM
One of the members of the D3DRMZBUFFERMODE enumerated type, specifying the z-buffer mode. The default value is D3DRMZBUFFER_FROMPARENT.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

See Also

IDirect3DRMFrame3::GetZbufferMode

IDirect3DRMFrame3::Transform

IDirect3DRMFrame3

Transforms the vector in the lpd3dVSrc parameter in model coordinates to world coordinates, returning the result in the lpd3dVDst parameter.

Syntax

HRESULT Transform(
  D3DVECTOR *lpd3dVDst,
  D3DVECTOR *lpd3dVSrc
  );

Parameters

lpd3dVDst
Address of a D3DVECTOR structure that will be filled with the result of the transformation operation.
lpd3dVSrc
Address of a D3DVECTOR structure that is the source of the transformation operation.

Return Value

Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.

See Also

IDirect3DRMFrame3::InverseTransform, 3-D Transformations

IDirect3DRMFrame3::TransformVectors

IDirect3DRMFrame3

Transforms an array of vectors from model- to world-space.

Syntax

HRESULT TransformVectors(
  LPDIRECT3DRMFRAME3 lpRefFrame,
  DWORD dwNumVectors,
  LPD3DVECTOR lpDstVectors,
  LPD3DVECTOR lpSrcVectors);

Parameters

lpRefFrame
Frame that is to be used as the root of the scene for the purposes of this call. If this argument is NULL, the current root frame (as would be returned by GetScene) will be used.
dwNumVectors
The number of vectors to be transformed.
lpDstVectors
Destination of the transformation.
lpSrcVectors
Array of vectors to transform.

Return Value

Returns one of the following values:
 
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DD_OK

Remarks

This method was introduced with DirectX version 6.0.


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