3DS file format textures
hi ive written a 3ds parser but it doesn't parse textures from the file... yet. what i can do is load a seperate texture and apply it to the model. Now my question is, if you imagine there is a really large model (like a 3D track), and you texture it does the 3D modelling software available allow you to put this in a single image which can just be applied to the scene, and it would cover the whole model(s)? or am i going to have to learn how to parse textures from 3DS files?
It's up to the artist to define how textures are applied to a model. For such large objects as a racing track, multiple textures are better suited, since they deliver higher quality than a single image stretched all over the model. AFAIK (please correct me if I'm wrong - I don't use the 3ds format, I export directly from the modelling package to the native format), textures are always stored separately from the geometry data so it shouldn't matter how many textures your model uses.
You just need to extract the material information from the 3ds file (which might contain the texture file name).
You just need to extract the material information from the 3ds file (which might contain the texture file name).
ok that helps loads, knowing the texture file names and info are stored inside the 3ds file.
Just out of curiosity, how on earth could you parse a 3DS file without knowing that the textures aren't stored inside the file itself?
GDNet+. It's only $5 a month. You know you want it.
Quote:
Original post by Genjix
hi ive written a 3ds parser but it doesn't parse textures from the file...
I do believe you are referring to that 3DS loader I sent to you via e-mail.. [smile] By the way, how is it working out for you?
Quote:
Original post by Genjix
Now my question is, if you imagine there is a really large model (like a 3D track), and you texture it does the 3D modelling software available allow you to put this in a single image which can just be applied to the scene, and it would cover the whole model(s)? or am i going to have to learn how to parse textures from 3DS files?
You'll have to look up information on reading the material chunk of the 3DS file- i never bothered adding code to read this chunk because I know what the skin names are of my models anyway, so there's no need...
Quote:
Original post by Tom
Just out of curiosity, how on earth could you parse a 3DS file without knowing that the textures aren't stored inside the file itself?
The 3DS file is split into blocks of data called 'chunks', each of which contain different kinds of information. Confusingly, there are also chunks within chunks too (subchunks). You don't have to read any particular chunk/subchunk if you don't want to- you can simply skip it and move onto the next chunk.
Genjix, I'm not doing any further work on the 3DS loader but if you want I can send you an MD2 loader i wrote for my game engine instead. The MD2 file format is far easier to read and much better suited to game models than 3DS. The current version of the MD2 loader is pretty much complete- it reads skin names (if any),keyframes,texcoords,lighting,glcommands etc.. I'll send you this if you want- just give me a buzz.
ive written a nice md2 loader (same here, want a copy?). But MD2 just doesn't cut it for large scenes, with multiple meshes and textures (also lighting and fog info is useful).
With the 3DS, yes your loader was most helpful, so ive written a chunk parser... but i still get how 3ds deals with textures. how does it know which faces a texture is mapped to? I can't find anything to relate to this (is it the faces have a texture id, or the textures have a list of faces?).
Thanks.
With the 3DS, yes your loader was most helpful, so ive written a chunk parser... but i still get how 3ds deals with textures. how does it know which faces a texture is mapped to? I can't find anything to relate to this (is it the faces have a texture id, or the textures have a list of faces?).
Thanks.
Basically what you said: the 3DS contains a list of materials including texture names, and each face (or is it sub-object? I can't remember) references one of these materials. The vertices, of course, have UV coordinates so that textures are mapped properly onto your faces.
If you want a better idea of how a 3DS file looks in a non-binary format, export and examine an ASE or ASC file. They're formatted almost exactly the same way, except ASE/ASC is plain-text. (You might even consider switching to ASE/ASC if it makes your work easier. I understand that a lot of people do this.)
If you want a better idea of how a 3DS file looks in a non-binary format, export and examine an ASE or ASC file. They're formatted almost exactly the same way, except ASE/ASC is plain-text. (You might even consider switching to ASE/ASC if it makes your work easier. I understand that a lot of people do this.)
GDNet+. It's only $5 a month. You know you want it.
Quote:
Original post by Genjix
ive written a nice md2 loader (same here, want a copy?). But MD2 just doesn't cut it for large scenes, with multiple meshes and textures (also lighting and fog info is useful).
Ah yes, that would be true. I thought you were only using the model for characters and stuff- MD2 is no good for whole scenes of objects.
Quote:
Original post by Genjix
With the 3DS, yes your loader was most helpful, so ive written a chunk parser... but i still get how 3ds deals with textures. how does it know which faces a texture is mapped to? I can't find anything to relate to this (is it the faces have a texture id, or the textures have a list of faces?).
I think it doesn't map specific textures onto specific faces, but rather onto a whole object. I'm not too sure about this- but I presume this is the way it works from using 3D modellers.
I'd help you out but I was unable to find any decent information myself on loading 3DS files beyond the very basics.. This was one of the main reasons i've decided to switch to MD2 instead.
Perhaps someone here at gamedev has some knowledge of this- or better still a working parser with these features included?
Just listen to what Tom mentioned - look at ASE files!
3DS MAX has a slightly confusing (at least from an OpenGL/D3D point of view) way of storing geometry information.
Faces are separated into positions, normals, textures and vertex colours.
The number of faces doesn't have to match (with the exception of positions and normals).
You will have to load them separately and merge them after loading (e.g. selecting the corresponding texture vertex from the TFaces list for each face).
3DS MAX has a slightly confusing (at least from an OpenGL/D3D point of view) way of storing geometry information.
Faces are separated into positions, normals, textures and vertex colours.
The number of faces doesn't have to match (with the exception of positions and normals).
You will have to load them separately and merge them after loading (e.g. selecting the corresponding texture vertex from the TFaces list for each face).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement