Skip to main content
gamedev.net
🔒 Locked

Loading models

Started by EricmBrown 3 replies 4.1k views
Original Post
EricmBrown
EricmBrown
I finally settled on a modeler to learn (blender) and now I am faced with the question of how to load models in opengl, and which format I should use. For the time being I dont neccisarily need the "most powerful" format, just a simple one that is easy to use for simple animation (i.e. idle,walk,attack,die) and is exportable in blender. I searched the articles section and was only able to find one on milkshapes format which as far as i can tell is not supported by blender, and the tutorial doesnt go into animation anyway. Anyone know of some solid/easy to read tutorials for formats that I can use for models in my games? -As always, any help is appreciated :)
CableGuy
CableGuy
I would suggest coding a 3ds loader.
as 3ds are widespread and there are plenty of resources on the net about it.

you can start with a simple loader that loads only vertices and faces and from there progress to materials,lighting animation etc.

just google something like '3ds loading source code'

and you should also check wotsit as i recall there is a very informative spec
there.

Will F
Will F
Havne't seen many good tutorials on the net, but here's a couple of books that might help (they both use OpenGL):
Focus on 3D Models by Evan Pipho
More OpenGL Game Programming by Dave Astle (editor).

If you've never written a model loader i'd suggest starting with OBJ, just because it's a simple format and is text based (though it doesn't have animation). Then i'd do a MD2 loader - because it's simple and sounds like it suits your needs (there's a Blender import/export plugin available somewhere).

Then I would move on to more advanced formats or perhaps create your own (of course this would also mean writing a blender plugin as well).
EricmBrown
EricmBrown
I'll definitally have to grab those books. Also, I have an article that covers MD2 loading, i wasnt aware that there was a plugin. i'll have to check that out. Excellent. thanks :)
Will F
Will F
One thing to be aware of is that the chapter on models in More OpenGL Programming is mostly a rehash of the other book (same author IIRC), but it's still an interesting book.

Haven't used it myself, but you can find the blender md2 script here.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.