Sign in to follow this  
Kris2456

Model Loading Tutorial

Recommended Posts

I expect this question has been asked thousands of times, but here goes anyway. Does anyone know of any good 3D model loading tutorials. And before u go bash away www.gametutorials.com into your keyboards, ive been there. His tutorials are great and quick, but VERY thin on the explanation. Im looking for .3DS, and .OBJ in particular. Its a shame that NeHe doesnt do them cos his tutorials are great. Anyhow, i apreciate any help, even your own sugestions. Thx EDIT: Fixed typos

Share this post


Link to post
Share on other sites
Hmm...I'm surprised this hasn't gotten any answers and so few views. I would recommend reading through NeHe's milkshape model loading tutorial (tutorial). As far as different formats, you might want to look up that format's specifications once you understand the model-loading functions.

Other than that, I geniunely don't know. Sorry I couldn't help more.

EDIT: I know, I know...linkie.

EDIT: ...

[Edited by - Boku San on October 2, 2004 7:38:46 PM]

Share this post


Link to post
Share on other sites
To draw a model, you need to know the material information, the vertex information, and (possibly) the skeletal/hierarchy information.

Ignoring skeleton/hiaerarchy, a model loader really just reads in a file, and returns to you a few pieces of information:

1) one or more texture names
2) a vertex array of interleaved vertices (typically)
3) one or more index lists of triangle lists (typically, one per texture name)

To draw, you call VertexPointer(), TexCoordPointer(), NormalPointer() etc (depending on vertex format), then bind the first texture, draw the first triangle list (using DrawElements() or DrawRangeElements()), set the second texture, draw the second triangle list, ...

There's really nothing more to it than that, at the high level. At the low level, each file format has specific quirks as to how it stores the vertex array information, triangle information, and texture/material information. In the end, all that comes out is material information, vertex array(s) and triangle (index) list(s).

For hierarchy, the vertex format may contain one or more indices into a bone table, with weights (for skinning), or there may be a number of bones, with parentage, and an index list per material per bone (for rigidly articulated models).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this