Sign in to follow this  

Order in which primitives are drawn

Recommended Posts

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this