Пример #1
0
def keyboard(key, x, y):
    global R, ALT, AZ
    global TERRAIN

    if key == 'z' and R > 10.0:
        R -= 1.0
    elif key == 'Z' and R < 50.0:
        R += 1.0
    elif key == 'w' and ALT < 45.0:
        ALT += 1.0
    elif key == 's' and ALT > -45.0:
        ALT -= 1.0
    elif key == 'a' and AZ > -90.0:
        AZ -= 1.0
    elif key == 'd' and AZ < 90.0:
        AZ += 1.0
    elif key == 'r':
        TERRAIN = midpoint_displace(32, 1.0)

    altaz_to_cart()
    glutPostRedisplay()
Пример #2
0
def setup():
    global TERRAIN
    glEnable(GL_DEPTH_TEST)
    altaz_to_cart()
    TERRAIN = midpoint_displace(32, 1.0)