0
\$\begingroup\$

I have a Triangle with an intersecting Ray.

How can I find out if the triangle's vertices are in a clockwise or counter clockwise rotation order with respect to the Ray?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

Assume the triangle's vertices are wound in the order A, B, C

Form a normal to the triangle N = (B - A) x (C - A)

Now you can detect whether your triangle is clockwise or counter-clockwise by the sign of the dot product between this normal and the ray direction

In a left-handed coordinate system:

  • Negative = Clockwise from ray's point of view
  • Positive = Counter-clockwise from ray's point of view

In a right-handed coordinate system, it's the opposite:

  • Negative = Counter-clockwise from ray's point of view
  • Positive = Clockwise from ray's point of view
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .