1
$\begingroup$

Suppose I have one convex polyhedron, I need to detect back face. And $N=(A, B, C)$ is normal vector of polygon surface and vector $V$ in viewing direction. According to books formula and internet content if $V. N>0$ then polygon is back face otherwise front face.

We know that $V. N=|V|.|N|cos\theta$ from this when we consider $\pi/2<\theta<=\pi$ then $V. N<0$ $\implies$ front face. And when we consider $0°<=\theta<=\pi/2$ then $V. N>0$ $\implies$ back face.

Case:1 Now suppose in this case for front face where $V$ and $N$ are parallel to each then they makes angle 0°.Then we get $V. N>0$ but according to books formula when $V. N<0$ then we will get front face.

:enter image description here

Case:2 Again I consider the case for back face where $V$ along with $N$ then they makes angle 180°.Then we get $V. N<0$ but according to books formula when $V. N>0$ then we will get back face. enter image description here

My question is where I mistaken to understand the detect the back face and front face for the above cases with formula $V. N >0 or <0?$

$\endgroup$
0

1 Answer 1

1
$\begingroup$

Now suppose in this case for front face where V and N are parallel to each then they makes angle 0°.

In your example, V and N are pointing in opposite directions. The angle between them is 180 degrees, so the cosine is -1. Similarly:

Again I consider the case for back face where V along with N then they makes angle 180°.

If V and N are pointing in the same direction, then the angle between them is 0 degrees, so the cosine is 1.

You have these backwards; that's why you're getting the wrong value.

$\endgroup$
8
  • 1
    $\begingroup$ if I consider N for front face with the same direction of V that means if I consider N is opposite side of front face, then V and N has 0° angle, then above formula flipped for front face and back face? $\endgroup$
    – Alok Maity
    Jan 27 at 20:48
  • 2
    $\begingroup$ @Sagorika The formula is sensitive to the way you calculate N from the points of the face. If N = (A,B,C), then also -N = (C,B,A). So when checking each face, you must be careful to order the points correctly and consistently. $\endgroup$
    – luser droog
    Jan 27 at 23:35
  • $\begingroup$ @luser droog if I consider N for front face with the same direction of V that means if I consider N is opposite side of front face, then V and N has 0° angle, then above formula flipped for front face and back face, that means front face formula and angles becomes back face formula and angle and vice versa? Am I correct? $\endgroup$
    – Alok Maity
    Jan 28 at 6:32
  • $\begingroup$ @Sagorika: Your comment didn't make any more sense the second time you repeated it than the first. N cannot be both the front face and the opposite side of the front face at the same time. So your question is gibberish. $\endgroup$ Jan 28 at 7:03
  • $\begingroup$ @Nicol Bolas I am saying instead of N pointing towards me, it pointing opposite side of the front face then front face formula and angle flipped with back face formula and angle? $\endgroup$
    – Alok Maity
    Jan 28 at 7:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.