Hey everyone, sorry to bog this forum down with this newb posting, but I really don't understand these matrix functions. First off, I created a cube with the vertex buffer, no problems there. Then I moved the cube with the following code in the render function
D3DXMATRIX matTranslate, matFinal;
D3DXMatrixIdentity(&matFinal);
D3DXMatrixTranslation(&matTranslate, 0.0f, 0.0f, 0.0f);
D3DXMatrixMultiply(&matFinal, &matFinal, &matTranslate);
pd3dDevice->SetTransform(D3DTS_WORLD, &matFinal);
How does the cube know that you're telling it to move? All I see is functions that calculate matrix values. I don't see any movment assigned to the actual cube. Here's the complete render code below.
// Clear the backbuffer to a black color
pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(255,255,255), 1.0f, 0 );
pd3dDevice->BeginScene();
D3DXMATRIX matTranslate, matFinal;
D3DXMatrixIdentity(&matFinal);
D3DXMatrixTranslation(&matTranslate, 0.0f, 0.0f, 0.0f);
D3DXMatrixMultiply(&matFinal, &matFinal, &matTranslate);
pd3dDevice->SetTransform(D3DTS_WORLD, &matFinal);
pd3dDevice->SetStreamSource( 0, vertexBuffer, 0, sizeof(CUSTOMVERTEX) );
pd3dDevice->SetFVF( D3DFVF_CUSTOMVERTEX );
pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 2 );
pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 4, 2 );
pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 8, 2 );
pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 12, 2 );
pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 16, 2 );
pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 20, 2 );
pd3dDevice->EndScene();
// Present the backbuffer contents to the display
pd3dDevice->Present( NULL, NULL, NULL, NULL );
Again, sorry and thanks for the help in advance.