Help loading 3ds file

Started by
8 comments, last by cignox1 15 years, 9 months ago
hello. I'm try to load a 3ds file from vc++ 7.0 and draw it on opengl. I'm search on google and i find a lot of materials , too materials. What you advice to me for 3ds? I'm would to know at least a detailed file structure , after i do alone. and ... for a maya file?. Thanks. [Edited by - LessBread on July 19, 2008 3:19:21 PM]
Advertisement
Here's a 3DS tutorial.
Despite that only D3D code is available there, it is fairly easy,(for me at least)
to use openGL also. 3DS isn't a very good format... It doesn't support normals, despite having light data. And, IMO, it has a serious flaw. I'm still waiting on a solution for that problem...(By the way, my loader works on PC, Wii, and DS support might be added, if I can get it working...)
I'm planning on switching to a different format.
My Website:link(Not hosted by Gamedev)
The best choice to work with 3d max is to use the MaxScript language to
export your own format file.

all the professional companies design their own formats.

in general your file must contains:
- section for vertices.
- section for faces.
- section for normals.
- section for textures.
- section for animation information.

this way your r free from the restrictions of the standard formats.
that's what i know.
Thanks , but what is this 3ds studio script?
and there is a better file format for import data then 3ds?
And for maya?
Thanks
I wrote a simple 3ds loader once and if you want I can send you the sources to give them a look.
That said, 3ds is not a good format: too many limitations (i.e. the normals problem and how textures and uv are handled).
If you own a copy of 3ds max then I highly suggest to write a script: several years ago I did it and it is a really easy task.

I don't know good alternatives: I heard that lwo (lightwave format) is pretty nice. In addition it is an open format so you should be able to find the documentation (I did).

I've heard also good things about collada: the idea is that you export data from the 3d application using a collada exporter, and then convert it to you own format...

Again, perfhaps writing a script exporter is perhaps the easier way.

EDIT: in case you still don't know what a 3ds script is, here a very brief description: a 3ds script is a small programm written in the scripting language of 3ds (that when I used it looked very like to C syntax). 3ds makes an api available to this script, and you can use these functions to do what you like.
Lightwave and most professional 3d packages out there have something similar (like MEL for Maya)
Quote:Original post by cignox1
That said, 3ds is not a good format: too many limitations (i.e. the normals problem and how textures and uv are handled).
If you own a copy of 3ds max then I highly suggest to write a script: several years ago I did it and it is a really easy task.


But those problems(the normals problem and how textures and uv are handled) are solvable using sdk and api?
i ask you before start to write code.

ps.
i find this http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=7481484
is write thath is for game developer , but i'm not understand if are for directx only.

Thanks

[Edited by - giugio on July 20, 2008 12:34:35 PM]
Quote:Original post by giugio
Quote:Original post by cignox1
That said, 3ds is not a good format: too many limitations (i.e. the normals problem and how textures and uv are handled).
If you own a copy of 3ds max then I highly suggest to write a script: several years ago I did it and it is a really easy task.


But those problems(the normals problem and how textures and uv are handled) are solvable using sdk and api?
i ask you before start to write code.

ps.
i find this http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=7481484
is write thath is for game developer , but i'm not understand if are for directx only.

Thanks

You can compute the normals as you would from c++ and store them in the file toghether with the vertices in an application friendly layout.
The uv and textures problem, the 3ds file format reflects the limitations of the 3ds. I never used max so I cannot be sure, but I bet that latest versions have not these limitations. It would probably be cool if there were the specifications of the max format, but you should be ok if you write a script. This way you export only the data that you really need, and also other informations not directly bound to the 3d model, if necessary...
i find about this:
"3ds max Game Export Interface" on the 3ds's internet site
do you know?
Is better than the classic api of 3ds?
thanks
up
Quote:Original post by giugio
i find about this:
"3ds max Game Export Interface" on the 3ds's internet site
do you know?
Is better than the classic api of 3ds?
thanks


I've not used 3ds since years. I know that a couple of versions ago lightwave didn't provide a function to calculate normals and you had to do it 'by hand'. I can't really tell about 3ds, but I'm sure it will give you all the informations you need to do the task (everything you would find in the file anyway, at least).

If you own a copy od 3ds, I would say that your best bet is trying to write a simple script to save the vertices. Otherwise, give a look to the api documentation (I suppose that it is available from their site).

This topic is closed to new replies.

Advertisement