Remove cross product culling

This commit is contained in:
Richard Zink committed 2026-10-06 16:38:37 +02:00
1 parent dadb46b273
commit e19f5e57ec
1 file changed
-5
-5
View File
@@ -124,11 +124,6 @@
draw() { draw() {
this.triangles.sort((a, b) => b.depth - a.depth); this.triangles.sort((a, b) => b.depth - a.depth);
this.triangles.forEach(tri => { this.triangles.forEach(tri => {
const v1 = { x: tri.p2.x - tri.p1.x, y: tri.p2.y - tri.p1.y, z: tri.p2.z - tri.p1.z };
const v2 = { x: tri.p3.x - tri.p1.x, y: tri.p3.y - tri.p1.y, z: tri.p3.z - tri.p1.z };
const crossZ = v1.x * v2.y - v1.y * v2.x;
if (crossZ >= 0) return;
const proj1 = tri.p1.project(); const proj1 = tri.p1.project();
const proj2 = tri.p2.project(); const proj2 = tri.p2.project();
const proj3 = tri.p3.project(); const proj3 = tri.p3.project();