   Another OBJ Reader
  Hey guys, I'm making a Wavefront OBJ Reader, I did it before but this time I wanted it to load objs that had polygons of N Sides, and it worked fine so far.OBJ as you know stores Vertice indexes UVW indexes and Normal Indexes in form of triangles ,quads or N-Sided polygonsMy problem is that I want to convert from polygons to triangles, for that I stored a list of indexes and converted to a trinagle fan, like sofor(dword i = 0; i < indexList-2; i++){vertexFace.a = rawData[0].vertexData-1;vertexFace.b = rawData[i+1].vertexData-1;   vertexFace.c = rawData[i+2].vertexData-1;mesh->faces.push_back(vertexFace);}...(Same goes for normalFace and texVertFace)"-1" is to correct indexes in obj (that go from 1...N instead of 0...N-1)Well, this works for faces (geometry) and works for normals, but it does NOT work for Textures, the "UVW faces" are messed up. Say it's a quad, only half the quad (1st triangle) shows the correct UVW, the 2nd quad is messed up (showing UVWs the wrong way)I understand that this happens because, unlike geometry faces, UVW faces have an orientation, so a UVW-triangle of vertices A-B-C  is different from a UVW-triangle of vertices B-C-A, so I can't use this "triangle fan" conversion method. Any ideas on how to convert poligons to triangles and still mantain UVWs ?I've searched alot, and downloaded some OBJ readers to see how people do it, everything I saw uses GL_POLYGON and let OpenGL triangulate the faces for them...Ps. Note that, if I export to triangles from CAD software, UVWs work fine...   
The sales data feeds and associated channels should all be up to speed again! View the full article