def __init__(self, width=512, height=512, color="#FF0000", directory="", verbose=False): """ Constructor for the Runner class. Parameters: width: int (optional), the width of the image to generate height: int (optional), the height of the image to generate color: string (optional), the hexadecimal representation of the color to use when drawing """ self.width = width self.height = height self.drawing = Drawing(width, height) self.color = Color(color) self.directory = directory self.verbose = verbose self.frames = Runner.DEFAULT_FRAMECOUNT self.basename = "%s/default_basename" % self.directory.strip("/") self.knobs = {}
def main(): drawing = Drawing(500, 500) drawing.push_matrix() drawing.translate(250, 250, 0) drawing.set_view_vector(Vector()) # drawing.rotate_y(45) drawing.rotate_x(45) drawing.rotate_z(45) sphere = Generator.get_torus_polygonmatrix(0, 0, 0, 80, 200) drawing.draw_polygonmatrix(sphere) # box = Generator.get_box_polygonmatrix(0, 0, 0, 30, 40, 50) # drawing.draw_polygonmatrix(box) drawing.pop_matrix() drawing.display()