Vertex Buffer and Index Buffer

Dear All,
What is difference between Vertex Buffer and Index Buffer.In which they are used.

RAJESH.R

Veretx buffer is used to store vertex arrays (used with DrawArrays, DrawElements functions), index buffer is used to store indices that index vertices when rendering via DrawElements function (refer to API description for explanation).

Vertex buffer stores vertex coordinates.
Index buffer stores indices.
If you connect vertices stored in vertex buffer in order defined by index array you’ll get proper primitives rendered.
For example:

(-1,1) (1, 1)
   .-----.
   |    /|
   |   / |
   |  /  |
   | /   |
   |/    |
   .-----.
(-1,-1) (1, -1)

Vertex array:
-1,1, 1,1, 1,-1, -1,-1
Index array:
0, 1, 3, 1, 2, 3

If you render GL_TRIANGLES using this index array and vertex array you’ll get these two triangles rendered.