Where bitmap data for materials is stored in 3DS files?

53 views
Skip to first unread message

Boris Kuchin

unread,
Jun 20, 2012, 3:26:34 PM6/20/12
to lib3ds
Hi.

I need to save 3d-model data in 3DS format. I have one simple object:
bunch of vertices, triangles and texture coordinates. Also I have
single texture for all faces, only texture coordinates are changing.
So, I basically understand how to store vertices and faces data. But
I've looked through code and I have no idea how to store texture in
3DS file. There is "texture map" chunk but it is just a bunch of flags
with no bitmap data storage available. I think that for "texture"
materials you need to store texture bitmaps somewhere.

So, I have these questions at the moment:

1. Where bitmap data should be stored, what format should it be in and
how it should be referenced from material description?
2. Are texture coordinates normalized to (1, 1) as it is by default in
OpenGL or should they be set directly in pixels?
3. How should I set flags for ambient and other types of reflection
(first three chunks in material group I believe) to get some "general"
material appearance? No gloss or other special material effects. Just
texture.

Thanks in advance for your replies.

Jan Eric Kyprianidis

unread,
Jun 20, 2012, 3:29:12 PM6/20/12
to lib...@googlegroups.com
You may want to have a look at the cube example.

Борис Кучин

unread,
Jun 25, 2012, 1:07:11 PM6/25/12
to lib...@googlegroups.com, lib...@googlegroups.com
Thanks a lot. This example indeed has answers to all of the my questions. Just thought I could be able to figure this stuff from sources. Being unable to store bitmap data in 3DS file itself is a bit of disappointment.

Anyway, thanks for the great library!

20.06.2012, в 23:29, Jan Eric Kyprianidis <jkyp...@googlemail.com> написал(а):

Reply all
Reply to author
Forward
0 new messages