Front face vs back face
-
was there some rule about the order of the vertices that determined the orientation of front vs back?
-
I have a vague recollection of it being bogus, although that might be my imagination.
-
I believe TIG posted an explanation of this recently. I forgot what the thread was about though.
Chris
-
From my recollection:
face.outer_loop.vertices
will give you the vertices in counter-clockwise order wrt to the front side of the face
face.vertices
will give you vertices in no particular order -
face.outer_loop.vertices
### is a counter-clockwise collection...loops=face.loop-[face.outer_loop]
### other internal loops...loops.each{|loop|verts=loop.vertices}
### each of these 'verts' collections is clockwise... -
So if the vertices are added clockwise vs counter-clockwise affects front vs back when you create faces?
-
@thomthom said:
So if the vertices are added clockwise vs counter-clockwise affects front vs back when you create faces?
In SU there is right hand rule used. If the normal of a face is pointing towards you, the vertices has to go counter-clockwise.
-
"Towards you"? Where does one assume "you" are located? I take it it's related to the global axes?
-
@thomthom said:
"Towards you"? Where does one assume "you" are located? I take it it's related to the global axes?
'You' being on the side of the face pointed at by the front face normal. Global axis is irrelevant.
-
The right-hand rule: imagine holding the face's normal vector [axis' if you will] in your right-hand, with you thumb pointing in the + direction. Your fingers will curl counter-clockwise.
That rule applies to a face's outer_loop's vertices array.
It also applies to rotations etc about an axis etc...It's opposite for any inner_loops vertices array - i.e. clockwise.
It doesn't matter which direction/order the face's edges were originally drawn: an array of the loop's vertices is always returned ordered in that particular way - ccw or cw.
The vertices' order does affect the face's normal when drawing faces: however, SUp does seem to have that overriding rule to draw a face with its normal pointing down IF the face's Z=0 !!!
Advertisement