Beispiel #1
0
    def create_sample_scene(self):
        cube_node = Cube()
        cube_node.translate(2, 0, 2)
        cube_node.color_index = 1
        self.scene.add_node(cube_node)

        sphere_node = Sphere()
        sphere_node.translate(-2, 0, 2)
        sphere_node.color_index = 3
        self.scene.add_node(sphere_node)

        hierarchical_node = SnowFigure()
        hierarchical_node.translate(-2, 0, -2)
        self.scene.add_node(hierarchical_node)
Beispiel #2
0
    def create_sample_scene(self):
        cube_node = Cube()
        cube_node.translate(2, 0, 2)
        cube_node.color_index = 2
        self.scene.add_node(cube_node)

        sphere_node = Sphere()
        sphere_node.translate(-2, 0, 2)
        sphere_node.color_index = 3
        self.scene.add_node(sphere_node)

        hierarchical_node = SnowFigure()
        hierarchical_node.translate(-2, 0, -2)
        self.scene.add_node(hierarchical_node)
Beispiel #3
0
    def create_sample_scene(self):
        # to create a ball
        sphere_node = Sphere()
        # to set the ball's color
        sphere_node.color_index = 2
        sphere_node.translate(2, 2, 0)
        sphere_node.scale(4)

        #to put the ball in the scene.Default middle of view
        self.scene.add_node(sphere_node)

        #to add a snowman
        hierarchical_node = SnowFigure()
        hierarchical_node.translate(-2, 0, 2)
        hierarchical_node.scale(2)
        self.scene.add_node(hierarchical_node)
Beispiel #4
0
    def create_sample_scene(self):
        # 创建一个立方体
        cube_node = Cube()
        cube_node.translate(2, 0, 2)
        cube_node.color_index = 1
        self.scene.add_node(cube_node)

        # 创建一个球体
        sphere_node = Sphere()
        # 设置球体颜色
        sphere_node.color_index = 2
        sphere_node.translate(2, 2, 0)
        sphere_node.scale(4)
        # 将球体放入场景
        self.scene.add_node(sphere_node)
        # 添加雪人
        hierarchical_node = SnowFigure()
        hierarchical_node.translate(-2, 0, -2)
        hierarchical_node.scale(2)
        self.scene.add_node(hierarchical_node)
Beispiel #5
0
    def create_sample_scene(self):
        cube_node = Cube()
        cube_node.translate(2, 0, 2)
        cube_node.color_index = 1
        self.scene.add_node(cube_node)

        # to create a ball
        sphere_node = Sphere()
        # to set the ball's color
        sphere_node.color_index = 3
        sphere_node.translate(-2, 0, 2)

        #to put the ball in the scene.Default middle of view
        self.scene.add_node(sphere_node)

        #to add a snowman
        hierarchical_node = SnowFigure()
        hierarchical_node.translate(-2, 0, -2)
        self.scene.add_node(hierarchical_node)

        init_primitives()
Beispiel #6
0
    def create_sample_scene(self):
        """
        #创建一个球体
        sphere_node = Sphere()
        #设置球体的颜色
        sphere_node.color_index = 2
        #将球体放进场景中,默认在正中央
        self.scene.add_node(sphere_node)
        """

        cube_node = Cube()
        cube_node.translate(0, 0, 0)
        cube_node.scale(3)
        cube_node.color_index = 1
        self.scene.add_node(cube_node)

        sphere_node = Sphere()
        sphere_node.translate(-2, 0, 2)
        sphere_node.color_index = 3
        self.scene.add_node(sphere_node)

        hierarchical_node = SnowFigure()
        hierarchical_node.translate(-2, 0, -2)
        self.scene.add_node(hierarchical_node)