Platform SDK: DirectX

ID3DXMatrixStack::Translate

The ID3DXMatrixStack::Translate method determines the product of the current matrix and the computed translation matrix determined by the given factors (x, y, and z).

HRESULT Translate(
  float x,
  float y,
  float z
); 

Parameters

x
The translation factor in the x-direction.
y
The translation factor in the y-direction.
z
The translation factor in the z-direction.

Return Values

This method returns S_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

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Version: Requires DirectX 7.0.
  Header: Declared in d3dxmath.h.
  Library: Use d3dx.lib.

See Also

ID3DXMatrixStack::TranslateLocal