예제 #1
0
# Loading EGG model
# =================
# This example - Copyright (c) 2012 - Tim Skillman
# EGG loader code by Paddy Gaunt, Copyright (c) 2012
# Version 0.02 - 20Jul12

import pi3d

# Setup display and initialise pi3d
display = pi3d.display(100,100,1200,900)
display.setBackColour(0.2,0.4,0.6,1)    # r,g,b,alpha

# load model_loadmodel
texs = pi3d.textures()
mymodel = pi3d.loadModel("models/Triceratops/Triceratops.egg",texs,"Triceratops", 0,-1,-40, -90,0,0, .005,.005,.005)
    
# Fetch key presses
mykeys = pi3d.key()

#create a light
mylight = pi3d.createLight(0,1,1,1,"",10,10,0)
mylight.on()
    
while 1:
    display.clear()

    mymodel.draw()
    mymodel.rotateIncY(3)
    
    k = mykeys.read()
    if k >-1:
예제 #2
0
#
# before running this example
#

import pi3d, math, random

rads = 0.017453292512  # degrees to radians

# Setup display and initialise pi3d
display = pi3d.display()
display.create3D(100, 100, 1600, 800, 0.5, 800.0,
                 60.0)  # x,y,width,height,near,far,aspect
display.setBackColour(0.4, 0.8, 0.8, 1)  # r,g,b,alpha

# Load textures
texs = pi3d.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")

#load environment cube
ectex = pi3d.loadECfiles("textures/ecubes", "sbox_interstellar", texs)
myecube = pi3d.createEnvironmentCube(900.0, "FACES")

# Create elevation map
mapwidth = 1000.0
mapdepth = 1000.0
mapheight = 60.0
mountimg1 = texs.loadTexture("textures/mars_colour.png")
mymap = pi3d.createElevationMapFromTexture("textures/mars_height.png",