|
在龙书代码里面有这么一段代码
bool Display(float timeDelta)
{
if( Device )
{
// Device->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00ff0000, 1.0f, 0);
// Device-> resent(0, 0, 0, 0);
D3DXMATRIX Rx, Ry;
D3DXMatrixRotationX(&Rx, 3.14f / 4.0f);
static float y = 0.0f;
D3DXMatrixRotationY(&Ry, y);
y += timeDelta;
if( y >= 6.28f )
y = 0.0f;
D3DXMATRIX p = Rx * Ry;
Device->SetTransform(D3DTS_WORLD, &p);
Device->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0);
Device->BeginScene();
Device->SetStreamSource(0, VB, 0, sizeof(Vertex));
Device->SetIndices(IB);
Device->SetFVF(Vertex::FVF);
Device->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 8, 0, 12);
Device->EndScene();
Device->Present(0, 0, 0, 0);
}
return true;
}
D3DXMATRIX p = Rx * Ry;这里两个矩阵相乘是什么意思呢?求各位大大指教 |
|