Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ldquyet

How to load 3D Max/3DS file

This topic is 6011 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am a beginer of game programming. I want to write a 3d game engine myself. I see 3D max is a very good to for designing a scenes/characters. but How can i load this kind of format file in DirectX. Can any specialist help me this? Thanks alot! Quyet Le

Share this post


Link to post
Share on other sites
Advertisement
I can't tell you how to write your own 3DS loader, sorry. But I would suggest using lib3ds, it's a free library for loading 3DS files. You can use its functions and structures to load the mesh (or any other data you need) from a 3DS file and then convert it to your own format. It's quite easy, e.g.:
  
// load file

Lib3dsFile * File3DS = lib3ds_file_load("mymodel.3ds");
// get number of vertices in file

int numVertices = File3DS->meshes->points;
// get xyz coordinates of first vertex from file

File3DS->meshes->pointL[0].pos[0]; // x

File3DS->meshes->pointL[0].pos[1]; // y

File3DS->meshes->pointL[0].pos[2]; // z

// ...and so on



Edited by - baumep on February 1, 2002 2:22:42 AM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!