The IDirect3DRMFrame2 interface is an extension of the IDirect3DRMFrame interface. IDirect3DRMFrame2 has additional methods that enable using materials, bounding boxes, and axes with frames. IDirect3DRMFrame2 also has a IDirect3DRMFrame2::RayPick method to calculate the intersections of visuals in the frame with a ray of specified position and direction. In addition, IDirect3DRMFrame2 has one changed method IDirect3DRMFrame2::AddMoveCallback2.
For a conceptual overview, see IDirect3DRMFrame, IDirect3DRMFrame2, and IDirect3DRMFrameArray Interfaces.
The methods of the IDirect3DRMFrame2 interface can be organized into the following groups:
The IDirect3DRMFrame2 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, the IDirect3DRMFrame2 interface inherits the following methods from the IDirect3DRMObject interface:
| AddDestroyCallback |
| Clone |
| DeleteDestroyCallback |
| GetAppData |
| GetClassName |
| GetName |
| SetAppData |
| SetName |
The Direct3DRMFrame2 object is obtained by using the IDirect3DRM2::CreateFrame method.
Adds a child frame to a frame hierarchy.
HRESULT AddChild(
LPDIRECT3DRMFRAME lpD3DRMFrameChild
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
If the frame being added as a child already has a parent, this method removes it from its previous parent before adding it to the new parent.
To preserve an object's transformation, use the IDirect3DRMFrame2::GetTransform method to retrieve the object's transformation before using the AddChild method. Then reapply the transformation after the frame is added.
Adds a light to a frame.
HRESULT AddLight(
LPDIRECT3DRMLIGHT lpD3DRMLight
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Adds a callback function for special movement processing. The callback is called when the frame is moved or updated.
HRESULT AddMoveCallback2(
D3DRMFRAME2MOVECALLBACK d3drmFMC,
VOID * lpArg,
DWORD dwFlags
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Multiple callbacks on an individual frame are used in the order that the callbacks were created.
IDirect3DRMFrame2::Move, IDirect3DRMFrame2::DeleteMoveCallback
Adds a rotation about (rvX, rvY, rvZ) by the number of radians specified in rvTheta.
HRESULT AddRotation(
D3DRMCOMBINETYPE rctCombine,
D3DVALUE rvX,
D3DVALUE rvY,
D3DVALUE rvZ,
D3DVALUE rvTheta
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
The specified rotation changes the matrix only for the frame identified by this IDirect3DRMFrame2 interface. This method changes the objects in the frame only once, unlike IDirect3DRMFrame2::SetRotation, which changes the matrix with every render tick.
3-D Transformations, IDirect3DRMFrame2::SetRotation
Scales a frame's local transformation by (rvX, rvY, rvZ).
HRESULT AddScale(
D3DRMCOMBINETYPE rctCombine,
D3DVALUE rvX,
D3DVALUE rvY,
D3DVALUE rvZ
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
The specified transformation only changes the matrix for the frame identified by the IDirect3DRMFrame2 interface.
Transforms the local coordinates of the frame by the affine transformation specified by rctCombine and rmMatrix.
HRESULT AddTransform(
D3DRMCOMBINETYPE rctCombine,
D3DRMMATRIX4D rmMatrix
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Although a 4×4 matrix is given, the last column must be the transpose of [0 0 0 1] for the transformation to be affine.
The specified transformation changes the matrix only for the frame identified by this IDirect3DRMFrame2 interface.
Adds a translation by (rvX, rvY, rvZ) to a frame's local coordinate system.
HRESULT AddTranslation(
D3DRMCOMBINETYPE rctCombine,
D3DVALUE rvX,
D3DVALUE rvY,
D3DVALUE rvZ
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
The specified translation changes the matrix only for the frame identified by this IDirect3DRMFrame2 interface.
Adds a visual object to a frame.
HRESULT AddVisual(
LPDIRECT3DRMVISUAL lpD3DRMVisual
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Visual objects include meshes and textures. When a visual object is added to a frame, it becomes visible if the frame is in view. The frame references the visual object.
Removes a frame from the hierarchy. If the frame is not referenced, it is destroyed along with any child frames, lights, and meshes.
HRESULT DeleteChild(
LPDIRECT3DRMFRAME lpChild
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Removes a light from a frame, destroying the light if it is no longer referenced. When a light is removed from a frame, the light no longer affects meshes in the scene its frame was in.
HRESULT DeleteLight(
LPDIRECT3DRMLIGHT lpD3DRMLight
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Removes a frame-move callback function previously added with AddMoveCallback.
HRESULT DeleteMoveCallback(
D3DRMFRAMEMOVECALLBACK d3drmFMC,
VOID * lpArg
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::AddMoveCallback2, IDirect3DRMFrame2::Move
Removes a visual object from a frame, destroying it if it is no longer referenced.
HRESULT DeleteVisual(
LPDIRECT3DRMVISUAL lpD3DRMVisual
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the vectors that are aligned with the direction (rvDx, rvDy, rvDz) and up (rvUx, rvUy, rvUz) vectors supplied to the IDirect3DRMFrame2::SetOrientation method.
HRESULT GetAxes(
LPD3DVECTOR dir,
LPD3DVECTOR up
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method along with IDirect3DRMFrame2::SetAxes helps support both left-handed and right-handed coordinate systems. SetAxes allows you to specify that the negative z-axis represents the front of the object.
IDirect3DRMFrame2::SetAxes, IDirect3DRMFrame2::GetInheritAxes, IDirect3DRMFrame2::SetInheritAxes
Retrieves the bounding box containing a DIRECT3DRMFRAME2 object. The bounding box gives the minimum and maximum model coordinates in each dimension.
HRESULT GetBox(
D3DRMBOX * lpD3DRMBox
);
Returns D3DRM_OK if successful, or an error otherwise. Returns D3DRMERR_BOXNOTSET unless a valid bounding box has already been set on the frame. For a list of other possible return codes, see Direct3D Retained Mode Return Values.
This method supports a bounding box on a frame for hierarchical culling. A valid bounding box must be set on the frame with IDirect3DRMFrame2::SetBox. For a bounding box to be enabled, the IDirect3DRMFrame2::SetBoxEnable method must be used to set the enable flag to TRUE. By default, the box-enable flag is FALSE. There is no default bounding box.
IDirect3DRMFrame2::SetBox, IDirect3DRMFrame2::SetBoxEnable, IDirect3DRMFrame2::GetBoxEnable
Retrieves the flag that determines whether a bounding box is enabled for this Direct3DRMFrame2 object.
BOOL GetBoxEnable( );
Returns TRUE if a bounding box is enabled, or FALSE if it is not enabled.
For a bounding box to be enabled, the IDirect3DRMFrame2::SetBoxEnable flag must be used to set the enable flag to TRUE. By default, the box enable flag is FALSE.
IDirect3DRMFrame2::SetBoxEnable IDirect3DRMFrame2::GetBox, IDirect3DRMFrame2::SetBox
Retrieves a list of child frames in the form of a Direct3DRMFrameArray object.
HRESULT GetChildren(
LPDIRECT3DRMFRAMEARRAY* lplpChildren
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
DIRECT3DRMFRAMEARRAY, Hierarchies
Retrieves the color of the frame.
D3DCOLOR GetColor( );
Returns the color of the Direct3DRMFrame2 object.
Calculates a bounding box to contain all the geometry in the hierarchy rooted in this Direct3DRMFrame2 object.
HRESULT GetHierarchyBox(
D3DRMBOX * lpD3DRMBox
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::GetBox, IDirect3DRMFrame2::SetBox, IDirect3DRMFrame2::SetBoxEnable, IDirect3DRMFrame2::GetBoxEnable
Retrieves the flag that indicates whether the axes for the frame are inherited from the parent frame.
BOOL GetInheritAxes( );
Returns TRUE if the frame inherits axes (the default) and FALSE if the frame does not inherit axes.
By default, the axes are inherited from the parent. If a frame is set to inherit from a 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 and the IDirect3DRMFrame2::SetInheritAxes method allow a single policy for axes to be set at the root of the hierarchy.
IDirect3DRMFrame2::SetInheritAxes, IDirect3DRMFrame2::GetAxes, IDirect3DRMFrame2::SetAxes
Retrieves a list of lights in the frame in the form of a Direct3DRMLightArray object.
HRESULT GetLights(
LPDIRECT3DRMLIGHTARRAY* lplpLights
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the material of the Direct3DRMFrame2 object.
HRESULT GetMaterial(
LPDIRECT3DRMMATERIAL *lplpMaterial
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::SetMaterial
Retrieves the material mode of the frame.
D3DRMMATERIALMODE GetMaterialMode( );
Returns a member of the D3DRMMATERIALMODE enumerated type that specifies the current material mode.
IDirect3DRMFrame2::SetMaterialMode
Retrieves the orientation of a frame relative to the given reference frame.
HRESULT GetOrientation(
LPDIRECT3DRMFRAME lpRef,
LPD3DVECTOR lprvDir,
LPD3DVECTOR lprvUp
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::SetOrientation
Retrieves the parent frame of the current frame.
HRESULT GetParent(
LPDIRECT3DRMRAME * lplpParent
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the position of a frame relative to the given reference frame, that is, it retrieves the distance of the frame from the reference. The distance is stored in the lprvPos parameter as a vector rather than as a linear measure.
HRESULT GetPosition(
LPDIRECT3DRMFRAME lpRef,
LPD3DVECTOR lprvPos
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::SetPosition
Retrieves the rotation of the frame relative to the given reference frame.
HRESULT GetRotation(
LPDIRECT3DRMFRAME lpRef,
LPD3DVECTOR lprvAxis,
LPD3DVALUE lprvTheta
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::SetRotation, Transformations
Retrieves the root frame of the hierarchy containing the given frame.
HRESULT GetScene(
LPDIRECT3DRMFRAME lplpRoot
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the background color of a scene.
D3DCOLOR GetSceneBackground( );
Returns the color.
Retrieves the current background-depth buffer for the scene.
HRESULT GetSceneBackgroundDepth(
LPDIRECTDRAWSURFACE * lplpDDSurface
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::SetSceneBackgroundDepth
Retrieves the fog color of a scene.
D3DCOLOR GetSceneFogColor( );
Returns the fog color.
Retrieves whether fog is currently enabled for this scene.
BOOL GetSceneFogEnable( );
Returns TRUE if fog is enabled, and FALSE otherwise.
Retrieves the current fog mode for this scene.
D3DRMFOGMODE GetSceneFogMode( );
Returns a member of the D3DRMFOGMODE enumerated type that specifies the current fog mode.
Retrieves the current fog parameters for this scene.
HRESULT GetSceneFogParams(
D3DVALUE * lprvStart,
D3DVALUE * lprvEnd,
D3DVALUE * lprvDensity
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the sorting mode used to process child frames.
D3DRMSORTMODE GetSortMode( );
Returns the member of the D3DRMSORTMODE enumerated type that specifies the sorting mode.
IDirect3DRMFrame2::SetSortMode
Retrieves the texture of the given frame.
HRESULT GetTexture(
LPDIRECT3DRMTEXTURE* lplpTexture
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the topological properties of a texture when mapped onto objects in the given frame.
HRESULT GetTextureTopology(
BOOL * lpbWrap_u,
BOOL * lpbWrap_v
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::SetTextureTopology
Retrieves the local transformation of the frame as a 4×4 affine matrix.
HRESULT GetTransform(
D3DRMMATRIX4D rmMatrix
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the velocity of the frame relative to the given reference frame. Velocity is specified as units per tick. See IDirect3DRM::Tick for more information.
HRESULT GetVelocity(
LPDIRECT3DRMFRAME lpRef,
LPD3DVECTOR lprvVel,
BOOL fRotVel
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::SetVelocity
Retrieves a list of visuals in the frame.
HRESULT GetVisuals(
LPDIRECT3DRMVISUALARRAY* lplpVisuals
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the z-buffer mode; that is, whether z-buffering is enabled or disabled.
D3DRMZBUFFERMODE GetZbufferMode( );
Returns one of the members of the D3DRMZBUFFERMODE enumerated type.
IDirect3DRMFrame2::SetZbufferMode
Transforms the vector in the lprvSrc parameter in world coordinates to model coordinates, and returns the result in the lprvDst parameter.
HRESULT InverseTransform(
D3DVECTOR *lprvDst,
D3DVECTOR *lprvSrc
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::Transform, 3-D Transformations
Loads a Direct3DRMFrame2 object.
HRESULT Load(
LPVOID lpvObjSource,
LPVOID lpvObjID,
D3DRMLOADOPTIONS d3drmLOFlags,
D3DRMLOADTEXTURECALLBACK d3drmLoadTextureProc,
LPVOID lpArgLTP
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
By default, this method loads the first frame hierarchy in the file specified by the lpvObjSource parameter. The frame that uses this method is used as the parent of the new frame hierarchy.
Faces the frame toward the target frame, relative to the given reference frame, locking the rotation by the given constraints.
HRESULT LookAt(
LPDIRECT3DRMFRAME lpTarget,
LPDIRECT3DRMFRAME lpRef,
D3DRMFRAMECONSTRAINT rfcConstraint
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Applies the linear and rotational velocities for all frames in the given hierarchy.
HRESULT Move(
D3DVALUE delta
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Searches the hierarchy starting at this Direct3DRMFrame2 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.
HRESULT RayPick(
LPDIRECT3DRMFRAME lpRefFrame,
LPD3DRMRAY ray,
DWORD dwFlags,
LPD3DRMPICKED2ARRAY* lplpPicked2Array
);
If you specify D3DRMRAYPICK_ONLYBOUNDINGBOXES, the texture, normal, and color data in the D3DRMPICKDESC2 structure will be invalid.
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
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.
Saves a Direct3DRMFrame2 object to the specified file.
HRESULT Save(
LPCSTR lpFilename,
D3DRMXOFFORMAT d3dFormat,
D3DRMSAVEOPTIONS d3dSaveFlags
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Sets the vectors that define a coordinate space by which the IDirect3DRMFrame2::SetOrientation vectors are transformed.
HRESULT SetAxes(
D3DVALUE dx,
D3DVALUE dy,
D3DVALUE dz,
D3DVALUE ux,
D3DVALUE uy,
D3DVALUE uz
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
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 IDirect3DRMFrame2::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 IDirect3DRMFrame2::SetInheritAxes.
IDirect3DRMFrame2::GetAxes, IDirect3DRMFrame2::GetInheritAxes, IDirect3DRMFrame2::SetInheritAxes
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.
HRESULT SetBox(
D3DRMBOX * lpD3DRMBox
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method supports a bounding box on a frame for hierarchical culling. For a bounding box to be enabled, the IDirect3DRMFrame2::SetBoxEnable method must be used to set the enable flag to TRUE. By default, the box-enable flag is FALSE.
IDirect3DRMFrame2::GetBox, IDirect3DRMFrame2::SetBoxEnable, IDirect3DRMFrame2::GetBoxEnable
Enables or disables bounding-box testing for this Direct3DRMFrame2 object. Bounding-box testing cannot be enabled unless a valid bounding box has already been set on the frame.
HRESULT SetBoxEnable(
BOOL bEnableFlag
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
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.
IDirect3DRMFrame2::GetBoxEnable, IDirect3DRMFrame2::GetBox, IDirect3DRMFrame2::SetBox
Sets the color of the frame. This color is used for meshes in the frame when the D3DRMMATERIALMODE enumerated type is D3DRMMATERIAL_FROMFRAME.
HRESULT SetColor(
D3DCOLOR rcColor
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method is also used to add a color key to a DIRECT3DRMFRAMEINTERPOLATOR object.
IDirect3DRMFrame2::GetColor, IDirect3DRMFrame2::SetMaterialMode
Sets the color of the frame. This color is used for meshes in the frame when the D3DRMMATERIALMODE enumerated type is D3DRMMATERIAL_FROMFRAME.
HRESULT SetColorRGB(
D3DVALUE rvRed,
D3DVALUE rvGreen,
D3DVALUE rvBlue
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method is also used to add an RGB color key to a DIRECT3DRMFRAMEINTERPOLATOR object.
IDirect3DRMFrame2::SetMaterialMode
Specifies whether the axes for the frame are inherited from the parent frame.
HRESULT SetInheritAxes(
BOOL inherit_from_parent
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
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.
IDirect3DRMFrame2::GetInheritAxes, IDirect3DRMFrame2::GetAxes, IDirect3DRMFrame2::SetAxes
Sets the material of the Direct3DRMFrame2 object.
HRESULT SetMaterial(
LPDIRECT3DRMMATERIAL *lplpMaterial
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::GetMaterial
Sets the material mode for a frame. The material mode determines the source of material information for visuals rendered with the frame.
HRESULT SetMaterialMode(
D3DRMMATERIALMODE rmmMode
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::GetMaterialMode
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].
HRESULT SetOrientation(
LPDIRECT3DRMFRAME lpRef,
D3DVALUE rvDx,
D3DVALUE rvDy,
D3DVALUE rvDz,
D3DVALUE rvUx,
D3DVALUE rvUy,
D3DVALUE rvUz
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
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.
IDirect3DRMFrame2::GetOrientation
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.
HRESULT SetPosition(
LPDIRECT3DRMFRAME lpRef,
D3DVALUE rvX,
D3DVALUE rvY,
D3DVALUE rvZ
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method is also used to add a position key to a Direct3DRMFrameInterpolator object.
IDirect3DRMFrame2::GetPosition
Sets a frame's orientation relative to a reference frame using a unit quaternion.
HRESULT SetQuaternion(
LPDIRECT3DRMFRAME2 lpRef,
D3DRMQUATERNION *quat
)
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
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 IDirect3DRMInterpolator Interface for more information about interpolators.
Sets a frame rotating by the given angle around the given vector at each call to the IDirect3DRM::Tick or IDirect3DRMFrame2::Move method. The direction vector [rvX, rvY, rvZ] is defined in the reference frame.
HRESULT SetRotation(
LPDIRECT3DRMFRAME lpRef,
D3DVALUE rvX,
D3DVALUE rvY,
D3DVALUE rvZ,
D3DVALUE rvTheta
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
The specified rotation changes the matrix with every render tick, unlike the IDirect3DRMFrame2::AddRotation method, which changes the objects in the frame only once.
IDirect3DRMFrame2::AddRotation, IDirect3DRMFrame2::GetRotation
Sets the background color of a scene.
HRESULT SetSceneBackground(
D3DCOLOR rcColor
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method is also used to add a background color key to a Direct3DRMFrameInterpolator object.
Specifies a background-depth buffer for a scene.
HRESULT SetSceneBackgroundDepth(
LPDIRECTDRAWSURFACE lpImage
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
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.
IDirect3DRMFrame2::GetSceneBackgroundDepth
Specifies a background image for a scene.
HRESULT SetSceneBackgroundImage(
LPDIRECT3DRMTEXTURE lpTexture
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
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.
HRESULT SetSceneBackgroundRGB(
D3DVALUE rvRed,
D3DVALUE rvGreen,
D3DVALUE rvBlue
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method is also used to add a background RGB color key to a Direct3DRMFrameInterpolator object.
Sets the fog color of a scene.
HRESULT SetSceneFogColor(
D3DCOLOR rcColor
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method is also used to add a fog color key to a Direct3DRMRFrameInterpolator object.
Sets the fog-enable state.
HRESULT SetSceneFogEnable(
BOOL bEnable
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Sets the fog mode.
HRESULT SetSceneFogMode(
D3DRMFOGMODE rfMode
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::SetSceneFogParams
Sets the current fog parameters for this scene.
HRESULT SetSceneFogParams(
D3DVALUE rvStart,
D3DVALUE rvEnd,
D3DVALUE rvDensity
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
This method is also used to add a fog parameters key to a Direct3DRMRFrameInterpolator object.
D3DRMFOGMODE, IDirect3DRMFrame2::SetSceneFogMode
Sets the sorting mode used to process child frames. You can use this method to change the properties of hidden-surface-removal algorithms.
HRESULT SetSortMode(
D3DRMSORTMODE d3drmSM
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::GetSortMode
Sets the texture of the frame.
HRESULT SetTexture(
LPDIRECT3DRMTEXTURE lpD3DRMTexture
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
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.
IDirect3DRMFrame2::GetTexture, IDirect3DRMFrame2::SetMaterialMode
Defines the topological properties of the texture coordinates across objects in the frame.
HRESULT SetTextureTopology(
BOOL bWrap_u,
BOOL bWrap_v
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::GetTextureTopology
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 IDirect3DRM::Tick or IDirect3DRMFrame2::Move method.
HRESULT SetVelocity(
LPDIRECT3DRMFRAME lpRef,
D3DVALUE rvX,
D3DVALUE rvY,
D3DVALUE rvZ,
BOOL fRotVel
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::GetVelocity
Sets the z-buffer mode; that is, whether z-buffering is enabled or disabled.
HRESULT SetZbufferMode(
D3DRMZBUFFERMODE d3drmZBM
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::GetZbufferMode
Transforms the vector in the lpd3dVSrc parameter in model coordinates to world coordinates, returning the result in the lpd3dVDst parameter.
HRESULT Transform(
D3DVECTOR *lpd3dVDst,
D3DVECTOR *lpd3dVSrc
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMFrame2::InverseTransform, 3-D Transformations
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.