示例#1
0
def loadLevel(next_level):
  print(">>> Please wait while maze is constructed...")
  next_level=next_level%len(levelList)
  building = pi3d.Building(levelList[next_level], 0, 0, mymap,
      width=MAP_BLOCK, depth=MAP_BLOCK, height=30.0,
      name="", draw_details=details, yoff=-15, scheme=mazeScheme)
  return building
示例#2
0
# details is an array of the same size as models array (defined above as part of the dict {"#models":4,..} )
# contains information corresponding with Buffer.set_draw_details()
details = [
    [shader, [blockimg, blockimg], 1.0, 0.0, 4.0, 12.0],
    [shader, [greenimg, greenimg], 1.0, 0.0, 4.0, 4.0],
    [shader, [roofimg, blockimg], 1.0, 0.0, 4.0, 4.0],
    [shader, [roofedgeimg], 0.0, 0.0, 4.0, 4.0],
]

building = pi3d.Building("textures/silo_map.png",
                         0,
                         0,
                         mymap,
                         width=15.0,
                         depth=15.0,
                         height=70.0,
                         name="",
                         draw_details=details,
                         yoff=-15,
                         scheme=openSectionSchemeMultimodel)

outLight = pi3d.Light(lightpos=(10, -10, 20),
                      lightcol=(1.0, 1.0, 0.7),
                      lightamb=(0.35, 0.35, 0.4))
inLight = pi3d.Light(lightpos=(10, -10, 20),
                     lightcol=(0.1, 0.1, 0.15),
                     lightamb=(0.05, 0.15, 0.1))
for b in building.model:
    b.set_light(inLight, 0)
mymap.set_light(inLight, 0)