前田稔(Maeda Minoru)の超初心者のプログラム入門
//3D キューブ モデルを、ラジアン単位で設定された大きさだけ回転させます。 void Sample3DSceneRenderer::Rotate(float radians) { //更新されたモデル マトリックスをシェーダーに渡す準備をします XMStoreFloat4x4(&m_constantBufferData.model, XMMatrixTranspose(XMMatrixRotationY(radians))); } |
XMStoreFloat4x4(&m_constantBufferData.model, XMMatrixTranspose(XMMatrixRotationX(radians))); |
XMStoreFloat4x4(&m_constantBufferData.model, XMMatrixTranspose(XMMatrixRotationZ(radians))); |
XMFLOAT4X4 f4x4; XMStoreFloat4x4(&f4x4, XMMatrixTranspose(XMMatrixRotationY(radians))); m_constantBufferData.model = f4x4; |
XMMATRIX ry,rz,mat; XMFLOAT4X4 f4x4; ry = XMMatrixRotationY(radians); rz = XMMatrixRotationZ(radians); mat = ry * rz; XMStoreFloat4x4(&f4x4, mat); m_constantBufferData.model = f4x4; |
XMMATRIX mat; mat = XMMatrixRotationX(rx) * XMMatrixRotationY(ry) * XMMatrixRotationZ(rz); mat = XMMatrixRotationView(rx, ry, rz); |
XMFLOAT4X4 f4x4; XMMATRIX mat; mat = XMMatrixRotationView(radians, radians, 0.0f); XMStoreFloat4x4(&f4x4, mat); m_constantBufferData.model = f4x4; |