Order in which primitives are drawn

Started by
0 comments, last by cozzie 7 years, 3 months ago

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

Advertisement
Where do you set the vertexbuffer? I assume those differ in example 1 and 2

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

This topic is closed to new replies.

Advertisement