flatsh = Shader("shaders/uv_flat") #======================================== # load Textures rockimg1 = Texture("textures/techy1.jpg") rockimg2 = Texture("textures/rocktile2.jpg") tree2img = Texture("textures/tree2.png") raspimg = Texture("textures/Raspi256x256.png") monstimg = Texture("textures/pong2.jpg") monsttex = Texture("textures/floor_nm.jpg") shineimg = Texture("textures/stars.jpg") # environment cube ectex = Texture("textures/ecubes/skybox_stormydays.jpg") myecube = EnvironmentCube(size=900.0, maptype="CROSS") myecube.set_draw_details(flatsh, ectex) # Create elevation map mapwidth = 1000.0 mapdepth = 1000.0 mapheight = 100.0 mymap = ElevationMap("textures/maze1.jpg", width=mapwidth, depth=mapdepth, height=mapheight, divx=128, divy=128, name="sub") mymap.set_draw_details(shader, [rockimg1, rockimg2, shineimg], 128.0, 0.05) # Create fog for more realistic fade in distance. This can be turned on and off between drawing different object (i.e backgound not foggy)
shader = Shader("shaders/uv_light") flatsh = Shader("shaders/uv_flat") print("==============================================================") print("Instructions:") print("") print("Keys- W - Forward,") print(" A - Left S - Back D - right") print("") print("Move mouse to pan view. Click mouse to exit or press ESCAPE") print("==============================================================") ectex = loadECfiles("textures/ecubes","sbox") myecube = EnvironmentCube(size=900.0, maptype="FACES", name="bfa", y=50.0) myecube.set_draw_details(flatsh, ectex) # load model_loadmodel mymodel = Model(file_string="models/Buckfast Abbey/BuckfastAbbey.egg", name="Abbey", rx=90, sx=0.03, sy=0.03, sz=0.03) mymodel.set_shader(shader) # Create keyboard and mouse event objects mykeys = Keyboard() mymouse = Mouse(restrict = False) mymouse.start() #screenshot number scshots = 1
# load shader shader = Shader("shaders/uv_reflect") flatsh = Shader("shaders/uv_flat") defocus = Defocus() #======================================== # Setting 2nd param to True renders 'True' Blending # (this can be changed later to 'False' with 'rockimg2.blend = False') groundimg = Texture("textures/stripwood.jpg") monstimg = Texture("textures/pong3.png") ballimg = Texture("textures/pong2.jpg") # environment cube ectex = Texture("textures/ecubes/skybox_stormydays.jpg") myecube = EnvironmentCube(camera, light, 900.0, "CROSS") myecube.set_draw_details(flatsh, [ectex]) #ball maxdsz = 0.3 radius = 1.0 ball = Sphere(camera, light, radius, 12, 12, 0.0, "sphere", -4, 8, -7) # Shape.set_draw_details is a wrapper for calling the method on each item in buf # as is done explicitly here for no reason than to show that it can be done! ball.buf[0].set_draw_details(shader, [ballimg], 0.0, 0.0) #monster monster = Plane(camera, light, 5.0, 5.0, "monster", 0, 0, 0, 0, 0, 0) monster.buf[0].set_draw_details(flatsh, [monstimg]) # Create elevation map mapwidth = 50.0
#select the environment cube with 'box'... box = 3 if box == 0: ectex = [Texture('textures/ecubes/skybox_interstellar.jpg')] myecube = EnvironmentCube(size=900.0, maptype='CROSS') elif box == 1: ectex = [Texture('textures/ecubes/SkyBox.jpg')] myecube = EnvironmentCube(size=900.0, maptype='HALFCROSS') elif box == 2: ectex = loadECfiles('textures/ecubes', 'sbox_interstellar', nobottom=True) myecube = EnvironmentCube(size=900.0, maptype='FACES', nobottom=True) else: ectex = loadECfiles('textures/ecubes', 'skybox_hall') myecube = EnvironmentCube(size=900.0, maptype='FACES') myecube.set_draw_details(shader, ectex) rot = 0.0 tilt = 0.0 # Fetch key presses mykeys = Keyboard() mymouse = Mouse(restrict=False) mymouse.start() omx, omy = mymouse.position() CAMERA = Camera.instance() # Display scene and rotate cuboid while DISPLAY.loop_running():
#select the environment cube with 'box'... box = 3 if box == 0: ectex = [Texture('textures/ecubes/skybox_interstellar.jpg')] myecube = EnvironmentCube(size=900.0, maptype='CROSS') elif box == 1: ectex = [Texture('textures/ecubes/SkyBox.jpg')] myecube = EnvironmentCube(size=900.0, maptype='HALFCROSS') elif box == 2: ectex = loadECfiles('textures/ecubes','sbox_interstellar', nobottom=True) myecube = EnvironmentCube(size=900.0, maptype='FACES', nobottom=True) else: ectex = loadECfiles('textures/ecubes','skybox_hall') myecube = EnvironmentCube(size=900.0, maptype='FACES') myecube.set_draw_details(shader, ectex) rot = 0.0 tilt = 0.0 # Fetch key presses mykeys = Keyboard() mymouse = Mouse(restrict=False) mymouse.start() omx, omy = mymouse.position() CAMERA = Camera.instance() # Display scene and rotate cuboid while DISPLAY.loop_running():
# load shader shader = Shader("shaders/uv_reflect") flatsh = Shader("shaders/uv_flat") defocus = Defocus() #======================================== # Setting 2nd param to True renders 'True' Blending # (this can be changed later to 'False' with 'rockimg2.blend = False') groundimg = Texture("textures/stripwood.jpg") monstimg = Texture("textures/pong3.png") ballimg = Texture("textures/pong2.jpg") # environment cube ectex = Texture("textures/ecubes/skybox_stormydays.jpg") myecube = EnvironmentCube(camera, light, 900.0,"CROSS") myecube.set_draw_details(flatsh, [ectex]) #ball maxdsz = 0.3 radius = 1.0 ball = Sphere(camera, light, radius,12,12,0.0,"sphere",-4,8,-7) # Shape.set_draw_details is a wrapper for calling the method on each item in buf # as is done explicitly here for no reason than to show that it can be done! ball.buf[0].set_draw_details(shader,[ballimg], 0.0, 0.0) #monster monster = Plane(camera, light, 5.0, 5.0, "monster", 0,0,0, 0,0,0) monster.buf[0].set_draw_details(flatsh, [monstimg]) # Create elevation map mapwidth=50.0