Original Post
Hi, I'm using this library: http://www.dhpoware.com/demos/glObjViewer.html to load obj models in my project. I use this code in my draw function: It runs correctly. But I need to access to the vertices data. Using this library, the faces are grouped based on the material that each face uses. How can I access to the vertices data? For each triangle I need the three vertices. Thanks.
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, model.getVertexSize(), model.getVertexBuffer()->position);
glDrawElements(GL_TRIANGLES, pMesh->triangleCount * 3, GL_UNSIGNED_INT, model.getIndexBuffer() + pMesh->startIndex);
glDisableClientState(GL_VERTEX_ARRAY);