<s> from __future__ import absolute_import , division , print_function , unicode_literals <EOL> """<STR_LIT>""" <EOL> import math , random , time <EOL> import demo <EOL> import pi3d <EOL> rads = <NUM_LIT> <EOL> winw , winh = <NUM_LIT> , <NUM_LIT> <EOL> DISPLAY = pi3d . Display . create ( tk = True , window_title = '<STR_LIT>' , <EOL> w = winw , h = winh , far = <NUM_LIT> , fov = <NUM_LIT> , <EOL> background = ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:1> ) , frames_per_second = <NUM_LIT:20> ) <EOL> win = DISPLAY . tkwin <EOL> flatsh = pi3d . Shader ( "<STR_LIT>" ) <EOL> shade2d = pi3d . Shader ( '<STR_LIT>' ) <EOL> splash = pi3d . ImageSprite ( "<STR_LIT>" , shade2d , w = <NUM_LIT:10> , h = <NUM_LIT:10> , z = <NUM_LIT> ) <EOL> splash . draw ( ) <EOL> DISPLAY . swap_buffers ( ) <EOL> ectex = pi3d . loadECfiles ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , nobottom = True ) <EOL> myecube = pi3d . EnvironmentCube ( size = <NUM_LIT> , maptype = "<STR_LIT>" , nobottom = True ) <EOL> myecube . set_draw_details ( flatsh , ectex ) <EOL> hall = pi3d . Model ( file_string = "<STR_LIT>" , name = "<STR_LIT>" , sx = <NUM_LIT:0.1> , sy = <NUM_LIT:0.1> , sz = <NUM_LIT:0.1> ) <EOL> hall . set_shader ( flatsh ) <EOL> mymouse = pi3d . Mouse ( restrict = False ) <EOL> mymouse . start ( ) <EOL> omx , omy = mymouse . position ( ) <EOL> mouserot = - <NUM_LIT> <EOL> tilt = <NUM_LIT> <EOL> avhgt = <NUM_LIT> <EOL> xm = <NUM_LIT:0.0> <EOL> zm = <NUM_LIT:0.0> <EOL> ym = avhgt <EOL> CAMERA = pi3d . Camera . instance ( ) <EOL> try : <EOL> while DISPLAY . loop_running ( ) : <EOL> CAMERA . reset ( ) <EOL> """<STR_LIT>""" <EOL> if tilt < - <NUM_LIT:1> : sf = <NUM_LIT:1.0> / - tilt <EOL> else : sf = <NUM_LIT:1.0> <EOL> CAMERA . rotate ( tilt , mouserot , <NUM_LIT:0> ) <EOL> CAMERA . position ( ( xm , ym , zm ) ) <EOL> hall . draw ( ) <EOL> myecube . rotateIncY ( <NUM_LIT> ) <EOL> myecube . draw ( ) <EOL> mx , my = mymouse . position ( ) <EOL> mouserot -= ( mx - omx ) * <NUM_LIT> <EOL> tilt += ( my - omy ) * <NUM_LIT> <EOL> omx = mx <EOL> omy = my <EOL> try : <EOL> win . update ( ) <EOL> except Exception as e : <EOL> print ( "<STR_LIT>" , e ) <EOL> DISPLAY . destroy ( ) <EOL> try : <EOL> win . destroy ( ) <EOL> except : <EOL> pass <EOL> mymouse . stop ( ) <EOL> exit ( ) <EOL> if win . ev == "<STR_LIT>" : <EOL> print ( "<STR_LIT>" ) <EOL> DISPLAY . resize ( win . winx , win . winy , win . width , win . height ) <EOL> CAMERA . reset ( ( DISPLAY . near , DISPLAY . far , DISPLAY . fov , <EOL> DISPLAY . width / float ( DISPLAY . height ) ) ) <EOL> win . resized = False <EOL> if win . ev == "<STR_LIT:key>" : <EOL> if win . key == "<STR_LIT:w>" : <EOL> xm -= math . sin ( mouserot * rads ) * <NUM_LIT:2> <EOL> zm += math . cos ( mouserot * rads ) * <NUM_LIT:2> <EOL> if win . key == "<STR_LIT:s>" : <EOL> xm += math . sin ( mouserot * rads ) * <NUM_LIT:2> <EOL> zm -= math . cos ( mouserot * rads ) * <NUM_LIT:2> <EOL> if win . key == "<STR_LIT:a>" : <EOL> mouserot -= <NUM_LIT:2> <EOL> if win . key == "<STR_LIT:d>" : <EOL> mouserot += <NUM_LIT:2> <EOL> if win . key == "<STR_LIT:p>" : <EOL> pi3d . screenshot ( "<STR_LIT>" ) <EOL> if win . key == "<STR_LIT>" : <EOL> try : <EOL> print ( "<STR_LIT>" ) <EOL> DISPLAY . destroy ( ) <EOL> try : <EOL> win . destroy ( ) <EOL> except : <EOL> pass <EOL> mymouse . stop ( ) <EOL> exit ( ) <EOL> except : <EOL> pass <EOL> if win . ev == "<STR_LIT>" or win . ev == "<STR_LIT>" or win . ev == "<STR_LIT>" : <EOL> xm -= math . sin ( mouserot * rads ) * <NUM_LIT:2> <EOL> zm += math . cos ( mouserot * rads ) * <NUM_LIT:2> <EOL> else : <EOL> win . ev = "<STR_LIT>" <EOL> except Exception as e : <EOL> print ( "<STR_LIT>" , e ) <EOL> DISPLAY . destroy ( ) <EOL> try : <EOL> win . destroy ( ) <EOL> except : <EOL> pass <EOL> mymouse . stop ( ) <EOL> exit ( ) </s>
