Jump to content
  • Advertisement
Sign in to follow this  
frankdan

obj and mtl file loader

This topic is 4842 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, anyone know a place or a tutorial where i can download(/read how to) a ".obj file loader" for borland builder c++. I got the code so i can read the information in the files but i can't paint the object on the screen. It has to be one for borland builder and it has to use .mtl-files aswell.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You could parse both the geometry and the material.

You can read the common instructions or you could write a parser (flex/bison) to do the work.

If you take a look to the obj/mtl grammar you'll notice that the sintax is quite simple and also the grammar.

Once all the needed data is on memory you can build several vertex arrays/buffers and the corresponding triangle indices buffer for each material. Then is easy to loop each material, change the renderer state (material and buffers) and render the indices buffer.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!