Platform SDK: DirectX

ID3DXMatrixStack::Translate

The ID3DXMatrixStack::Translate メソッドは、現在の行列と算出された平行移動行列 (指定された係数 (x、y、z) により決定される) の積を算出する。

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

パラメータ

x
x 方向の平行移動係数。
y
y 方向の平行移動係数。
z
z 方向の平行移動係数。

戻り値

S_OK を返す。

注意

このメソッドは、現在の行列に算出された平行移動行列を積算する (変換は、現在のワールド原点を中心として行われる)。

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

動作環境

  Windows NT/2000 : Windows 2000 が必要。
  Windows 95/98 : Windows 95 以上が必要。Windows 95 用に再配布可能な形で使用可能。
  バージョン : DirectX 7.0 が必要。
  ヘッダー : d3dxmath.h で宣言。
  ライブラリ : d3dx.lib を使用。

参照

ID3DXMatrixStack::TranslateLocal