opengl - how to know when vertices are counterclockwise -
how know if vertices counter clockwise? this: s.o. page
says if cross negative clockwise. how can vector negative? doesn't make sense.
your question one. answer nontrivial.
you right cross product of 2 vectors yields third vector , none of these vectors negative such. however, common use of cross product either [a] take divergence of (which not apply in case) or [b] dot-multiply fourth vector. dot product scalar which, of course, can indeed negative.
in case, fourth vector vector 1 vertex or of polygon observer's viewpoint. check sign of resulting dot product, , tell whether rotation counterclockwise (positive) or clockwise (negative) as seen observer.
the disadvantage of technique seems abstract not versed in vector algebra. however, disadvantage far outweighed advantage: cross-and-dot technique blazing fast.
Comments
Post a Comment