3D: fix culling. fixes #86. watch out for any missing polygons elsewhere.
This commit is contained in:
parent
51d29c8804
commit
4a899ebe3f
|
@ -645,9 +645,12 @@ void SubmitPolygon()
|
|||
v0 = &TempVertexBuffer[0];
|
||||
v1 = &TempVertexBuffer[1];
|
||||
v2 = &TempVertexBuffer[2];
|
||||
normalX = ((s64)v0->Position[1] * v2->Position[3]) - ((s64)v0->Position[3] * v2->Position[1]);
|
||||
normalY = ((s64)v0->Position[3] * v2->Position[0]) - ((s64)v0->Position[0] * v2->Position[3]);
|
||||
normalZ = ((s64)v0->Position[0] * v2->Position[1]) - ((s64)v0->Position[1] * v2->Position[0]);
|
||||
normalX = ((s64)(v0->Position[1]-v1->Position[1]) * (v2->Position[3]-v1->Position[3]))
|
||||
- ((s64)(v0->Position[3]-v1->Position[3]) * (v2->Position[1]-v1->Position[1]));
|
||||
normalY = ((s64)(v0->Position[3]-v1->Position[3]) * (v2->Position[0]-v1->Position[0]))
|
||||
- ((s64)(v0->Position[0]-v1->Position[0]) * (v2->Position[3]-v1->Position[3]));
|
||||
normalZ = ((s64)(v0->Position[0]-v1->Position[0]) * (v2->Position[1]-v1->Position[1]))
|
||||
- ((s64)(v0->Position[1]-v1->Position[1]) * (v2->Position[0]-v1->Position[0]));
|
||||
|
||||
while ((((normalX>>31) ^ (normalX>>63)) != 0) ||
|
||||
(((normalY>>31) ^ (normalY>>63)) != 0) ||
|
||||
|
|
Loading…
Reference in New Issue