+ # translate and rotate according to the object matrix
+ # and then translate according to the camera position
+ #m = obj.getMatrix()
+ #m.transpose()
+
+ #a = m*Vector(face[0]) - Vector(cameraObj.loc)
+ #b = m*Vector(face[1]) - Vector(cameraObj.loc)
+ #c = m*Vector(face[numvert-1]) - Vector(cameraObj.loc)
+
+ a = []
+ a.append(face[0][0])
+ a.append(face[0][1])
+ a.append(face[0][2])
+ a = RotatePoint(a[0], a[1], a[2], obj.RotX, obj.RotY, obj.RotZ)
+ a[0] += obj.LocX - camera.LocX
+ a[1] += obj.LocY - camera.LocY
+ a[2] += obj.LocZ - camera.LocZ
+ b = []
+ b.append(face[1][0])
+ b.append(face[1][1])
+ b.append(face[1][2])
+ b = RotatePoint(b[0], b[1], b[2], obj.RotX, obj.RotY, obj.RotZ)
+ b[0] += obj.LocX - camera.LocX
+ b[1] += obj.LocY - camera.LocY
+ b[2] += obj.LocZ - camera.LocZ
+ c = []
+ c.append(face[numvert-1][0])
+ c.append(face[numvert-1][1])
+ c.append(face[numvert-1][2])
+ c = RotatePoint(c[0], c[1], c[2], obj.RotX, obj.RotY, obj.RotZ)
+ c[0] += obj.LocX - camera.LocX
+ c[1] += obj.LocY - camera.LocY
+ c[2] += obj.LocZ - camera.LocZ
+
+ norm = Vector([0,0,0])
+ norm[0] = (b[1] - a[1])*(c[2] - a[2]) - (c[1] - a[1])*(b[2] - a[2])
+ norm[1] = -((b[0] - a[0])*(c[2] - a[2]) - (c[0] - a[0])*(b[2] - a[2]))
+ norm[2] = (b[0] - a[0])*(c[1] - a[1]) - (c[0] - a[0])*(b[1] - a[1])
+
+ d = norm[0]*a[0] + norm[1]*a[1] + norm[2]*a[2]
+ # d = DotVecs(norm, Vector(a))
+
+ return (d<0)
+
+ def _doClipping(face):