Exemple #1
0
def create_holder(name, x, y=0, z=0, s=1, r=(0, 0, 0), t=0, taichi_s=0.9):
    material = tc.create_surface_material('pbr')
    rep = Texture.create_taichi_wallpaper(20, rotation=t, scale=taichi_s)
    diff = 0.1 * rep
    spec = 0.6 * rep
    material.initialize(
        P(diffuse_map=diff.id, specular_map=spec.id, glossiness=300))

    mesh = tc.create_mesh()
    mesh.initialize(P(filename=map_filename(name)))
    mesh.set_material(material)
    mesh.translate(Vector(x, y, z))
    mesh.scale_s(s)
    mesh.rotate_euler(Vector(*r))
    return mesh