示例#1
0
station.add(scorrid, 0, 0, 20, 90, 90, 0)
station.add(scorrid, 0, 0, -20, 90, 90, 0)

#avatar camera
rot = 0.0
tilt = 0.0
avhgt = 2.0
xm = 0.0
zm = 0.0
ym = -(mymap.calcHeight(xm, zm) + avhgt)

# Fetch key presses
mykeys = pi3d.key()
mymouse = pi3d.mouse()
mymouse.start()
mtrx = pi3d.matrix()

omx = mymouse.x
omy = mymouse.y

myfog = pi3d.fog(0.002, (0.3, 0.8, 0.6, 0.5))
mylight = pi3d.createLight(0, 1, 1, 1, "", 10, 10, 10, .9, .7, .6)

# Display scene and rotate cuboid
while 1:
    display.clear()

    mtrx.identity()
    #tilt can be used as a means to prevent the view from going under the landscape!
    if tilt < -1: sf = 1.0 / -tilt
    else: sf = 1.0
示例#2
0
文件: Earth.py 项目: frankier/pi3d
moonimg = pi3d.loadTexture("textures/moon.jpg")
starsimg = pi3d.loadTexture("textures/stars2.jpg")
watimg = pi3d.loadTexture("textures/water.jpg")
	
mysphere = pi3d.createSphere(2,24,24,0.0,"earth",0,0,0)
mysphere2 = pi3d.createSphere(2.05,24,24,0.0,"clouds",0,0,0)
mymoon = pi3d.createSphere(0.4,16,16,0.0,"moon",0,0,0)
mymoon2 = pi3d.createSphere(0.1,16,16,0.0,"moon2",0,0,0)

arialFont = pi3d.font("AR_CENA","#dd00aa")   #load AR_CENA font and set the font colour to 'raspberry'
destineFont = pi3d.font("AR_DELANEY", "#0055ff")

# Fetch key presses
mykeys = pi3d.key()

mtrx = pi3d.matrix()

rot=0.0
rot1=0.0
rot2=0.0

#create a light
mylight = pi3d.createLight(0,1,1,1,"",10,10,50, .8,.8,.8)

# Display scene
while 1:
    display.clear()
	
    mylight.off()
    pi3d.sprite(starsimg, 0,0,-20, 25,25,rot)
    rot=rot+0.02
示例#3
0
文件: Amazing.py 项目: becky1166/pi3d
xm=0.0
zm=0.0
ym= -(mymap.calcHeight(xm,zm)+avhgt)
lastX0=0.0
lastZ0=0.0

# Fetch key presses
mykeys = pi3d.key()
mymouse = pi3d.mouse()
mymouse.start()

omx=mymouse.x
omy=mymouse.y

lastTm = time.time()
m = pi3d.matrix()
fly = False
walk = False
# Display scene and rotate cuboid
angle = 0
while 1:
    display.clear()
    
    pi3d.identity()
    pi3d.rotate(tilt,0,0)
    pi3d.rotate(0,rot,0)
    pi3d.position(xm,ym,zm)
    
    myecube.draw(ectex,xm,ym,zm)
    myfog.on()
    mymap.draw(rockimg1)