Archived

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

Yehia Mohammed

Loading 3ds ASC files..

Recommended Posts

Hi, I need help with loading 3ds asc files... when descriping a face we find something like this : Face 2: A:4 B:5 C:7 AB:1 BC:1 CA:0 I know that numbers after A,B and C is the vertex index, but what is AB,BC and CA ? and why do they get either 0 or 1 ? Thanks in advance.

Share this post


Link to post
Share on other sites
the 1s and 0s are binary for the direction of the triangle winding. for example, "AB: 1" means the line goes from point A to B. if its "AB: 0" means the line goes from point B to A. get it?

Share this post


Link to post
Share on other sites
I believe the reason is for backface culling...depending on the order vertices are in (counter-clockwise or clockwise), it will cull the other side, unless you like, tell it not to...

Its been a long time since Ive worked with opengl, so I dont remember if backface culling is on by default and if its ccw or cw by default

Later,
Lord Hen

[edited by - Lord Hen on August 6, 2003 6:05:37 AM]

Share this post


Link to post
Share on other sites
adam17: how sure are you about that information? The 3ds documentation I read claimed these flags were for ''visibility'' and was very vague on the subject. If it is for winding order then the original data posted by Yehia Mohammed makes no sense, and further more the format is overspecified. Only one line direction needs to be known to compute the winding because after you know the direction of one line the directions of the other lines can be calculated (they must form a closed loop).

The data given in the original post, using your interpretation for the flags gives the triangle:

B
/ ^
/ \
/ \
v \
C<--------A


now is that clockwise or counter-clockwise? Am I missing/not understanding something?

Enigma

Share this post


Link to post
Share on other sites
Enigma : what exactly do you mean by visibility ? I think what adam17 posted will make sense if these information are used to calculate the normal to give the right light effects, and this can be done by using the cross product .Even if two points were pointing to the third, this will not affect the result as this depende on the normal direction(vector). I have to say that I''m not sure if this is the real reason but it make sense!!

Share this post


Link to post
Share on other sites