-2

I have been trying a couple libraries to load/parse my .obj model into my opengl program.

Here's some of them:

  • nate robins, GLM

  • obj2opengl(farthest one) by heiko

also a few other loaders that didn't work.

My main problem with these were undefined errors. And since I tried GLM from many different people (editors of the original code) then maybe it's something I'm doing wrong.

So my questions are:

  • What obj loader should I use for opengl (PC type)?

  • If I were to parse the obj file myself, then how should I save the vertices?(the fastest/most efficient) also choices with pros/cons are even better

I'm using Code Blocks/MinGW on windows 32 bit (7 and vista).

genpfault
  • 51,148
  • 11
  • 85
  • 139
Molmasepic
  • 1,015
  • 2
  • 13
  • 18

1 Answers1

2

You might be interested in the (unfortunately named) Assimp library. While it is not a (fast) parser in and of itself, you can use it to produce an easy to parse format that contains only the data you are using, and it can load a lot of formats.

If you wish to parse the file yourself, it helps that the OBJ file format is very simple. I reccomend taking an equally simple approach - just bring in all the vertices into a vertex buffer and create an index buffer to use. Then render using Vertex Buffer Objects / Index Buffer Objects and just draw indexed triangles.

James
  • 5,355
  • 2
  • 18
  • 30
  • i have tried assimp before but when doing so, i had absolutely no idea where to start ._. i didnt even know what to use to load the model, some tutorials would be nice – Molmasepic Mar 09 '11 at 18:01
  • They have a short tutorial available at http://assimp.sourceforge.net/lib_html/usage.html – James Mar 09 '11 at 18:36