Beispiel #1
0
                ym = mymap.calcHeight(xm, zm) + avhgt
        elif k == 115:  #kry S
            xm += math.sin(math.radians(rot))
            zm -= math.cos(math.radians(rot))
            ym = mymap.calcHeight(xm, zm) + avhgt
        elif k == 39:  #key '
            tilt -= 2.0
        elif k == 47:  #key /
            tilt += 2.0
        elif k == 97:  #key A
            rot -= 2
        elif k == 100:  #key D now used for point_at monolith!
            rot += 2
            tilt, rot = CAMERA.point_at(
                [monolith.x(), monolith.y(),
                 monolith.z()])
        elif k == 112:  #key P
            screenshot("forestWalk" + str(scshots) + ".jpg")
            scshots += 1
        elif k == 10:  #key RETURN
            mc = 0
        elif k == 27:  #Escape key
            mykeys.close()
            mymouse.stop()
            DISPLAY.stop()
            break
        else:
            print(k)

    # for opaque objects it is more efficient to draw from near to far as the
    # shader will not calculate pixels already concealed by something nearer
Beispiel #2
0
       xm -= math.sin(math.radians(rot))
       zm += math.cos(math.radians(rot))
       ym = mymap.calcHeight(xm, zm) + avhgt
   elif k==115:  #kry S
     xm += math.sin(math.radians(rot))
     zm -= math.cos(math.radians(rot))
     ym = mymap.calcHeight(xm, zm) + avhgt
   elif k==39:   #key '
     tilt -= 2.0
   elif k==47:   #key /
     tilt += 2.0
   elif k==97:   #key A
     rot -= 2
   elif k==100:  #key D now used for point_at monolith!
     rot += 2
     tilt, rot = CAMERA.point_at([monolith.x(), monolith.y(), monolith.z()])
   elif k==112:  #key P
     screenshot("forestWalk"+str(scshots)+".jpg")
     scshots += 1
   elif k==10:   #key RETURN
     mc = 0
   elif k==27:  #Escape key
     mykeys.close()
     mymouse.stop()
     DISPLAY.stop()
     break
   else:
     print(k)
 
 # for opaque objects it is more efficient to draw from near to far as the
 # shader will not calculate pixels already concealed by something nearer