+ #d = DotVecs(Vector(norm), Vector(a))
+
+ return (d<0)
+
+ def _isFaceVisible(self, face, obj, cameraObj):
+ """Determine if the face is visible from the current camera.
+
+ The following code is taken basicly from the original vrm script.
+ """
+
+ camera = cameraObj
+
+ numvert = len(face)
+
+ # backface culling
+
+ # 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)
+
+ norm = m*Vector(face.no)
+
+ d = DotVecs(norm, a)