Skip to main content
gamedev.net
🔒 Locked

dhpoware OBJ loader

Started by enigmagame 0 replies 1k views
Original Post
enigmagame
enigmagame
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:

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);

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.
sprite_hound
sprite_hound
You mean modify them in the model class? A quick look at the header file shows that the vertex data is private, so you can't.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.