i want to draw an .obj model in openGL using VBO, but i am confused with "index buffer", "index array" and other legacy functionality.
i cannot found anything clear about that on the web
i wrote an .obj reader, so in my system memory i have this situation
3 STL c++ vector representing data ridden from file
(Vec* is a class with * float members)
and
this vector of faces(triangles) each one containing indices to previous vectors of float
can someone tell me how to initialize buffer and draw them each frame? thanks
i cannot found anything clear about that on the web
i wrote an .obj reader, so in my system memory i have this situation
3 STL c++ vector representing data ridden from file
Code:
vector<Vec3> m_vertexCoords;
vector<Vec2> m_textureCoords;
vector<Vec3> m_normalCoords;
unsigned int m_numVertices;
unsigned int m_numTextures;
unsigned int m_numNormals;
and
Code:
struct Face
{
vector<unsigned int> vertices;
vector<unsigned int> texcoords;
vector<unsigned int> normals;
};
vector<Face> m_faces;
unsigned int m_numFaces;
can someone tell me how to initialize buffer and draw them each frame? thanks