Beispiel #1
0
display.create3D(50,50,display.max_width-100,display.max_height-100)   	# x,y,width,height
display.setBackColour(0.2,0.4,0.6,1)    # r,g,b,alpha

# load model_loadmodel
texs = Textures()
mymodel = Model("models/Triceratops/Triceratops.egg",texs,"Triceratops", 0,-1,0, -90,0,0, .005,.005,.005)

# Fetch key presses
mykeys = Keyboard()

# mastrix and rotate variables
rot=0

#create a light
mylight = Light(0,1,1,1,"",10,10,0)
mylight.on()

while 1:
  display.clear()

  Utility.load_identity()
  Utility.translatef(0,0, -40)
  Utility.rotatef(rot, 0, 1, 0)
  rot += 3

  mymodel.draw()

  k = mykeys.read()
  if k >-1:
    if k==112: display.screenshot("Triceratops.jpg")
    elif k==27:
Beispiel #2
0
display.setBackColour(0.4,0.8,0.8,1)      # r,g,b,alpha

# Load textures
texs = Textures()
tree2img = texs.loadTexture("textures/tree2.png")
tree1img = texs.loadTexture("textures/tree1.png")
grassimg = texs.loadTexture("textures/grass.png")
hb2img = texs.loadTexture("textures/hornbeam2.png")

#myecube = EnvironmentCube(900.0,"HALFCROSS")

ectex=loadECfiles("textures/ecubes","sbox",texs)
myecube = EnvironmentCube(900.0,"FACES")

light = Light(0, 10,10,10, "", 0,100,0)
light.on()

# Create elevation map
mapwidth=1000.0
mapdepth=1000.0
mapheight=60.0
mountimg1 = texs.loadTexture("textures/mountains3_512.jpg")
mymap = ElevationMap("textures/mountainsHgt.jpg",mapwidth,mapdepth,mapheight,64,64) #testislands.jpg

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

treemodel1 = MergeShape("baretree")
treemodel1.add(treeplane, 0,0,0)
treemodel1.add(treeplane, 0,0,0, 0,90,0)