Esempio n. 1
0
ectex = EnvironmentCube.loadECfiles('textures/ecubes/Miramar', 'miramar_256',
                                    suffix='png')
myecube = EnvironmentCube.EnvironmentCube(size=1800.0, maptype='FACES')
myecube.set_draw_details(flatsh, ectex)

# Create elevation map
mapwidth = 2000.0
mapdepth = 2000.0
mapheight = 100.0
mountimg1 = Texture('textures/mountains3_512.jpg')
bumpimg = Texture('textures/grasstile_n.jpg')
tigerbmp = Texture('models/Tiger/tiger_bump.jpg')
topbmp = Texture('models/Tiger/top_bump.jpg')
#roadway = Texture('textures/road5.png')
mymap = ElevationMap(mapfile='textures/mountainsHgt2.png',
                     width=mapwidth, depth=mapdepth,
                     height=mapheight, divx=64, divy=64)

mymap.buf[0].set_draw_details(shader, [mountimg1, bumpimg], 128.0, 0.0)

FOG = (0.7, 0.8, 0.9, 0.5)

def set_fog(shape):
  shape.set_fog(FOG, 1000.0)

def make_model(filename, name, x=0, y=0, z=0, rx=0, ry=0, rz=0):
  model = Model(file_string='models/' + filename,
                name=name, x=x, y=y, z=z, rx=rx, ry=ry, rz=rz,
                sx=0.1, sy=0.1, sz=0.1)
  model.set_shader(shader)
  set_fog(model)
Esempio n. 2
0
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)
mymap.set_fog((0.1, 0.1, 0.1, 1.0), 200.0)

#Create tree models
treeplane = Plane(w=4.0, h=5.0)

treemodel1 = MergeShape(name="baretree")
treemodel1.add(treeplane.buf[0], 0, 0, 0)
treemodel1.add(treeplane.buf[0], 0, 0, 0, 0, 90, 0)
Esempio n. 3
0
TFOG = ((0.1, 0.14, 0.12, 0.3), 150.0)

#myecube = EnvironmentCube(900.0,"HALFCROSS")
ectex = loadECfiles("textures/ecubes", "sbox")
myecube = EnvironmentCube(size=900.0, maptype="FACES", name="cube")
myecube.set_draw_details(flatsh, ectex)

# Create elevation map
mapwidth = 1000.0
mapdepth = 1000.0
mapheight = 60.0
mountimg1 = Texture("textures/mountains3_512.jpg")
mymap = ElevationMap("textures/mountainsHgt.jpg",
                     name="map",
                     width=mapwidth,
                     depth=mapdepth,
                     height=mapheight,
                     divx=32,
                     divy=32)  #testislands.jpg
mymap.buf[0].set_draw_details(shader, [mountimg1, bumpimg, reflimg], 128.0,
                              0.0)
mymap.set_fog(*FOG)

#Create tree models
treeplane = Plane(w=4.0, h=5.0)

treemodel1 = MergeShape(name="baretree")
treemodel1.add(treeplane.buf[0], 0, 0, 0)
treemodel1.add(treeplane.buf[0], 0, 0, 0, 0, 90, 0)

treemodel2 = MergeShape(name="bushytree")
Esempio n. 4
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
mapdepth = 50.0
maphalf = 22.0
mapheight = 40.0

mymap = ElevationMap("textures/pong.jpg",
                     camera=camera,
                     light=light,
                     width=mapwidth,
                     depth=mapdepth,
                     height=mapheight,
                     divx=32,
                     divy=32,
                     ntiles=4,
                     name="sub")
mymap.buf[0].set_draw_details(shader, [groundimg, groundimg, ballimg], 1.0,
                              0.0)

#avatar camera
avhgt = 2.0
xm = 0.0
zm = 0.0
ym = 0.0
lastX0 = 0.0
lastZ0 = 0.0
camera.position((xm, 2 + ym, -maphalf - 2.5))
Esempio n. 5
0
reflcn = Texture("textures/stars.jpg")

#load environment cube
ectex = loadECfiles("textures/ecubes", "sbox_interstellar")
myecube = EnvironmentCube(size=900.0, maptype="FACES")
myecube.set_draw_details(flatsh, ectex)

# Create elevation map
mapwidth = 1000.0
mapdepth = 1000.0
mapheight = 60.0
mountimg1 = Texture("textures/mars_colour.png")
bumpimg = Texture("textures/mudnormal.jpg")
mymap = ElevationMap(mapfile="textures/mars_height.png",
                     width=mapwidth,
                     depth=mapdepth,
                     height=mapheight,
                     divx=128,
                     divy=128)
mymap.set_draw_details(shader, [mountimg1, bumpimg], 128.0, 0.0)
mymap.set_fog((0.3, 0.15, 0.1, 0.1), 300.0)

#create robot
metalimg = Texture("textures/metalhull.jpg")
robot_head = Sphere(radius=1.0)
robot_body = Cylinder(radius=1.0, height=2.0, sides=12)
robot_leg = Cuboid(w=0.35, h=2.0)

robot = MergeShape()
robot.add(robot_head.buf[0], 0.0, 1.6)
robot.add(robot_body.buf[0], 0.0, 0.5)
robot.add(robot_leg.buf[0], -1.04, 0, 0)