This section contains the reference material for the methods of the Direct3DRMFrame3 interface that begin with the letters N through Z.
Searches the hierarchy starting at this Direct3DRMFrame3 object and calculates the intersections between any visuals and the ray specified by the Direct3DRMFrame3 interface referenced by the refer parameter.
Syntax
object.RayPick(refer As Direct3DRMFrame3, ray As D3DRMRAY, flags As CONST_D3DRMRAYPICKFLAGS) As Direct3DRMPick2Array
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- refer
- Direct3DRMFrame3 object that contains the ray.
- ray
- D3DRMRAY type that contains two D3DVECTOR types. The first D3DVECTOR type is the vector direction of the ray. The second D3DVECTOR type is the position of the ray's origin.
- flags
- One or more values from the CONST_D3DRMRAYPICKFLAGS enumerated type, indicating type of intersection calculated or interpolation options.
Return Value
Returns a Direct3DRMPick2Array object.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
There are two kinds of flags: optimization flags and interpolation flags. Optimization flags enable 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 refer). If the reference frame is NOTHING, the ray is specified in world coordinates.
Saves a Direct3DRMFrame3 object to the specified file.
Syntax
object.Save(name As String, format As CONST_D3DRMXOFFORMAT, flags As CONST_D3DRMSAVEFLAGS)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- name
- Name of the created file. This file must have the .x file name extension.
- format
- D3DRMXOF_TEXT value from the CONST_D3DRMXOFFORMAT enumerated type, indicating that the file is in text format.
- flags
- One or more values from the CONST_D3DRMSAVEFLAGS enumerated type describing the save options.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Sets the vectors that define a coordinate space by which the Direct3DRMFrame3.SetOrientation vectors are transformed.
Syntax
object.SetAxes(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 Direct3DRMFrame3 object.
- 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).
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
This method helps support both left-handed and right-handed coordinate systems. This method also enables you to specify that the negative z-axis represents the front of the object.
The Direct3DRMFrame3.SetOrientation direction (dx, dy, dz) and up (ux, uy, uz) vectors are transformed according to the value of the SetAxes vectors.
The axes are inherited by child frames as specified in Direct3DRMFrame3.SetInheritAxes.
See Also
Sets the box to be used in bounding-box testing. For the bounding box to be valid, its minimum x-coordinate must be less than or equal to its maximum x-coordinate, its minimum y-coordinate must be less than or equal to its maximum y-coordinate, and its minimum z-coordinate must be less than or equal to its maximum z-coordinate.
Syntax
object.SetBox(box As D3DRMBOX)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- box
- D3DRMBOX type that contains the bounding-box coordinates.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
This method supports a bounding box on a frame for hierarchical culling. For a bounding box to be enabled, the Direct3DRMFrame3.SetBoxEnable method must be used to set the enable flag to D_TRUE. By default, the box-enable flag is D_FALSE.
See Also
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
object.SetBoxEnable(boxEnable As CONST_DBOOLFLAGS)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- boxEnable
- Flag specifying whether bounding boxes are enabled. Specify D_TRUE to enable a bounding box or D_FALSE to disable a bounding box. Default is D_FALSE.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
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 the viewing frustum, none of the visuals in the frame, or in any child frame, are rendered. Otherwise, rendering continues as usual.
Enabling bounding-box testing with a box of {0, 0, 0, 0} completely prevents a frame from being rendered.
See Also
Direct3DRMFrame3.GetBoxEnable, Direct3DRMFrame3.GetBox, Direct3DRMFrame3.SetBox
Sets the color of the frame. This color is used for meshes in the frame when the CONST_D3DRMMATERIALMODE enumerated type is set to D3DRMMATERIAL_FROMFRAME.
Syntax
object.SetColor(c As Long)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 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.
See Also
Sets the color of the frame. This color is used for meshes in the frame when the CONST_D3DRMMATERIALMODE enumerated type is set to D3DRMMATERIAL_FROMFRAME.
Syntax
object.SetColorRGB(r As Single, g As Single, b As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 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.
See Also
Specifies whether the axes for the frame are inherited from the parent frame.
Syntax
object.SetInheritAxes(inheritFromParent As CONST_DBOOLFLAGS)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- inheritFromParent
- Indicates whether the frame should inherit axes from its parent. If set to D_TRUE, the frame inherits axes (the default). If set to D_FALSE, the frame does not inherit axes.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error 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
Direct3DRMFrame3.GetInheritAxes, Direct3DRMFrame3.GetAxes, Direct3DRMFrame3.SetAxes
Sets the material of the Direct3DRMFrame3 object.
Syntax
object.SetMaterial(mat As Direct3DRMMaterial2)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- mat
- Direct3DRMMaterial object that will be applied to the frame.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
See Also
Sets the material mode for a frame. The material mode determines the source of material information for visuals rendered with the frame.
Syntax
object.SetMaterialMode(val As CONST_D3DRMMATERIALMODE)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- val
- One of the members of the CONST_D3DRMMATERIALMODE enumerated type, describing the source of material information for visuals rendered with a frame.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
See Also
Enables you to set specific material attributes. For example, this method enables you to override only the emissive property of materials.
Syntax
object.SetMaterialOverride(override As D3DRMMATERIALOVERRIDE)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- override
- D3DRMMATERIALOVERRIDE type that describes the properties to override.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
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.
See Also
Sets the current per-attribute override settings for material attributes.
Syntax
object.SetMaterialOverrideTexture(tex As Direct3DRMTexture3)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- tex
- Direct3DRMTexture3 interface to be set as the override texture.
Error Values
If this method fails, it can return DDERR_INVALIDOBJECT or DDERR_INVALIDPARAMS.
For a complete list of possible errors, see Direct3D Retained Mode Error Values.
See Also
Aligns a frame so that its z-direction points along the direction vector [dx, dy, dz] and its y-direction aligns with the vector [ux, uy, uz].
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 Direct3DRMFrame3 object.
- reference
- Variable that represents the Direct3DRMFrame 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].
This method is also used to add an orientation key to a Direct3DRMFrameInterpolator object.
See Also
Sets the position of a frame relative to the frame of reference. It places the frame a distance of [x, y, z] from the reference. When a child frame is created within a parent, it is placed at [0, 0, 0] in the parent frame.
Syntax
object.SetPosition(reference As Direct3DRMFrame3, x As Single, y As Single, z As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- reference
- Variable that represents the Direct3DRMFrame 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.
Remarks
This method is also used to add a position key to a Direct3DRMFrameInterpolator object.
See Also
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 Direct3DRMFrame3 object.
- reference
- Variable that represents the Direct3DRMFrame 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
.The SetQuaternion method is supported by interpolators.
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 Direct3DRMFrame3 object.
- reference
- Variable that represents the Direct3DRMFrame 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, unlike the Direct3DRMFrame3.AddRotation method, which changes the objects in the frame only once.
See Also
Sets the background color of a scene.
Syntax
object.SetSceneBackground(c As Long)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- c
- New color for the background.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
This method is also used to add a background color key to a Direct3DRMFrameInterpolator object.
Specifies a background-depth buffer for a scene.
Syntax
object.SetSceneBackgroundDepth(s As DirectDrawSurface4)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- s
- Microsoft DirectDraw® surface that will store the new background depth for the scene.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error 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
Specifies a background image for a scene.
Syntax
object.SetSceneBackgroundImage(i As Direct3DRMTexture3)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- i
- Direct3DRMTexture3 object that will contain the new background scene.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
If the image is a different size or color depth than the viewport, the image will first be scaled or converted to the correct depth. For best performance when animating the background, the image should be the same size and color depth. This enables the background to be rendered directly from the image memory without incurring any extra overhead.
Sets the background color of a scene.
Syntax
object.SetSceneBackgroundRGB(r As Single, g As Single, b As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- r, g, b
- New color for the background. 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.
Remarks
This method is also used to add a background RGB color key to a Direct3DRMFrameInterpolator object.
Sets the fog color of a scene.
Syntax
object.SetSceneFogColor(c As Long)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- c
- New color for the fog.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
This method is also used to add a fog color key to a Direct3DRMRFrameInterpolator object.
Sets the fog-enable state.
Syntax
object.SetSceneFogEnable(enable As CONST_DBOOLFLAGS)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- enable
- New fog-enable state. Set this parameter to D_FALSE to disable fog-enable state and to D_TRUE to enable fog-enable state.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Specifies whether fogging will be performed by means of vertex fog or table fog.
Syntax
object.SetSceneFogMethod(enable As CONST_D3DRMFOGMETHOD)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- enable
- Value indicating how fogging will be implemented. A value from the CONST_D3DRMFOGMETHOD enumerated type.
Error Values
If an error occurs, this method can return one of the following values.
For a complete list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
The default behavior for Direct3DRMFrame3 objects created by the Direct3DRM3 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.
Sets the fog mode.
Syntax
object.SetSceneFogMode(c As CONST_D3DRMFOGMODE)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- c
- One of the members of the CONST_D3DRMFOGMODE enumerated type, specifying the new fog mode.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
See Also
Sets the fog start point, end point, and density for the scene.
Syntax
object.SetSceneFogParams(start As Single, End As Single, density As Single)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 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.
Remarks
This method is also used to add a fog parameters key to a Direct3DRMRFrameInterpolator object.
See Also
Sets the sorting mode used to process child frames. You can use this method to change the properties of hidden-surface-removal algorithms.
Syntax
object.SetSortMode(val As CONST_D3DRMSORTMODE)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- val
- One of the members of the CONST_D3DRMSORTMODE enumerated type, specifying the sorting mode. The default value is D3DRMSORT_FROMPARENT.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
See Also
Sets the texture of the frame.
Syntax
object.SetTexture(t As Direct3DRMTexture3)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- t
- Direct3DRMTexture3 object to be used.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
Remarks
The texture is used for meshes in the frame when the CONST_D3DRMMATERIALMODE enumerated type is D3DRMMATERIAL_FROMFRAME. To disable the frame's texture, use a NOTHING texture.
See Also
Direct3DRMFrame3.GetTexture, Direct3DRMFrame3.SetMaterialMode
Specifies whether this frame is traversed during rendering and picking.
Syntax
object.SetTraversalOptions(flags As CONST_D3DRMTRAVERALFLAGS)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- flags
- One or more values from the CONST_D3DRMTRAVERALFLAGS enumerated type, indicating whether this frame is renderable and pickable. Using this method without a value of D3DRMFRAME_RENDERENABLE effectively switches the frame off for rendering. By default, the frame is enabled for rendering and picking.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
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 Direct3DRMFrame3 object.
- reference
- Direct3DRMFrame 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.
See Also
Sets whether z-buffering is enabled or disabled.
Syntax
object.SetZbufferMode(val As CONST_D3DRMZBUFFERMODE)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- val
- One of the members of the CONST_D3DRMZBUFFERMODE enumerated type, specifying the z-buffer mode. The default value is D3DRMZBUFFER_FROMPARENT.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
See Also
Transforms the given vector and returns the result.
Syntax
object.Transform(d As D3DVECTOR, s As D3DVECTOR)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- d
- D3DVECTOR type that will be filled with the result of the transformation operation.
- s
- D3DVECTOR type that is the source of the transformation operation.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
See Also
Transforms an array of vectors from model- to world-space.
Syntax
object.TransformVectors(reference As DIRECT3DRMFrame3, num As Long, DstVectors() As D3DVECTOR, SrcVectors() As D3DVECTOR)
Parts
- object
- Object expression that resolves to a Direct3DRMFrame3 object.
- reference
- Frame that will be used as the root of the scene for the purposes of this call. If this argument is NOTHING, the current root frame (as would be returned by the Direct3DRMFrame3.GetScene method) will be used.
- num
- Number of vectors to be transformed.
- DstVectors()
- Destination of the transformation.
- SrcVectors()
- Array of vectors to transform.
Error Values
For a list of possible errors, see Direct3D Retained Mode Error Values.
See Also
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.