How to load 3D Max/3DS file

Started by
1 comment, last by ldquyet 22 years, 2 months ago
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
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 fileLib3dsFile * File3DS = lib3ds_file_load("mymodel.3ds");// get number of vertices in fileint numVertices = File3DS->meshes->points;// get xyz coordinates of first vertex from fileFile3DS->meshes->pointL[0].pos[0]; // xFile3DS->meshes->pointL[0].pos[1]; // yFile3DS->meshes->pointL[0].pos[2]; // z// ...and so on  


Edited by - baumep on February 1, 2002 2:22:42 AM
baumep
I will try this way. Thanks!

This topic is closed to new replies.

Advertisement