• Create Account

## What the heck are Indices????

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

3 replies to this topic

### #1Esap1  Members

122
Like
Likes
Like

Posted 18 January 2000 - 02:13 PM

I just cant figure out what indices are, Im trying to implement a Vertex Buffer, and wanted to use DrawIndexedPrimitive(or something similar) but can not figure out what indiceas are! PLEASE HELP!!!! THANK YOU SOOOO MUCH!!!!

### #2shmaLbus  Members

122
Like
Likes
Like

Posted 18 January 2000 - 02:31 PM

don''t take my word as gospel since i don''t konw much d3d but that''s for drawing a primitive in a list of verticies. just use DrawPrimitive instead.
i think that''s what u were asking anyways

### #3Esap1  Members

122
Like
Likes
Like

Posted 18 January 2000 - 02:33 PM

The worlds Im using have lots of Points sharing the same spot which would increase Transform speed I believe. Thats why I want to know what they are.

122
Like
Likes
Like

Posted 19 January 2000 - 02:22 AM

In short, "indices" are an array of unsigned short ints. The value of each index is an index into the array of D3DVERTEX.

Suppose you have 4 D3DVERTEX vertices:
D3DVERTEX Verts[4]. Suppose #0 and #3 are at the same point.
If you use drawprimitive, you just pass the verts and the number of verts and it uses them all, you can''t take advantage of the fact that #0 and #3 are equivalent, it just blindly goes thru them.

If you use DrawIndexedPrimitive, you need an array of unsigned short ints, one for each vertex in your geometry:
unsigned short int indices[4];
You''d set this array up as follows:
indices[0] = 0; // Point at vertex[0]
indices[1] = 1; // point at vertex[1]
indices[2] = 2; // point at vertex[2]
indices[3] = 0; // point at vertex[0]

Now you only need to pass 3 vertices to DrawIndexedPrimitive, because only the first 3 are used. The redundant ones have been filtered out. Of course you''d use this fact when you built your Verts[] array in the first place (You wouldn''t have put point #4 in it at all). If your scene has a ton of shared vertices (to be shared they have to have the same texture and texture coordinates (tu,tv)) you''ll be able to weed out alot more vertices than just one like in this example.

-ns-

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.