DirectX SDK

Direct3DDevice7.MultiplyTransform

The Direct3DDevice7.MultiplyTransform method multiplies a device's world, view, or projection matrices by a specified matrix. The multiplication order is matrix times dstTransformStateType.

object.MultiplyTransform( _ 
    dstTransformStateType As CONST_D3DTRANSFORMSTATETYPE, _ 
    matrix As D3DMATRIX)

Parameters

object
Object expression that resolves to a Direct3DDevice7 object.
dstTransformStateType
Identifies which device matrix is to be modified. This parameter can be any of the constants of the CONST_D3DTRANSFORMSTATETYPE enumeration. The most common setting, D3DTRANSFORMSTATE_WORLD, modifies the world matrix, but you can specify that the method modify the view or projection matrices if needed.
matrix
A D3DMATRIX type that modifies the current transformation.

Error Codes

If the method fails, an error is raised and Err.Number will be set. The method returns DDERR_INVALIDPARAMS if one of the parameters is invalid.

Remarks

An application might use the MultiplyTransform method to work with hierarchies of transformations. For example, the geometry and transformations describing an arm might be arranged in the following hierarchy:

shoulder_transformation
    upper_arm geometry
    elbow transformation
        lower_arm geometry
        wrist transformation
            hand geometry

An application might use the following series of calls to render this hierarchy. (Not all of the parameters are shown in this pseudocode.)

Direct3DDevice7.SetTransform(D3DTRANSFORMSTATE_WORLD, 
    shoulder_transform)
Direct3DDevice7.DrawPrimitive(upper_arm)
Direct3DDevice7.MultiplyTransform(D3DTRANSFORMSTATE_WORLD, 
    elbow_transform)
Direct3DDevice7.DrawPrimitive(lower_arm)
Direct3DDevice7.MultiplyTransform(D3DTRANSFORMSTATE_WORLD, 
    wrist_transform)
Direct3DDevice7.DrawPrimitive(hand)

See Also

Direct3DDevice7.DrawPrimitive, Direct3DDevice7.SetTransform