Can't get culling working, it seems to recognize that some faces aren't supposed to be drawn, but some aspects are still being shown even though they are completely blocked off.
Anyone any idea's to fix this? current algo for culling is..
Code:
public boolean Cull(Triangle3D Triangle) {
return (Dot(
Cross(Sub(Triangle.a, Triangle.b),
Sub(Triangle.a, Triangle.c)),
CamPos) <= 0);
}
CamPos is a vector (0, 0, -20)
Edit : Triangle3D is just a triangle with 3 vectors. (X1, Y1, Z1), (X2, Y2, Z2), (X3, Y3, Z3)