Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Difference between indexbuffer and trianglestrip???

This topic is 5925 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guest Anonymous Poster
An idex buffer holds the indicies of the verticies in a vertex buffer that you want to be drawn (and in which order to be drawn).

A Triangle strip is a way of drawing verticies (indexed or otherwise). Samething for triangle fans, point lists, line strips, and trianges. they are just a way of rendering the data.


Share this post

Link to post
Share on other sites
Triangle strips and index buffers both use a list of vertices: With triangle strips, the first three vertices define the first triangle, and every vertex after that is combined with the two preceding vertices to make a new triangle. As a result, all triangles are connected to each other in a long strip.

index buffers, however, define which vertices in each list to use per triangle. If we take a cube, for instance, you''d have a list of eight vertices (one for each corner of the cube):

0 - Vertex 1
1 - Vertex 2
2 - Vertex 3
3 - Vertex 4
4 - Vertex 5
5 - Vertex 6
6 - Vertex 7
7 - Vertex 8

And then a list of indices, three per triangle. So for instance 0 1 2 0 3 1 4 5 6 4 7 5 would draw four triangles: the first at vertices 0, 1 and 2, The second at 0, 3, and 1, the third at 4, 5 and 6, and the last at 4, 7 and 5.

As you can see, the triangles do not necessarily need to be connected to each other, as opposed to triangle strips.

See DirectX Graphics -> Programmer''s Guide -> Using Direct3D -> Vertex Data -> Device Supported Primitive Types for an explanation of triangle strips and fans, and DirectX Graphics -> Programmer''s Guide -> Advanced Topics -> Object Geometry -> Index Buffers for an explanation of Index Buffers.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!