Hello everybody,
Now I know how to construct a quad through plotting vertices, but I still haven't grasped the idea of indices yet.
like for example :
float vertices[] =
{
-1.0f, -1.0f,
1.0f, -1.0f,
-1.0f, 1.0f,
1.0f, 1.0f,
};
This is me defining a quad in OpenGL. Now lets say it has the corresponding indices:
byte indices[] =
{
0, 3, 1,
0, 2, 3,
};
How do the indices correspond to that quad I have just created? I have heard that the indices define which points (vertex's) are part of the
same triangle.
But I don't see how those abstract numbers correspond to my floats on the grid.
So in conclusion my question is what are indices, why do I need them. And how can I better understand them
-Marcus Hansen