예제 #1
0
파일: run.py 프로젝트: omgimanerd/graphics
    def set_knob(self, knob_name, from_frame, to_frame, from_value, to_value):
        """
        Sets a variable knob in the animation.

        Parameters:
        knob_name: str, the name of the knob
        from_frame: int, the frame that this knob starts changing at
        to_frame: int, the frame that this knob stops changing at
        from_value: int, the value that this knob starts at
        to_value: int, the value that this knob stops at
        """
        if knob_name in self.knobs:
            self.knobs[knob_name] = [0 for x in range(self.frames)]
        else:
            self.knobs[knob_name] = Generator.get_knob_range(
                self.frames, from_frame, to_frame, from_value, to_value)
예제 #2
0
파일: run.py 프로젝트: omgimanerd/graphics
    def set_knob(self, knob_name, from_frame, to_frame, from_value, to_value):
        """
        Sets a variable knob in the animation.

        Parameters:
        knob_name: str, the name of the knob
        from_frame: int, the frame that this knob starts changing at
        to_frame: int, the frame that this knob stops changing at
        from_value: int, the value that this knob starts at
        to_value: int, the value that this knob stops at
        """
        if knob_name in self.knobs:
            self.knobs[knob_name] = [0 for x in range(self.frames)]
        else:
            self.knobs[knob_name] = Generator.get_knob_range(
                self.frames, from_frame, to_frame, from_value, to_value)
예제 #3
0
파일: main.py 프로젝트: omgimanerd/graphics
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()
예제 #4
0
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()