Archived

This topic is now archived and is closed to further replies.

Aienthiwan

Face visibility in 3ds file format

Recommended Posts

Aienthiwan    122
Greetings, I am in the process of writing a *.3ds file loader, although all my initial tests have been successful, it seems that some meshes, typically more complex meshes, seem to have normal problems. It seems that for some reason certain parts of the mesh have the vertices ordered the wrong way. I''ve tried many samples from the web and typically more than half have these graphical artifacts. In looking at a 3ds spec I downloaded at wotsit.org , there''s a 4th bit in the in the vertex face list in chunk 0x4120. All documents refer to this as visibility, but the intention of this bitmask is unclear. Has anyone had any experiences with this and can confirm the usage of the following: bit 0 (AC visibility), bit 1 (BC visibility), bit 2 (AB visibility)? How do these work exactly? I wanted to hear comments from people you''ve had experience before I started experimenting. Thanks kindly, Aienthiwan

Share this post


Link to post
Share on other sites
Hauser    122
Yup. It happens. this occurs when you do a mirror on a mesh. I also had some problems with shifting objects and mirrored objects. you can''t help it, to my knowledge. (try exporting and then importing something from 3d studio max... even kinetix gets screwed up!)

so my solution was to have a load file, like
load thing.3ds
reverse Box01
yflip Line02
move Sphere01 -3.41 0 0
etc...

a little bit of work but it''s a simple hack... then i save it in my own format...

as for the vertex face chunk... beats me =)

Share this post


Link to post
Share on other sites
Aienthiwan    122
HUH?

You''re kidding right? It''s something as stupid as a glitch when mirroring values? This format''s been around for how long now.. 6-8 years?? I refuse to believe that there isn''t some sort of algorithmic solution for something as simple as a face normal screw up.. has anyone approached Autodesk with this?

Aienthiwan

Share this post


Link to post
Share on other sites
Jim Adams    440
If I remember correctly, those bits only refer to the edge if it needs to be drawn in the editor or not. It has nothing to do with actual rendering. I''ve written a .3ds loader and haven''t had any problems before with normals being switched. That''s been a while, but-

Are you reading in the normal information as well? It''s a seperate chunk - contains enough info for every vertex. Plus, you need to order the vertices in 3-2-1 order from what you are reading them in, not 1-2-3.

Jim Adams

Share this post


Link to post
Share on other sites
Aienthiwan    122
Ah ok,

That makes sense then about the visibility. As for the normals, sadly it isn''t something as simple as that. As I said, many of my models turn out perfectly, except for certain ones.

Further research and experimentation has discovered the culprit: the "Mirror Objects" button in 3dsMax. It seems that after you try to mirror something and then attach it to one object, it mutates the normals. As for a solution, I don''t know yet..

Aienthiwan

Share this post


Link to post
Share on other sites
Aienthiwan    122
Solution found!!

Really simple. Take a snapshot of the offending object as a mesh. It''ll create a replica with proper scale, transform, pivot and normals. Then export that replica and things should be fine.

I''m glad it wasn''t my code...

Aienthiwan

Share this post


Link to post
Share on other sites