IDirect3DDevice9::MultiplyTransform method (d3d9.h)

Multiplies a device's world, view, or projection matrices by a specified matrix.

Syntax

HRESULT MultiplyTransform(
  [in] D3DTRANSFORMSTATETYPE unnamedParam1,
  [in] const D3DMATRIX       *unnamedParam2
);

Parameters

[in] unnamedParam1

Type: D3DTRANSFORMSTATETYPE

Member of the D3DTRANSFORMSTATETYPE enumerated type, or the D3DTS_WORLDMATRIX macro that identifies which device matrix is to be modified. The most common setting, D3DTS_WORLDMATRIX(0), modifies the world matrix, but you can specify that the method modify the view or projection matrices, if needed.

[in] unnamedParam2

Type: const D3DMATRIX*

Pointer to a D3DMATRIX structure that modifies the current transformation.

Return value

Type: HRESULT

If the method succeeds, the return value is D3D_OK. D3DERR_INVALIDCALL if one of the arguments is invalid.

Remarks

The multiplication order is pMatrix times State.

An application might use the IDirect3DDevice9::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 the parameters are shown in this pseudocode.


IDirect3DDevice9::SetTransform(D3DTS_WORLDMATRIX(0), 
                               shoulder_transform)
IDirect3DDevice9::DrawPrimitive(upper_arm)
IDirect3DDevice9::MultiplyTransform(D3DTS_WORLDMATRIX(0), 
                                    elbow_transform)
IDirect3DDevice9::DrawPrimitive(lower_arm)
IDirect3DDevice9::MultiplyTransform(D3DTS_WORLDMATRIX(0), 
                                    wrist_transform)
IDirect3DDevice9::DrawPrimitive(hand)

Requirements

Requirement Value
Target Platform Windows
Header d3d9.h (include D3D9.h)
Library D3D9.lib

See also

D3DTS_WORLD

D3DTS_WORLDMATRIX

D3DTS_WORLDn

IDirect3DDevice9

IDirect3DDevice9::DrawPrimitive

IDirect3DDevice9::SetTransform