Ok, here is how to do it:

you have a view vector formed by the this difference:

LookAtPoint - CameraPosition

You also have your polygon (positioned in world, scaled and rotated). You also have the transformed normal of this polygon.

To find if this polygon is back facing, find the dot product of the view vector and the transformed polygon normal and check if it’s negative. If it is - polygon is not visible!

Hi there,

I have a theoretical question about back-face culling.

A back-facing polygon is one where the angle between the normal for the polygon’s front face and the viewing vector (towards the eye) is less than 90 degrees. This can be tested using the dot product of these two vectors and the sign (positive or negative) tells us if the face is facing the front or the back.

The question is whether to use:

- the vector from the lookat point (centre of view) to the eye/camera, or

- the vector from a point on the polygon to the eye/camera

In some situations, the results are the same, but not all, it seems.

I’ve read a few textbooks, and have mixed results. Most talk about the second option, but Hearn & Baker (3rd ed) uses the first option, and I’m not sure if it’s always right.

It might have something to do with whether the polygon is actually visible or not - such as if the polygon is in front of the viewer it’s front-facing, but as it moves further to the side and the angle using the second vector changes, when the dot product changes sign, the polygon is actually outside of the field of vision… maybe.

Does anyone have any suggestions or knowledge they can add?

Thank you,

Lindsay