Sign in to follow this  
Kealthes

Parser c++ and .obj

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this