Animation in OpenGL using 3D Models

snape
  • Animation in OpenGL using 3D Models snape

    I have created a model in Blender. Now i want to read that 3D model in my c++ program. I figured that a model can be exported to various file formats e.g. .obj, .3ds or COLLADA and then can be read in a c++ program. I have been searching web for doing that for quite a while and found many tutorials. But i ran into issues with most of them. For example, IN the Nehe tutorial they are using glaux which I don't want to use in my program. And the remaining tutorials use md2 which is not supported by Blender.

    So can anyone guide me which file format to use for exporting 3D model and how to load that in my OpenGL program? Also how can I animate that model? Is it possible to add extra effects like tone mapping after it has been loaded in the c++ program using OpenGL? if yes then how?

    P.S. I am using Linux for game developement

  • I'd go for OBJ format. As you have already probably realised, there's hundreds of OBJ loaders for C++ out there. I believe one of the most mature ones is Assimp, it supports many different formats and it is pretty well documented. Here you have an example where they use it.

  • 3ds isn't containing any animation data so that one won't work. Collada I don't know much about but when I decided on which format to use in my game I searched and compared a lot and finally I went with the B3D format, it supports skeletal animation and is loadable from Irrlicht (it also contains lighting values).

    I use the 'b3d pipeline' exporter from 3dsMax and I have coded my own hlsl shader to animate and light the meshes, it works really well.

    You can check out how Irrlicht does it (ie. loading and animating), it does the animation in software though but there are examples if you search a bit on how to do it with a shader (if you want that). A nice thing is that Irrlicht supports both OpenGL and Linux.

    Another format that is quite straight forward is the .X format, there must be tons of examples out there on how to export, load, parse and set up the skeleton and animating with it. It is a Microsof format though so maybe you won't want to use it :-)

    Tone mapping and such has absolutely nothing to do with animating so yeah if you know how to use that technique you can do that with animated meshes.

  • Blender 2.60 has fixed COLLADA animation support, it was more or less broken in earlier versions. However, if you haven't loaded any model formats yet in your own code, I'd suggest learning to load .obj first. It's in ASCII so it's human readable and easy to read without external loader libraries.

Tags
opengl graphics animation models
Related questions and answers
  • The problem is that I'm trying to use my meshes with Bullet Physics for the collision part of my game. When I attempted doing this method with my GLM(model loading library by nate robins) model, I get a segmentation fault in the debug, so I figured that it doesnt like the coordinate variables of the model. If i use blender to export my model as a collision file, what type of file should I use? I have heard of a .bullet exporter, but i dont know hot to integrate this python script into my Blender 2.5 program.

  • SDL_FreeSurface(image); Also what format should I use for this? I am using Blender, and I have seen it can export to a variety of formats. I don't know which would be the best for this kind...I have been learning C++ for long time (but only learning game development for eight days) and I have made a simple game using 2D textures. I was thinking of starting on 3D game development. I wanted to begin by loading and rendering a 3D model on the program, but I dont know how. Can anybody tell me if this function could be changed to output 3D model: GLuint loadTexture( const string &

  • Lately I have been working on a game that i plan to make online. I have used different libraries to make this game as far as i could, but I feel that I should rethink on how Im sertting this game up, so I planned to start over. The libraries that I have used are SFML, OpenGL, and Bullet Physics, along with GLM to load the models. But the problem is that the 3D graphics arent working.... The libraries that I would need are ones that fit the criteria of making a simple 3d game(online): 3D Graphics(including a model loader of some sort(if it works with blender that would be even

  • Ive been reteaching myself opengl so I can make a game on android. However Ive been struggling with how to build objects and scenes in opengl using c/c++ and passing them through the jni to the virtual machine where android can use them. Can some one point me towards some tutorials that actually show the use of natively built objects being created and passed through to the jni. Im fine using c... but I cant figure out how to create a scene in opengl in c++ and then pass it to java. Ive been looking at writing everything using java but Im not sure if the java bindings make for some performance

  • I'm creating an FPS game. I'm writing my own game engine. So far all the backend stuff is going great. I'd like to support md2 as the native file format for 3D Objects, but I also want to use skeletal meshes. Does anyone know if the md2 file format supports skeletal meshes? In-case you need to know, I'm going to use blender as my Mesh creation tool and C++ as my programming language... Thanks For got to mention, the engine is based on OpenGL... Alright, for anyone who is reading this, I just found the Doom 3 md5 specifications (http://tfc.duke.free.fr/coding/md5-specs-en.html). It gives

  • I'm fairly new to game development, played around with xna before and just learning OpenGL & c now and I'm interested to know which c/c++ based model animation libraries are out there and which you would recommend? I don't have any particular model format in mind yet but probably a format that is supported by a free modelling tool like Blender.

  • I am quite new to OpenGL, I have managed after long trial and error to integrate Nehe's Cel-Shading rendering with my Model loaders, and have them drawn using the Toon shade and outline AND their original texture at the same time. The result is actually a very nice Cel Shading effect of the model texture, but it is havling the speed of the program, it's quite very slow even with just 3 models... NEHE'S TUT glBegin (GL_TRIANGLES); // Tell OpenGL What We Want To Draw for(int i = 0; i < numTriangles; i++) { MD2Triangle* triangle

  • ------ Initializing File System ------ Loaded pk4 C:\Program Files (x86)\Steam\steamapps\common\doom 3\base\game00.pk4 with checksum 0x29cdb978 Loaded pk4 C:\Program Files (x86)\Steam\steamapps\common...\steamapps\common\doom 3\base\game01.pk4 (2 files) C:\Program Files (x86)\Steam\steamapps\common\doom 3\base\game00.pk4 (2 files) game DLL: 0x0 in pak: 0x0 Addon pk4s: file system initialized... if the warning I am getting is the problem or if there is something else. Also, this is when the configuration being used is "Dedicated release", but I have also tried with "Dedicated Debug". It is my

  • I am using Ogre for my rendering engine, and I planned on just using the .mesh format that is setup by default with Ogre. However, I recently purchased a large number of 3d assets from a company, only to find out that they use 7 blend weights where as Ogre has a max limit of 4. I don't know much about modeling and animation (which is why I purchased the art) but just from thinking... be great. So far all I have found is http://www.falloutsoftware.com/tutorials/gl/gl6.htm which is helpful but not complete.

Data information