Hullo all
I'm hoping somebody out there can help me out with this.
I'm messing around with DirectX and I've managed to Create/Display triangles. Well, one triangle for now. To add coordinates for another Triangle, here's what my code looked like:
Code:
MyVertex AllVertices[]=
{
//TRIANGLE 1
{-0.5f, 0.5f, 0.0f, 0.0f, 0.0f},
{ 0.5f, 0.0f, 0.0f, 1.0f, 0.5f},
{-0.5f, -0.5f, 0.0f, 0.0f, 1.0f},
//TRIANGLE 2
{-0.5f, 0.5f, 0.0f, 0.0f, 0.0f},
{ 0.5f, 0.0f, 0.0f, 1.0f, 0.5f},
{-0.5f, -0.5f, 0.0f, 0.0f, 1.0f},
};
And I'm pretty confident that this is the correct way. I'm using one Vertex Buffer for all of my triangles. The code above was close to what I wanted, but, I was hoping to get my second triangle slightly bigger than my first one. So, I changed the code above and made it:
//TRIANGLE 2
{-0.7f, 0.7f, 0.0f, 0.0f, 0.0f},
{ 0.7f, 0.0f, 0.0f, 1.0f, 0.5f},
{-0.7f, -0.7f, 0.0f, 0.0f, 1.0f},
For the Second Triangle.
I realize that the two triangles are overlapping, but that's not what's concerning me (I don't think). What happens is, by making the next 3 set of vertices "larger", my scene is rendered differently.
Keeping everything else the same, and just that small adjustment to sizes, my first triangle, which has been rendering properly until now, is all of a sudden bigger. My render call for the first triangle is:
D3DDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 3);
So, as you can see, I'm not touching the last set of coordinates. Yet, everything seems zoomed in.
I was hoping somebody out there with experience in DirectX8 has come across this and solved it before Or atleast come across it.
Thanks for any input
Edit: Title wasn't the best one