Example #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
Example #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
Example #3
0
 def identity(self):
     """
     Sets the current TransformationMatrix on the stack to the identity
     matrix.
     """
     self.matrix_stack[-1] = TransformationMatrix.identity()
Example #4
0
 def identity(self):
     """
     Sets the current TransformationMatrix on the stack to the identity
     matrix.
     """
     self.matrix_stack[-1] = TransformationMatrix.identity()