How to write a parser for Wavefront .obj in C?

I am new to C programming, no experience in writing a parser. Where to begin? What is the general principle of the parser?

  • What for? For training? If you need to work - take flex + bison - alexlz
  • for training - JustK

2 answers 2

Wavefront OBJ format is designed to store 3D models. I realized its possibilities not completely, but only that which is connected with the representation of the geometry of polyhedra. The result is the PutWavefrontOBJ abstract class and the loadOBJ function for reading the file: ... As well as the GetWavefrontOBJ class and the saveOBJ function for writing to the file: ... The following classes are used to write data of the Polyhedron object to the file and back: .. .

Wavefront OBJ format

    Take some library (they are in google) and use them to write a parser.

    Look at this library. Or this one . Or maybe this