[comp.graphics] clockwise in 3D explained

v134kkut@ubvmsa.cc.buffalo.edu (David W Tinklepaugh) (10/27/90)

So far everyone has ridiculed the idea of 'clockwise' in 3D space.  It does 
exist, it was originally what I was looking for.  What the good folks were 
referring to was 'is the clockwise side of the polygon facing towards or away 
from the center of the 3D object?'

take for example a sphere; 'are the faces clockwise in 3D space?' means 'are
they facing the inside or outside?'

obviously using the center of the object as a reference will give errors in
some instances, but I believe it is the best automated way to do it.

I just hate to see innocent people get picked on  :)

       ______________________________________________________________________
      /                               /                              \      /
     /    -Dave-   U. of Buffalo     /    Wrap it up, I'll take it!   \    /
    /   v134kkut@ubvms (bitnet)     /      -Fabulous Thunderbirds      \  /
   /_______________________________/____________________________________\/

jcs@crash.cts.com (John Schultz) (10/29/90)

In article <42882@eerie.acsu.Buffalo.EDU> v134kkut@ubvmsa.cc.buffalo.edu writes:
>So far everyone has ridiculed the idea of 'clockwise' in 3D space.  It does 
>exist, it was originally what I was looking for.  What the good folks were 
>referring to was 'is the clockwise side of the polygon facing towards or away 
>from the center of the 3D object?'
>
>take for example a sphere; 'are the faces clockwise in 3D space?' means 'are
>they facing the inside or outside?'


  Are you trying to do backface culling? If so, then just precompute
normals for all of your polygons (or define all polygons as counter-
clockwise and compute the normal when you need it (cross product)).
Then take a vector from the polygon to the viewpoint and dot that vector
with the normal vector. Angles less than zero point away, greater than
zero point towards (visible), and equal to zero are edge on.
  


  John