world -> models
model -> mesh
mesh -> polygons
polygon -> vertices
model -> loadMesh("model.txt")
A vertice in world space would be:
x = model.pos.x + vertice.x * model.width
So all values of vertices would be in the range -1.0 .. +1.0 so we can scale them nicely.
Also, if you know the entire mesh is made of triangles, you could skip those lines. Generally these types of files are in binary and not text, but unless your write an editor for your filetype, it's generally easier to just use text as the filesize + ease of use trumpts the load speed. Also, if your also bound to a single polygon type, you can skip the first line (numPolygons) as it's a constant amount of vertices to read, so you can just parse to EOF.