- Mesh: Any amount of triangles which are positioned to appear as one object.
For example, a cube, it looks like one object and contains 12 triangles.
I would call this a mesh.
I'd like to note that this definition is not at all correct, but I will be using it, so it's best to know what I mean.
- Blender Object: An object in blender which, in object mode, can only be selected as a whole.
Notice how there is only one object which I can only select as a whole. This is a blender object.
When you export as a .obj file, it exports the whole blender object, including all meshes.
The .obj format:
A .obj file has simple statements. In their simplest form (vertices and faces, no normals) they look like this:
v 1.0 5.0 1.0
v -1.0 2.4673 -12.06
f 1 5 3
f 5 1 5
v stands for
vertex it describes a vertex.
f stands for
face it describes a triangle, the example:
f 1 5 3
Means: That there is triangle made of vertex 1, vertex 5, and vertex 3
The order is the same order they are declared in the file
v 1.0 -1.0 -1.0 # 1st vertex
v 1.0 -1.0 1.0 # 2nd vertex
v -1.0 -1.0 1.0 # 3rd vertex
v -1.0 -1.0 -1.0 # hmm...
The important thing to realize is that the concept of a 'mesh' as I call it, does not exist in OpenGL, nor does it exist in the .obj file. It is a special concept and above that, it is Blender's doing.
Therefore, loading this data into a proper parser should come out with the right result, merely because OpenGL doesn't require each vertex array to be only one mesh, because to do so, would be an incredible speed reduction and a crap time for the developer.
Therefore, a blender object, as defined before, can be exported to a .obj file. Once this said file is loaded into your program and read, if properly done, should produce exactly what you expect. Multiple meshes that is.
Hopes this helps, if not I'll try to explain further.