Microsoft DirectX 8.1 (C++)

ID3DXMatrixStack::Translate

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
[in] The translation factor in the x-direction.
y
[in] The translation factor in the y-direction.
z
[in] The translation factor in the z-direction.

Return Values

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

  Header: Declared in D3dx8math.h.
  Import Library: Use D3dx8.lib.

See Also

ID3DXMatrixStack::TranslateLocal