Example #1
0
    def calculateNormals(self, fast=False):
        if self._vertices is None:
            return

        if self.hasIndices() and not fast:
            self._normals = calculateNormalsFromIndexedVertices(self._vertices, self._indices, self._face_count)
        else:
            self._normals = calculateNormalsFromVertices(self._vertices, self._vertex_count)
    def calculateNormals(self, fast=False):
        if self._vertices is None:
            return

        if self.hasIndices() and not fast:
            self._normals = calculateNormalsFromIndexedVertices(self._vertices, self._indices, self._face_count)
        else:
            self._normals = calculateNormalsFromVertices(self._vertices, self._vertex_count)
Example #3
0
    def calculateNormals(self, fast=False):
        """Calculate the normals of this mesh, assuming it was created by using addFace (eg; the verts are connected)

        Keyword arguments:
        - fast: A boolean indicating whether or not to use a fast method of normal calculation that assumes each triangle
        is stored as a set of three unique vertices.
        """

        if self._vertices is None:
            return

        if self.hasIndices() and not fast:
            self._normals = calculateNormalsFromIndexedVertices(
                self._vertices, self._indices, self._face_count)
        else:
            self._normals = calculateNormalsFromVertices(
                self._vertices, self._vertex_count)