   Are 3d objects with index buffers projected different then ones that arent
  When I first started directX 10, I drew out a cube. It had a vertex buffer but it did not have a index buffer. When I rendered it to the screen, it was a perfect cube. Later on, I changed my application and this time my cube had a index buffer. This time, it did not turn out to be a perfect cube. It looked more like a rectangle. And I am curious I did not change any code hardly. All I did was rewrote the cube so it could render indexed and added a index buffer to it. I am asking this question in hopes that this maybe an obvious issue that I do not know about. If this is unusual then I can provide code below and hope that might give more detail.Below is my cube without the index buffer    VertexPos vertices[] =    {// 1{ D3DXVECTOR3(-5.0f,  5.0f, 5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(-5.0f, -5.0f, 5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f,  5.0f, 5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f,  5.0f, 5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(-5.0f, -5.0f, 5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f,  -5.0f, 5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},// 2{ D3DXVECTOR3(-5.0f,  5.0f, -5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f,  5.0f, -5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(-5.0f, -5.0f, -5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(-5.0f, -5.0f, -5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f,  5.0f, -5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f,  -5.0f, -5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},// 3{ D3DXVECTOR3(-5.0f, 5.0f,  5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f, 5.0f,  5.0f),  D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(-5.0f, 5.0f, -5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(-5.0f, 5.0f, -5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f, 5.0f, 5.0f),D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f, 5.0f, -5.0f),  D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},// 4{ D3DXVECTOR3(-5.0f, -5.0f,  5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(-5.0f, -5.0f, -5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f, -5.0f,  5.0f),  D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f, -5.0f,  5.0f),  D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(-5.0f, -5.0f, -5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f, -5.0f, -5.0f),  D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},// 5{ D3DXVECTOR3(5.0f,  5.0f, -5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f,  5.0f,  5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f, -5.0f, -5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f, -5.0f, -5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f,  5.0f,  5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},{ D3DXVECTOR3(5.0f, -5.0f,  5.0f), D3DXVECTOR4(1.0f,1.0f,1.0f,1.0f)},// 6{D3DXVECTOR3(-5.0f,  5.0f, -5.0f), D3DXVECTOR4(0.1f,1.0f,1.0f,1.0f)},{D3DXVECTOR3(-5.0f, -5.0f, -5.0f), D3DXVECTOR4(0.1f,1.0f,1.0f,1.0f)},{D3DXVECTOR3(-5.0f,  5.0f,  5.0f), D3DXVECTOR4(0.1f,1.0f,1.0f,1.0f)},{D3DXVECTOR3(-5.0f,  5.0f,  5.0f), D3DXVECTOR4(0.1f,1.0f,1.0f,1.0f)},{D3DXVECTOR3(-5.0f, -5.0f, -5.0f), D3DXVECTOR4(0.1f,1.0f,1.0f,1.0f)},{D3DXVECTOR3(-5.0f, -5.0f,  5.0f), D3DXVECTOR4(0.1f,1.0f,1.0f,1.0f)},    };And below is my cube with a index buffer// Create vertex bufferVertexPos vertices[] ={// 1{ D3DXVECTOR3(-5.0f,  5.0f, -5.0f), D3DXVECTOR4(1.0f,0.0f,0.0f,0.8f)},//Top Left Front 0{ D3DXVECTOR3( 5.0f,  5.0f, -5.0f), D3DXVECTOR4(1.0f,0.2f,0.4f,0.1f)},//Top Right Front 1{ D3DXVECTOR3(-5.0f, -5.0f, -5.0f), D3DXVECTOR4(1.0f,0.0f,0.2f,0.3f)},//Bottom Left Front 2{ D3DXVECTOR3( 5.0f, -5.0f, -5.0f), D3DXVECTOR4(1.0f,0.4f,0.2f,0.4f)},//Bottom Right Front 3{ D3DXVECTOR3(-5.0f,  5.0f, 5.0f), D3DXVECTOR4(1.0f,0.0f,0.4f,0.0f)},//Top Left Back 4{ D3DXVECTOR3( 5.0f,  5.0f, 5.0f), D3DXVECTOR4(1.0f,0.3f,0.0f,0.5f)},//Top Right Back 5 { D3DXVECTOR3(-5.0f, -5.0f, 5.0f), D3DXVECTOR4(0.4f,1.0f,0.4f,0.0f)},//Bottom Left Back 6{ D3DXVECTOR3( 5.0f, -5.0f, 5.0f), D3DXVECTOR4(0.0f,1.0f,0.0f,0.5f)},//Bottom Right Back 7};DWORD indices[] ={    0, 1, 2,    // side 1    2, 1, 3,    4, 0, 6,    // side 2    6, 0, 2,    7, 5, 6,    // side 3    6, 5, 4,    3, 1, 7,    // side 4    7, 1, 5,    4, 5, 0,    // side 5    0, 5, 1,    3, 7, 2,    // side 6    2, 7, 6,};Now, I know I did not provide a whole lot of code. But I didn't really change anything. All I did was rewrite the vertex positioning, added indices, created a index buffer and changed the function from Draw() to DrawIndexed(). The difference in appearance of the cubes are that the indexed cube looks more like a rectangle. If this is not something usual, let me know and I can try to provide more information and detail.   
  Ok, So this was the issuefor(UINT i = 0; i < modelObject.numVertices; i += 3){D3DXVECTOR3 out;D3DXVECTOR3 v1 = vertices[0 + i].pos;D3DXVECTOR3 v2 = vertices[1 + i].pos;D3DXVECTOR3 v3 = vertices[2 + i].pos;D3DXVECTOR3 u = v2 - v1;D3DXVECTOR3 v = v3 - v1;D3DXVec3Cross(&out, &u, &v);D3DXVec3Normalize(&out, &out);    //When I comment out below. it works perfectvertices[0 + i].normal = out; vertices[1 + i].normal = out;vertices[2 + i].normal = out;}I am looking at the above code and I cant see how it could deform my vertices. It appears when I add values to my normals, it deforms my cube. I am searching my code at the moment looking for places where I could of alter my normals but right now i can not find it. I commented out any code in my shader that could have changed my cube based on the normals. And right now I am looking on the cpu side for the same but can not find any. if anyone has any ideas. let me know   ;  There's no reason that a cube rendered using an index buffer shouldn't look exactly the same as an equivalent cube rendered using a vertex buffer only. If the index buffer version is coming out wrong, there's probably an error in your code somewhere (e.g. incorrect winding, using the wrong parameters when setting up the buffers, etc.).[Edit: Oops- too late! :)]   ;Quote:Original post by jykThere's no reason that a cube rendered using an index buffer shouldn't look exactly the same as an equivalent cube rendered using a vertex buffer only. If the index buffer version is coming out wrong, there's probably an error in your code somewhere (e.g. incorrect winding, using the wrong parameters when setting up the buffers, etc.).[Edit: Oops- too late! :)]No, your not exactly too late. I decide to continue on with this discussion because I found out the issue, but cant figure out why it is happening. I edit my second post. take a look if you can.   ;  my guess is that since the vertices is an array, which makes it a pointer. and therefore I am passing the pointer and manipulating the values of the original space in menu. Then again I am a newb so not sure.   