Beispiel #1
0
    def initial_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)

        sphere_node_2 = Sphere()
        sphere_node_2.translate(-2, 0, -2)
        sphere_node_2.color_index = 1
        self.scene.add_node(sphere_node_2)
Beispiel #2
0
    def initial_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)

        sphere_node_2 = Sphere()
        sphere_node_2.translate(-2, 0, -2)
        sphere_node_2.color_index = 1
        self.scene.add_node(sphere_node_2)
Beispiel #3
0
    def create_sample_scene(self):

        cube_node = Cube()

        cube_node.translate(2, 0, 2)

        cube_node.rotate(0, 0, 0)

        cube_node.scale_init(1.0, 1.0, 1.0)

        cube_node.color_index = 1

        self.scene.add_node(cube_node)

        file_name = "new1.mol2"
        for cont, pos in enumerate(readmol.get_mol_info(file_name)[1]):

            sphere_node = Sphere()

            sphere_node.translate(pos[0], pos[1], pos[2])

            sphere_node.scale_init(2.0, 2.0, 2.0)

            sphere_node.color_index = readmol.get_mol_info(file_name)[0][str(
                cont + 1)][1] * 10

            self.scene.add_node(sphere_node)
Beispiel #4
0
 def create_sample_scene(self):
     #创建一个球体
     sphere_node = Sphere()
     #设置球体的颜色
     sphere_node.color_index = 2
     sphere_node.translate(2,2,0)
     sphere_node.scale(12)
     #将球体放进场景中,默认在正中央
     self.scene.add_node(sphere_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)

        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 #6
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 #7
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 #8
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 #9
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 #10
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)