<p>Let's assume you have a one legged triangular table standing directly next to a wall. The leg points downwards, in one of the two normal directions of the triangle plane (the other is upwards). Now you want to push the table closer to the wall. So you cut off the corner(s) of the triangle closest to the wall with a cut parallel to the wall, so that you can push the remaining table closer to the wall. After doing this observe that the leg of the table points still in the same direction as before: downwards, so the normal direction of the table (normal direction of new clipped triangle) did not change.</p>

CC BY-SA 4.0
2024-12-03T17:27:14.923Z
2024-12-03T17:28:32.273Z
2024-12-03T17:28:32.273Z
luta
<p>Trying to comprehend clipping algorithm given by</p>
<pre><code>ClipTriangle(triangle, plane) {
    d0 = SignedDistance(plane, triangle.v0)
    d1 = SignedDistance(plane, triangle.v1)
    d2 = SignedDistance(plane, triangle.v2)

    if {d0, d1, d2} are all positive {
        return [triangle]
    } else if {d0, d1, d2} are all negative {
        return []
    } else if only one of {d0, d1, d2} is positive {
        let A be the vertex with a positive distance
        compute B' = Intersection(AB, plane)
        compute C' = Intersection(AC, plane)
        return [Triangle(A, B', C')]
    } else /* only one of {d0, d1, d2} is negative */ {
        let C be the vertex with a negative distance
        compute A' = Intersection(AC, plane)
        compute B' = Intersection(BC, plane)
        return [Triangle(A, B, A'), Triangle(A', B, B')]
    }
}
</code></pre>
<p>Let consider case when one point inside frustum. I don't understand why normal direction of new clipped triangle is kept for all cases.</p>
<p>I do enclose awful drawing, but it shows that when upper vertex inside frustum - normal direction is negative (Assuming left handed coordinate system)</p>
<p>What do I get wrong about it? I'm sure I made a mistake somewhere.</p>
<p>Sorry for awful plot =(</p>
<p><a href="https://i.sstatic.net/TpleNefJ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TpleNefJ.png" alt="Different clipping cases" /></a></p>

CC BY-SA 4.0
2024-12-05T11:12:20.077Z
I don't see the "normal" direction at all in the listed pseudocode. However even if it is listed the plane that the triangle lies in doesn't change when clipping it so the normal direction for the triangle stays the same. The only way it would change is if the winding direction of the triangle is changed in which case it would be negated.
pmw1234
<clipping>
Clipping triangle normal direction
Pyrettt Pyrettt
# Clipping triangle normal direction

(Asked by: username_0 on 2024-08-28)

Trying to comprehend clipping algorithm given by

```
ClipTriangle(triangle, plane) {
    d0 = SignedDistance(plane, triangle.v0)
    d1 = SignedDistance(plane, triangle.v1)
    d2 = SignedDistance(plane, triangle.v2)

    if {d0, d1, d2} are all positive {
        return [triangle]
    } else if {d0, d1, d2} are all negative {
        return []
    } else if only one of {d0, d1, d2} is positive {
        let A be the vertex with a positive distance
        compute B' = Intersection(AB, plane)
        compute C' = Intersection(AC, plane)
        return [Triangle(A, B', C')]
    } else /* only one of {d0, d1, d2} is negative */ {
        let C be the vertex with a negative distance
        compute A' = Intersection(AC, plane)
        compute B' = Intersection(BC, plane)
        return [Triangle(A, B, A'), Triangle(A', B, B')]
    }
}

```

Let consider case when one point inside frustum. I don't understand why normal direction of new clipped triangle is kept for all cases.

I do enclose awful drawing, but it shows that when upper vertex inside frustum - normal direction is negative (Assuming left handed coordinate system)

What do I get wrong about it? I'm sure I made a mistake somewhere.

Sorry for awful plot =(

[![Different clipping cases](https://i.sstatic.net/TpleNefJ.png)](https://i.sstatic.net/TpleNefJ.png)

**Tags:** clipping

> **Comments:**
> **username_1**: I don't see the "normal" direction at all in the listed pseudocode. However even if it is listed the plane that the triangle lies in doesn't change when clipping it so the normal direction for the triangle stays the same. The only way it would change is if the winding direction of the triangle is changed in which case it would be negated.  

---

## 1 answers

### Answer by username_2 on 2024-12-03. Score: 0

Let's assume you have a one legged triangular table standing directly next to a wall. The leg points downwards, in one of the two normal directions of the triangle plane (the other is upwards). Now you want to push the table closer to the wall. So you cut off the corner(s) of the triangle closest to the wall with a cut parallel to the wall, so that you can push the remaining table closer to the wall. After doing this observe that the leg of the table points still in the same direction as before: downwards, so the normal direction of the table (normal direction of new clipped triangle) did not change.


---

