コード例 #1
0
    #Create a Transformation Set
    TS1 = Tf.Transform()
    #Add several transformations to the set
    TS1.AddTransf(Tf.Rotation(130, 3))
    TS1.AddTransf(Tf.Translation(2, 2))
    TS1.AddTransf(Tf.Translation(1, 3))
    TS1.AddTransf(Tf.Translation(1, 1))
    #Create a new Tetrahedron by applying the
    #transformation set to the first tetrahedron
    TH2 = TH1.ApplyTransf(TS1)
    #Add the Tetrahedra to the Renderer
    rend.AddObject(TH1)
    rend.AddObject(TH2)
else:
    #Load a mesh
    TH1 = Sh.Mesh('boltmesh', (200, 20, 50))
    #Add the Tetrahedra to the Renderer
    rend.AddObject(TH1)

#Create a new transformation set and
#add Rotation tranformations to the set
#(These will be the transformations changed
# in the GUI to make the objects rotate)
TS2 = Tf.Transform()
TS2.AddTransf(Tf.Rotation(0, 1))
TS2.AddTransf(Tf.Rotation(0, 2))
TS2.AddTransf(Tf.Translation(0, 1))
TS2.AddTransf(Tf.Translation(0, 2))

#Create First Light Source
L1O = Sh.Point(5, 0, 2)  #Point of origin (not used for now)