Parser c++ and .obj

Started by
2 comments, last by szecs 12 years, 10 months ago
Hee people,

I need to somehow implement 3ds max models into opengl and some people strongly adviced me to make use of wavefront .obj files. Then I was told to write a parser. My question is fairly simple, how do you write a parser and can this be achieved with c++. I must admit that I am new to c++ and am still learning, but I need to explore the possiblities before going on. When I know c++ will I be able to write a parser or are there still other things that i need to learn. I saw that there are not may tutorials and stuff like that on writing one, so that's why I am asking.

Thanks a lot for your help!
Advertisement
It can be done in any language that can open text files. OBJ files are just text files, open one in notepad and take a look. You only need a very basic knowledge of 3D theory to parse them
Aah, so when I know c++ and and opengl, parsing them is no problem anymore? Thanks a lot btw.
If you are asking if it's simple: it is. At least writing a very basic one is simple. By very basic I mean you only read ONE object, and only the mesh data (positions of vertices, triangles, texture coordinates and maybe vertex normals). Loading materials is a different thing, but that's not hard either. There are tons of references about .obj on the net, maybe even source codes or libraries.

This topic is closed to new replies.

Advertisement