Say I write in a file
Mesh: 1
Vertices: 345
Indices: 123
V: 1,3,4 1,4,5 ..
Mesh: 2
Vertices: 456
Indices: 42
etc.
How do I go about seeking at any position? E.g. I want to go to Vertices: of Mesh 2 or V: of Mesh 3 etc.
What’s the proper way to go about these things?
You would normally use a binary format. One way would be to allocate a certain amount of space as a header in the file. Here, you put the mesh numbers, vertex and index counts, and an offset into the file where the vertex data begins. You read the header when loading the file, then seek to the appropriate place to read the data you want.