ID3DXMATRIXStack::Translate method (D3DX10.h)

Note

The D3DX10 utility library is deprecated. We recommend that you use DirectXMath instead along with this header from GitHub.

Determines the product of the current matrix and the computed translation matrix determined by the given factors (x, y, and z).

Syntax

HRESULT Translate(
  [in] FLOAT x,
  [in] FLOAT y,
  [in] FLOAT z
);

Parameters

x [in]

Type: FLOAT

The translation factor in the x-direction.

y [in]

Type: FLOAT

The translation factor in the y-direction.

z [in]

Type: FLOAT

The translation factor in the z-direction.

Return value

Type: HRESULT

If the method succeeds, the return value is D3D_OK.

Remarks

This method right-multiplies the current matrix with the computed translation matrix (transformation is about the current world origin).

D3DXMATRIX tmp;
D3DXMatrixTranslation( &tmp, x, y, z );
m_stack[m_currentPos] = m_stack[m_currentPos] * tmp;

Requirements

Requirement Value
Header
D3DX10.h
Library
D3DX10.lib

See also

ID3DXMatrixStack

D3DX Interfaces