This topic is 4935 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I'm working on a quite simple 3ds loader and have two questions for those of you who might have already had the pleasure 1) is it just me or are the triangles stored clock-wise? (I haven't done much 3d programming, but afaik faces are usually stored counter-clock-wise... Just want to know if I have a bug (I could also flip the normals I compute as a workaround) or if it's really so (I've also had a ASCII export generated and it also IMHO has the faces (the face's vertices) stored CW) 2) will the vertex list always be before the face list? (in other words, has anyone of you experienced that? I have not yet) thanks for your help PS: I haven't found this info anywhere, I've been looking for it, but all the documents I've read just say there's a xyz triplet and that there are those chunks present, but not the order is to be relied upon.

##### Share on other sites
Quote:
 Original post by Caesar1) is it just me or are the triangles stored clock-wise? (I haven't done much 3d programming, but afaik faces are usually stored counter-clock-wise... Just want to know if I have a bug (I could also flip the normals I compute as a workaround) or if it's really so (I've also had a ASCII export generated and it also IMHO has the faces (the face's vertices) stored CW)

IIRC, you are correct - the faces are stored CW. This makes sense, because 3ds Max stores its verts in CW order, too.

##### Share on other sites
I did a quick check for you with my own loader, and the faces in the 3ds file I tested are stored CCW. However, the vertices themselves were stored CW. So:

21   0

with facelist: 1 0 2

Good luck with the loader. If you have any problems let me know. I'm going to be writing a small tutorial on this within the next few months, so I'll be doing this stuff anyway.

Edit: something is screwing up my ASCII art.

##### Share on other sites
ah, I see. Thank you both guys, you were very helpful. Took some time to figure out how you mean it, but cool, now I get it:)

PS: if I find a mail in your profile rick, I'll mail you, ok?

##### Share on other sites
While you could invert the normal, you could just switch the first and third index in a face. You are reading them one by one anyway (assuming you're ignoring the face flags) so you could read indices[2] indices[1] indices[0] in this order for each face. Since all of them are CW then flipping them as such will make them CCW.

1. 1
2. 2
3. 3
4. 4
Rutin
16
5. 5

• 12
• 9
• 12
• 37
• 12
• ### Forum Statistics

• Total Topics
631419
• Total Posts
2999981
×