I was trying to use two Vertex Buffer Objects (VBO) and two Index Buffer Objects (IBO) in a Vertex Array Object (VAO) for rendering data from a wavefront .Obj file containing a 3D model. The .obj file was using the vertex/normal face definition:
f v1//vn1 v2//vn2 v3//vn3
I realized that I couldn't use two IBOs for indexing with OpenGL's VAO since only one buffer object (at a time) can be bound to the GL_ELEMENT_ARRAY_BUFFER binding target. This means that I can't just define vertex position indices AND vertex normal indices which is a problem when I need both as input to a GLSL vertex shader.
I thought about using a "Vertex" struct encapsulating vertex position and vertex normals, but I don't know how to feed OpenGL the data as anything but one long array and when I have all my vertex position data in different objects. I guess I could use some loops to copy the data to a new array containing all the position data.
When loading the .obj file I guess I could process the data so that the normals are matched with the corresponding vertex position values.
How should I go about solving this problem?
I'm using C++ and Visual Studio 2012 with OpenGL 3.3.