3ds file reader

Started by
3 comments, last by Android07 15 years, 11 months ago
I am writing a 3ds file reader that can support models with multiple objects in them and different textures on the objects. I have it reading the vertexes, facets and texture mapping coordinates for multiple different objects. I also have it reading the filenames of the textures. My problem is I can't work out where it stores which texture is on each object. None of the information I can find on the format tells me what is stored. Also does anyone know where I can find full information on what each chunk is for and what exactly it stores as all I have found is lists of chunk names and more specific information on some of the important ones. Thanks.
Advertisement
http://www.spacesimulator.net/tut4_3dsloader.html
And it has source code for a 3ds loader at the bottom
I've been using that tutorial already. I have it reading the model's geometry ok. I also have it reading in the textures that are being using from the 3ds file. All I need to know is where it stores which texture is on which part of the model.
I have a model of a car that is in 6 object. The main chassis, the windows, and the 4 wheels. There is 3 textures for this as each of the wheels uses the same texture.
I want to know where is stores the data like
Object 1 uses texture 1
object 2 uses texture 2
objects 3,4,5,6 use texture 3

It should be stored somewhere in the file as when i import it into max it knows where each texture is and maps them correctly.

Thanks.
(1)each (0xAFFF ) Material block has a (0xA000) Material name.
(2) each (0x4130)Faces material list has a (strz) Material name.
Use Material name as the key to link them.
Thanks, thats exactly what I was after, got it all working perfectly now :)

This topic is closed to new replies.

Advertisement