3
\$\begingroup\$

Hey guys, im working on a final class project for a graphics class, and me and a teammate are making a simple 3d tower defense game.

We're currently planning on using 3ds models and drawing them with OpenGL.However, niether of us have a lot of practice/experience with loading/drawing models.

What is the fastest and/or easiest (not neccesarily the best or most feature-implemented) way to load a 3ds model and draw it with a OpenGL/glut setup?

\$\endgroup\$

3 Answers 3

1
\$\begingroup\$

It is easy to load 3ds files using: http://code.google.com/p/lib3ds/

It also comes with a OpenGL sample.

But I think it is better to use another format, 3ds materials name limitation are a real pain.

\$\endgroup\$
1
3
\$\begingroup\$

The easiest way will be load obj files, like so(files you are interested in -> glm.h/cpp):

http://www.xmission.com/~nate/smooth.html

It comes with examples.

I personally feel, that if you are learning, you should make one yourself. Not as feature filled as above, but a simple obj loader that reads vertices/normals/texture co-ords and perhaps the material as well.

It will take you a few hours at most to figure this out (speaking from experience - when I didn't have experience :). This will make you understand the guts of all loaders and their possible limitations. You can then switch to more feature filled loaders while at the same time knowing what is going on behind the scenes so that it does not seem like magic anymore.

\$\endgroup\$
1
  • \$\begingroup\$ It depends on the OP's idea. If he's trying to learn how to do this, then sure. If his interest is to ship a working program, then it's much easier to use an existing one. \$\endgroup\$ Dec 9, 2010 at 16:34
3
\$\begingroup\$

I have good experience with AssImp. Have a look: http://assimp.sourceforge.net/ It's well documented.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .