Hi foum,
I am going through a opengl code snippet that generates cube from array of vertices. The vertex array also contain texture coordinates as follows
static const GLfloat vertex_data[] =
{
// Position Tex Coord
-0.25f, -0.25f, 0.25f, 0.0f, 1.0f,
-0.25f, -0.25f, -0.25f, 0.0f, 0.0f,
0.25f, -0.25f, -0.25f, 1.0f, 0.0f,
0.25f, -0.25f, -0.25f, 1.0f, 0.0f,
0.25f, -0.25f, 0.25f, 1.0f, 1.0f,
-0.25f, -0.25f, 0.25f, 0.0f, 1.0f,
0.25f, -0.25f, -0.25f, 0.0f, 0.0f,
0.25f, 0.25f, -0.25f, 1.0f, 0.0f,
0.25f, -0.25f, 0.25f, 0.0f, 1.0f,
0.25f, 0.25f, -0.25f, 1.0f, 0.0f,
0.25f, 0.25f, 0.25f, 1.0f, 1.0f,
0.25f, -0.25f, 0.25f, 0.0f, 1.0f,
0.25f, 0.25f, -0.25f, 1.0f, 0.0f,
-0.25f, 0.25f, -0.25f, 0.0f, 0.0f,
0.25f, 0.25f, 0.25f, 1.0f, 1.0f,
-0.25f, 0.25f, -0.25f, 0.0f, 0.0f,
-0.25f, 0.25f, 0.25f, 0.0f, 1.0f,
0.25f, 0.25f, 0.25f, 1.0f, 1.0f,
-0.25f, 0.25f, -0.25f, 1.0f, 0.0f,
-0.25f, -0.25f, -0.25f, 0.0f, 0.0f,
-0.25f, 0.25f, 0.25f, 1.0f, 1.0f,
-0.25f, -0.25f, -0.25f, 0.0f, 0.0f,
-0.25f, -0.25f, 0.25f, 0.0f, 1.0f,
-0.25f, 0.25f, 0.25f, 1.0f, 1.0f,
-0.25f, 0.25f, -0.25f, 0.0f, 1.0f,
0.25f, 0.25f, -0.25f, 1.0f, 1.0f,
0.25f, -0.25f, -0.25f, 1.0f, 0.0f,
0.25f, -0.25f, -0.25f, 1.0f, 0.0f,
-0.25f, -0.25f, -0.25f, 0.0f, 0.0f,
-0.25f, 0.25f, -0.25f, 0.0f, 1.0f,
-0.25f, -0.25f, 0.25f, 0.0f, 0.0f,
0.25f, -0.25f, 0.25f, 1.0f, 0.0f,
0.25f, 0.25f, 0.25f, 1.0f, 1.0f,
0.25f, 0.25f, 0.25f, 1.0f, 1.0f,
-0.25f, 0.25f, 0.25f, 0.0f, 1.0f,
-0.25f, -0.25f, 0.25f, 0.0f, 0.0f,
};
How to add the vertices and texture coordinates above inside the ofMesh/ofVboMesh.
I am not sure in which order i have to call the addVertices()/addIndices()/addTexCoords()
Thanks