Exemplo n.º 1
0
    def __init__(self, width, height):
        """
        Constructors for the Drawing class.

        Parameters:
        width: int, the width of the image in pixels
        height: int, the height of the image in pixels
        """
        self.width = width
        self.height = height
        self.picture = Picture(width, height)
        self.pixel_depths = [[float("-inf") for x in range(width)] for y in range(height)]
        self.matrix_stack = [TransformationMatrix.identity()]
        self.view_vector = None
Exemplo n.º 2
0
    def __init__(self, width, height):
        """
        Constructors for the Drawing class.

        Parameters:
        width: int, the width of the image in pixels
        height: int, the height of the image in pixels
        """
        self.width = width
        self.height = height
        self.picture = Picture(width, height)
        self.pixel_depths = [[float("-inf") for x in range(width)]
                             for y in range(height)]
        self.matrix_stack = [TransformationMatrix.identity()]
        self.view_vector = None
Exemplo n.º 3
0
 def identity(self):
     """
     Sets the current TransformationMatrix on the stack to the identity
     matrix.
     """
     self.matrix_stack[-1] = TransformationMatrix.identity()
Exemplo n.º 4
0
 def identity(self):
     """
     Sets the current TransformationMatrix on the stack to the identity
     matrix.
     """
     self.matrix_stack[-1] = TransformationMatrix.identity()