Skip to main content
gamedev.net
🔒 Locked

3DS Loader

Started by Kincaid 10 replies 1.7k views
Original Post
Kincaid
Kincaid
Hi, I'm looking for a 'simple' 3ds loader to load models in my opengl scene. I found several on google, but none of them opens all 3ds's. they crash, leave out texture or whatever. Does anyone know a good 3ds load module , or link to, (for VC++). Thanx
Kincaid
Kincaid
I came across that one, but it looks far from simple :)

Also, how to use it??
what to include..
etc...

Any links on how to use it maybe???

But it would be the perfect solution to loading and using All 3ds models ???

thanx
ViLiO
ViLiO
I can honestly say i've never used it [grin]

However, in the download there is a visual c++ project that should allow you to build the lib3ds lib or dll for you to use in your own projects.
There is also an example "player.c" within the download so you should be able to get started from that.

I'll admit it does look particularly nasty upon inspection, but as far as 3ds loaders go, I doubt you will find a more complete one [smile]

Sorry I can't be of more help ...
Best of luck,
ViLiO
Richard 'ViLiO' Thomasv.net | Twitter | YouTube
Kincaid
Kincaid
Thanx anyway.


So, can anyone else help me to some clear documentation on Lib3DS ??
Kincaid
Kincaid
but are they any good ??? :)

did some more reading on 3dslib, but it seems promising.
So, if anyone knows how to use this better, please tell me.

Thanx
Samurai Jack
Samurai Jack
It should not be that hard to write a 3ds loader. You should take in account what do you want to read? If it is just meshes then you can have a 3ds loader in about 30 lines of C code. Just pick the chunks you are interested in. Many format descriptors can be found at www.wotsit.org.

I believe there was a demo library some time ago called Clax.

As for 3ds you should know that:
- they store no normals
- you have to compute normals for lighting computation via smoothing groups
- they have no bones (it is possible but very very hard - no loader supports it)
- the bones demo is some chicken running down some zig zag pattern 3ds4
- 3ds max is not abble to reuse bone information in .3ds files
- animation is mostly node based (you do not move vertices but nodes)
- a node is represented as whole mesh (a planet and its moon for example)

If you would like to come more into gaming, take Milkshape MS3D. Milkshape can import almost every file format there is in common, and the .ms3d format has a very very simple SDK.
AlgorithmX2
AlgorithmX2
If you’re not pleased with any one else’s Loaders just write your own, a 3ds loader only takes an hour or two. I wrote my own because I hate having to convert between formats, and such and I prefer working with my own code as much as possible, plus I like to keep everything using the same data structures and some times it’s hard to do that with a library or such.

All the info you ‘really’ need to load a 3ds can be found at, there probably some more stuff but you probably won’t need it.

structure and stuff
Shows how to read most chunks

Just remember, using a library is supposed to save you time, but if you could write something to do the job in half the time it takes to get the library is it really worth it =D, not to lead you away from them they can be great help.


ps:
bones are used for skeletal animation

I seek knowledge and to help others whom seek it
Alex Baker
Alex Baker
...the (probably) most important and valuable resource is the "3D Studio File Toolkit", available at support.discreet.com.
Alex Baker Computer science is dealing with computers as much as astronomy is dealing with telescopes.

Topic Locked

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

Sign in to reply to this topic.