tags:

views:

176

answers:

4

I wanted to know whether a 3D model library exists which is built upon opengl which i can use in my c/c++ code.

for eg ,is there a library where there are ready models of viz.apple,fan,football which i can directly draw using c/c++?

+3  A: 

I wish things were so easy...

c++ and openGL alone are pretty much useless to render 3D models, even as simple as a football or a fan.

The first thing you need to do is to:

  • choose a rendering engine like ogre 3D. the learning curve can be quite stiff.
  • get some models with the right file format. That probably mean that you will have to export them from maya/blender/3dsmax. The exporter is usually a part of the rendering engine.

Ok, if you reach this point, your original question can now be reformulated like this: "how do I find models which can be loaded in Blender?" (if you decide to use Blender).

This question is a bit easier and you can find simple models around which you can load in Blender or any 3d modeller. Still, you will only find very simple ones that are probably ugly too. The reason is simple, 3d modeller is a full time job and most people usually don't like to give good quality products away for free.

Now in the right order:

  • load a model in Blender
  • export it to the format required by your game engine
  • load the model in your C++ code (using the game engine API)
  • display it!

Note that there's no animation involve so far, that would make things even more tedious. Also, exporting the "material" (appearance) of an object can be quite tricky as you need to get all sort of things right (shader, textures...).

A: 

Polycount has a bunch of Quake 2 models for download. The MD2 format is documented and easily rendered with OpenGL.

genpfault
A: 

Have a look at the 3D modeler AC3D.

Under resources there is a C/C++ exporter someone has written.

Steve Baker wrote a program that parses an AC3D file and generates C++/OpenGL code that displays the file - see ac2gl.

epatel
A: 

There's a few academic-type websites that put up (mostly high detail) 3D models for download. Here's an example : http://www.cmlab.csie.ntu.edu.tw/~robin/courses/cg03/model/.

Some of the models are in Wavefront .OBJ format, which is a simple text format I would recommend if you're writing a model importer for the first time.

KennyDeriemaeker