资 源 简 介
Obj is the simplest and most widely supported format. However it is not well suited for their direct use in videogames.
Another problem arise when you want to use normal mapping, because tangents are needed if you want to use tangent-space normalmaps; but only space coords, normals and uv are available per vertex.
This tiny program parses an obj file, generates tangents and rewrites the "augmented" mesh in a very simple binary format.
//byte flag -> XXXX XXNT N = Normals; T = Tangents
//int nVertices -> number of vertices
//int nTriangles -> number of triangles
// foreach vertex
// float x float y float z
// float u float v
// short nx ny nz
// short tx ty tz
// foreach triangle
//unsigned short vi1 vi2 vi3