Skip to main content
gamedev.net
🔒 Locked

Indexed Buffer

Started by Digital Extent May 15, 2003 at 10:10 PM 0 replies 300+ views
Original Post
Digital Extent
Digital Extent
I''ve noted that when putting vertices into a Vertex Buffer you they have to be in clockwise order. However, do they have to be if you are using Index Buffer? Can''t the Index Buffer specify the vertices index in clockwise order even if the vertices in the VB is in a different order? For example, if I have the following: v3-v4- v5 | \ | \ | v0-v1- v2 They will be ordered in the VB in increasing order. That is, pVertices[0] = v0; pVertices[1] = v1; ... pVertices[5] = v5; And in the IB I will have: pIndices[0] = 0; pIndices[1] = 3; pIndices[2] = 1; pIndices[3] = 1; pIndices[4] = 3; pIndices[5] = 4; pIndices[6] = 1; pIndices[7] = 4; pIndices[8] = 2; pIndices[9] = 2; pIndices[10] = 4; pIndices[11] = 5; Doing this with DrawIndexedPrimitive as TriangleList, I can''t see anything. I''m pretty sure the projection and everything are correct.
Programming is easy, thinking is hard.
S1CA
S1CA
quote:
Can''t the Index Buffer specify the vertices index in clockwise order even if the vertices in the VB is in a different order?


Yes. With indexed primitives, the order of the INDICES determines the order that the vertices get used on the triangles so the INDICES need to be clockwise.

You can change the culling direction with D3DRS_CULLMODE.



--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.