示例#1
0
                     z=10)
myhelix = pi3d.Helix(radius=0.4,
                     thickness=0.1,
                     ringrots=12,
                     sides=24,
                     rise=1.5,
                     loops=3.0,
                     name="helix",
                     x=0,
                     y=2,
                     z=10)
mytube = pi3d.Tube(radius=0.4,
                   thickness=0.1,
                   height=1.5,
                   sides=24,
                   name="tube",
                   x=2,
                   y=2,
                   z=10,
                   rx=30)
myextrude = pi3d.Extrude(path=((-0.5, 0.5), (0.5, 0.7), (0.9, 0.2),
                               (0.2, 0.05), (1.0, 0.0), (0.5, -0.7), (-0.5,
                                                                      -0.5)),
                         height=0.5,
                         name="Extrude",
                         x=4,
                         y=2,
                         z=10)
# Extrude can use three different textures if they are loaded prior to draw()
myextrude.set_shader(shinesh)
myextrude.buf[0].set_draw_details(shinesh, [coffimg, shapebump, shapeshine],
                         h=480,
                         z=7500)

shader = pi3d.Shader("uv_light")
shinesh = pi3d.Shader("uv_reflect")
flatsh = pi3d.Shader("uv_flat")
matsh = pi3d.Shader("mat_reflect")
matl = pi3d.Shader("mat_light")

test = pi3d.Texture('backgrounds/IMG-20160924-WA0008.jpg')

myglass = pi3d.Tube(CAMERA3D,
                    radius=0.3,
                    sides=30,
                    thickness=0.05,
                    height=1,
                    name="Glass",
                    x=0,
                    y=0,
                    z=0)  #child has z = 0
#myglass.set_alpha(0.4)
#myglass.set_material((0.1,0.1,0.1))
#myglass.set_draw_details(matl, [], 0.0, 1.0)

mybottom = pi3d.Cylinder(radius=0.3, height=0.05, sides=30, y=0, x=0, z=0)

#mybottom.set_draw_details(shinesh, [], 0.0, 0.5)

mywater = pi3d.Cylinder(
    radius=0.295, sides=30, height=0.7, y=0.1,
    x=0.1)  #y= (glassheight - waterheight / 2) - bottomheight