You should look at a 3D format like collada. Maybe milkshape would be easier to start with.
It's a tad harder, but assimp is interesting to work with, definateley has good data layout.
You will save yourself a LOT of toruble by seperating a mesh into mesh data (vertex soup), submesh data (indices into the soup), skeleton data and animation data. Assuming at some point you want to animate these things.
struct MeshData {
// Positions, normals, uv's basically one big mesh soup
unsigned int m_nVertexBuffer;
};
struct SubmeshData {
// Just indices into the mesh soup
unsigned int m_nIndexBuffer;
unsigned int m_nMaterialIndex; // Indexes into mesh classes materials
};
struct Mesh { // Tough, i'd call this 'struct Model'
MeshData mesh;
std::vector<SubmeshData> submeshes;
SkeletonData skeleton;
std::vector<ClipData> animations;
std::vector<Material> materials; // All the materials submeshes may use
// Materials are shaders with some way of setting uniform data.
};
Rendering would be something like:
void RenderMesh(Mesh& mesh) {
mesh.BindVertexBuffer();
for (int i = 0; i < mesh.submeshes; ++i) {
Submesh& submesh = mesh.submeshes[i];
submesh.BindMaterial();
submesh.DrawIndexBuffer();
submesh.UnbindMaterial();
}
mesh.UnbindVertexBuffer();
}
Keep in mind, there is no logic up there. It's all data! you would also need something to represent the current animation state. Also, vbo's are useful when animating on the gpu, you will need to hold on to vertex data for cpu animation.
Edit: Did not read your post about needing to traverse triangles from outside, sorry.