Hi all,
i have a question about loading 3ds using this tutorial. I want to use more than one texture on the model (because here all the models have more than one) but it seems that this library can't do that. Do you know any other alternatives or a way to edit this existing library to reach my aim?
thanks.
how to load multi-texture 3ds
Started by Ivan Zandonà, Jan 05 2012 10:27 PM
3 replies to this topic
#1
Posted 05 January 2012 - 10:27 PM
#2
Posted 06 January 2012 - 02:05 PM
You need to read the material chunks from the 3ds file, these material descriptors contain texture information for faces (or for objects/meshes). Then you just load these textures, and the drawing is just like:
foreach material
{
bind texture from material
draw mesh/faces using this material
}
Of course, this is highly simplified example, but this is what you need to do.
I just checked one model from your link, and i think these models - in this form - not so good for using in games. So many textures in different files...
Maybe using lib3DS (library for loading 3ds files, as i saw, almost completly can read 3ds files) would be better option, than writing your own 3ds reader.
foreach material
{
bind texture from material
draw mesh/faces using this material
}
Of course, this is highly simplified example, but this is what you need to do.
I just checked one model from your link, and i think these models - in this form - not so good for using in games. So many textures in different files...
Maybe using lib3DS (library for loading 3ds files, as i saw, almost completly can read 3ds files) would be better option, than writing your own 3ds reader.
#3
Posted 06 January 2012 - 06:59 PM
Thanks for your reply. Do you know if this library loads also textures? I can't find it in the source...
Thanks for your patience!!!
Thanks for your patience!!!
#4
Posted 06 January 2012 - 08:04 PM
I dont know for sure, but i dont think it loads textures. It's a *.3ds loader, loads only the mesh data.
For texture loading you can try for example DevIL (http://openil.sourceforge.net/), it supports a lot of image formats.
(I assume you are using OpenGL)
For texture loading you can try for example DevIL (http://openil.sourceforge.net/), it supports a lot of image formats.
(I assume you are using OpenGL)
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











