I asked my students to write a note on how OpenGL determines whether

front- and back-facing. Essentially, Iwas inviting them to elaborate

on the following from my notes -- in turn copied from the Red Book:

"

Front- or back-facing depends on the sign of the polygon's area

computed in window coordinates. We can compute this area as:

a = \frac{1}{2} \sum_{i=0}^{n-1} x_i y_{i \oplus 1} - x_{i \oplus 1}

y_{i},

where $i \oplus 1 = (i+1) \mod n$ and where $x_i$ and $y_i$ are the

\emph{window} coordinates of the $i$th vertex of the $n$ vertex

polygon. $i \oplus 1 = (i+1) \mod n$ simply wraps around back to zero

at $i=n$, i.e. there is no $i=n$, so we go back to the first (zeroth

index) point.

If \verb|GL_CCW| has been specified, if $a>0$, the polygon is

considered to be front-facing; otherwise, it is back-facing.

"

Mostly, they gave answers based on the sign of the scalar product of

the viewing point and the normal to the face. Which seems reasonable;

unless OpenGL actually uses the former, and the former is easier to

compute.

Any suggestions?

TIA,

Jon C.

Since OpenGL can't draw non-planar polygons, it amounts to the same result

but since a normal is easier to compute...

All planar convex polygons get tessellated. OpenGL doesn't do non-planar or

concave poygons, so the formulation is overkill.

Note that it is *computed* face normal, NOT the normal(s) you supply for

lighting.

jbw

1. How to determine front face vs back face

2. Face it: Facebook loses face as the face as microsoft spaces gazes at strange faces

3. Bush had to face Kerry for the first time, face to face

4. Kreg LFC Face Clamps 6-Inch Large Face Clamp

5. *****Java Lead Required in FLORIDA***** Must come for a face to face interview

6. *****Java Lead Required in FLORIDA***** Must come for a face to face interview

9. Biasotti Advanced Modeling 101 thought... fit face to a set of faces

10. Bold face for font-lock-comment-face

11. Face and X-Face with Emacs 21.2.1 on Windows 2000

12. *****Java Lead Required in FLORIDA***** Must come for a face to face interview

13. anyone whose field is face location and face feature extraction add me

14. For All of you who could not fae aa man face to face

15. Need Java Developer, Davis CA - Near Sacramento, Face to Face interview on Monday

2 post • Page:**1** of **1**