Pre-sorted 3D file type for indexed drawing

I worked on some 3D materials in relation to android, in particular opengl ES 2.0. On my learning path, all (most) examples show you how to take the obj file (wavefront.obj) and tear the vertices out of it. However, upon further reading, you will find that both obj files and several other types of files (including popular ones) solved in their own way, although most 3d libraries do not support independently indexed grids (separate index for vertices, normals, and texture cords) , these file types used multiple indexed grids anyway.

So anyway here is my question:

I read in one place that some types of files that exist there provide easy import into opengl (i.e. without any crazy shuffle electrical slide that shakes up the stuff I have to do with the data in the obj file). Does anyone know some types of files (opengl / friendly) that support one index for an indexed drawing?

+4
source share
1 answer

Try looking at Quake MD2 format (a good tutorial here) http://tfc.duke.free.fr/old/models/md2.htm , which is specifically designed for downloading in OpenGL. It is a good thing to learn, but it is a little old.

In contrast, the OBJ format is still highly developed, and for him it is a lot (simplicity, wide support). It looks like you are on the right track, since it seems you understand that the format has separate indexes for vertices, normals, and texture lines, and therefore has the requirement to create a separate index buffer for your vertex arrays.

The trick to making it work well is to use a quick hash solution to store / retrieve face descriptions of "vert / norm / tex". (My first attempt at an OBJ importer took 7 seconds to read the object of the front side 10000, now it is up to 0.5 seconds - and probably can be improved! Good luck!

+2
source

All Articles