I have been following directxtutorial.com and i am working on drawing multiple shapes at once and i can get it to work it is just that i dont understand why it works the first way and not the second
D3DXMatrixTranslation(&TranslationMatrix, 8.0f, 0.0f, 0.0f); //draws a simple triangle or trianglelist model.Triangle(d3ddev, vBuffer, Tcolor); d3ddev->SetTransform(D3DTS_WORLD, &(TranslationMatrix)); model.draw(d3ddev); D3DXMatrixTranslation(&TranslationMatrix, 0.0f, 0.0f, 0.0f); //draws a simple quad or trianglestrip model.Quad(d3ddev, vBuffer, Qcolor); d3ddev->SetTransform(D3DTS_WORLD, &(TranslationMatrix)); model.draw(d3ddev);
this way works fine and all that the functions are exactly what you would except they just have a array of vertices and the draw one just uses d3dd3v->drawprimitve().
D3DXMatrixTranslation(&TranslationMatrix, 0.0f, 0.0f, 0.0f); //draws a simple quad or trianglestrip model.Quad(d3ddev, vBuffer, Qcolor); d3ddev->SetTransform(D3DTS_WORLD, &(TranslationMatrix)); model.draw(d3ddev);D3DXMatrixTranslation(&TranslationMatrix, 8.0f, 0.0f, 0.0f); //draws a simple triangle or trianglelist model.Triangle(d3ddev, vBuffer, Tcolor); d3ddev->SetTransform(D3DTS_WORLD, &(TranslationMatrix)); model.draw(d3ddev);
but this does not work and it glitches everywhere