Probably requires #12 first. Comparison has to happen in view space. Eye vector would then be a forward vector.
Possible implementation of backface culling:
bool cullBackFacingTriangle(const Vec3 & eye, const Vec3 & v0,
const Vec3 & v1, const Vec3 & v2)
{
// Plane equation of the triangle will give us its orientation
// which can be compared with the viewer's world position.
//
const Vec3 d = crossProduct(v2 - v0, v1 - v0);
const Vec3 c = v0 - eye;
return dotProduct3(c, d) <= 0.0f; // Returns true if it should be discarded
}
Probably requires #12 first. Comparison has to happen in view space. Eye vector would then be a forward vector.
Possible implementation of backface culling: