Beispiel #1
0
                     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],
                                  4.0, 0.2)
myextrude.buf[1].set_draw_details(shinesh, [patimg, shapebump, shapeshine],
                                  4.0, 0.2)
myextrude.buf[2].set_draw_details(shinesh, [shapeshine, shapebump, shapeshine],
                                  4.0, 0.2)

mycone = pi3d.Cone(radius=1, height=2, sides=24, name="Cone", x=-4, y=-1, z=10)
mycylinder = pi3d.Cylinder(radius=0.7,
                           height=1.5,
Beispiel #2
0
for x in range(0, 270):
    shape.append((sin(radians(x)), cos(radians(x))))
shape.append((0, 0))

shape2 = []
shape2.append((0, 0))

for x in range(270, 361):
    shape2.append((sin(radians(x)), cos(radians(x))))
shape2.append((0, 0))

myextrude = pi3d.Extrude(CAMERA3D,
                         path=shape,
                         height=0.4,
                         name="Extrude",
                         x=0,
                         y=0,
                         z=3)
myextrude.set_alpha(0.7)
myextrude.set_material((1, 0.6, 0.0))
myextrude.set_draw_details(matl, [], 0.0, 1.0)

myextrude2 = pi3d.Extrude(CAMERA3D,
                          path=shape2,
                          height=0.5,
                          name="Extrude2",
                          x=-0.1,
                          y=0,
                          z=0.1)
myextrude2.set_alpha(0.8)