示例#1
0
                       x=-4,
                       y=2,
                       z=10)
mytcone = pi3d.TCone(radiusBot=0.8,
                     radiusTop=0.6,
                     height=1,
                     sides=24,
                     name="TCone",
                     x=-2,
                     y=2,
                     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,
示例#2
0
dr = 0.0  # rolling speed
dy = 0.0  # vertical speed (for jumping)
expl = 1.0  # scale value for exploding
xb, yb, zb = platforms[0].x(), platforms[0].y() + RADIUS + 5.0, platforms[0].z(
)
# ball location coordinates
xc, yc, zc = xb, yb, zb  # set camera coords equal to ball coords

# end pole
PRADIUS = 2.0
xp, zp = 0.0, 0.0
yp = mymap.calcHeight(xp, zp) + 24
pole = pi3d.Helix(radius=PRADIUS,
                  ringrots=8,
                  thickness=0.8,
                  rise=16,
                  loops=8,
                  x=xp,
                  y=yp,
                  z=zp)
pole.set_draw_details(shader, [metlimg, flrnorm], 12.0)

# keyboard object for getting key presses
mykeys = pi3d.Keyboard()
# mouse for steering
mymouse = pi3d.Mouse(restrict=False)
mymouse.start()

CAMERA = pi3d.Camera()
# main game loop
while DISPLAY.loop_running():
    mx, my = mymouse.position()