Determine if point is in frustum
<p>I'm trying to work out the best way to determine whether a point is inside a frustum. I have something working, but not sure whether it is too cumbersome, and perhaps there is a more elegant / efficient way I should be doing this.</p>

<p>Suppose I want to find out whether point 'x' is inside a frustrum:</p>

<p><a href="https://i.stack.imgur.com/5WIGM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5WIGM.jpg" alt="Frustum example"></a></p>

<p>Once I have the locations of the 8 points of the frustrum (4 near points, four far points), I am calculating the normal for each plane of the frustum based on a triangle made from three of the points. For example (as in the diagram above), for the right side, I am making two vectors from three of the points:</p>

<pre><code>Vector U = FBR - NBR
Vector V = FTR - NBR
</code></pre>

<p>Then I am making the cross product between these two vectors, ensuring that the winding order is correct for the normal to be pointing inside the frustum, in this case <code>V x U</code> will give the correct normal.</p>

<pre><code>Right_normal = V x U
</code></pre>

<p>Once I have the normal for each plane, I am then checking whether point x is in front of or behind the plane by drawing a vector from x to one of the plane's points:</p>

<pre><code>Vector xNBR = x - NBR
</code></pre>

<p>Then I am doing the dot product between this vector and the normal and testing whether the answer is positive, confirming whether point x is the correct side of that plane of the frustrum:</p>

<pre><code>if ( xNBR . Right_normal &lt; 0 )
{
    return false;
}
else continue testing x against other planes...
</code></pre>

<p>If x is positive for all planes, then it is inside the frustum.</p>

<p>So this seems to work, but I'm just wondering whether I'm doing this in a stupid way. I didn't even know what 'cross product' meant until yesterday, so it's all rather new to me and I might be doing something rather silly.</p>