Beispiel #1
0
    def __init__(self):
        self.skytex = pi3d.loadTexture("textures/SkyBox.png")
        #self.greentex = pi3d.loadTexture("textures/green-grid.png")
        self.greentex = pi3d.loadTexture("textures/mountains3_256.jpg")
        self.walltex = pi3d.loadTexture('textures/grey-stripe.png')
        self.coffeetex = pi3d.loadTexture('textures/coffee.png')

        self.sky = pi3d.createEnvironmentCube(900.0,'CROSS')
        self.ground = pi3d.createCuboid(800,400,0.1,'ground',0,0,0)

        self.J1G = Box('J1G',125,80,15)
        self.J1U = Box('J1U',105,40,10, 20,20,self.J1G.height)
        self.J1L = Box('J1L',15,16,6, 30,32,self.J1G.height+self.J1U.height)
        self.J1_f1 = Box('', 4,44,18, 50,18,self.J1G.height)
        self.J1_f2 = Box('', 4,44,18, 64,18,self.J1G.height)
        #J1 = pi3d.createMergeShape('J1')
        #J1.add(J1G, 0,0,0)
        ##J1.add(J1U, 20,20,J1G.height)
        ##J1.add(J1L, 30,32,J1G.height+J1U.height)
        ##J1.add(J1_f, 50,18,J1G.height)
        #J1.add(J1_f, 64,18,J1G.height)

        #self.j1 = J1
        #self.j1 = Box('J1', 10,4,2, -6, 15)
        #self.j1l = Box('J1L', 2,2,1, -5, 16, 2)

        self.torus = pi3d.createTorus(2, 0.6, 12, 24, "Torus", -4,2,-17)
        self.rasp = pi3d.createTube(0.4, 0.1, 1.5, 24, "tube", 4,3,-15, 30,0,0)
Beispiel #2
0
    def __init__(self):
        self.skytex = pi3d.loadTexture("textures/SkyBox.png")
        #self.greentex = pi3d.loadTexture("textures/green-grid.png")
        self.greentex = pi3d.loadTexture("textures/mountains3_256.jpg")
        self.walltex = pi3d.loadTexture('textures/grey-stripe.png')
        self.coffeetex = pi3d.loadTexture('textures/coffee.png')

        self.sky = pi3d.createEnvironmentCube(900.0,'CROSS')
        self.ground = pi3d.createCuboid(800,400,0.1,'ground',0,0,0)

        self.j1 = Box('J1', 10,4,2, -6, 15)
        self.j1l = Box('J1L', 2,2,1, -5, 16, 2)

        self.torus = pi3d.createTorus(2, 0.6, 12, 24, "Torus", -4,2,-17)
        self.rasp = pi3d.createTube(0.4, 0.1, 1.5, 24, "tube", 4,3,-15, 30,0,0)
Beispiel #3
0
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",
                                           mapwidth, mapdepth, mapheight, 128,
                                           128)  #testislands.jpg

#create robot
metalimg = texs.loadTexture("textures/metalhull.jpg")
robot_head = pi3d.createSphere(2.0, 12, 12, 0.5, "", 0, 3, 0)
robot_body = pi3d.createCylinder(2.0, 4, 12, "", 0, 1, 0)
robot_leg = pi3d.createCuboid(0.7, 4.0, 1.0, "", 0, 0.8, 0)

robot = pi3d.createMergeShape()
robot.add(robot_head)
robot.add(robot_body)
robot.add(robot_leg, -2.1, 0, 0)
robot.add(robot_leg, 2.1, 0, 0)

#create space station
ssphere = pi3d.createSphere(10, 16, 16)
scorrid = pi3d.createCylinder(4, 22, 12)

station = pi3d.createMergeShape("", 0, mymap.calcHeight(0, 0), 0, 0, 0, 0, 4,
                                4, 4)
station.add(ssphere, -20, 0, -20)
station.add(ssphere, 20, 0, -20)
Beispiel #4
0
#load environment cube
ectex = pi3d.loadECfiles("textures/ecubes","sbox_interstellar")
myecube = pi3d.createEnvironmentCube(900.0,"FACES")

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

#create robot 
metalimg = pi3d.loadTextureAlpha("textures/metalhull.jpg")
robot_head= pi3d.createSphere(2.0,12,12,0.5,"",0,3,0)
robot_body = pi3d.createCylinder(2.0,4,12,"",0,1,0)
robot_leg = pi3d.createCuboid(0.7,4.0,1.0,"",0,0.8,0)

robot = pi3d.createMergeShape()
robot.add(robot_head)
robot.add(robot_body)
robot.add(robot_leg, -2.1,0,0)
robot.add(robot_leg, 2.1,0,0)

#create space station
ssphere = pi3d.createSphere(10,16,16)
scorrid = pi3d.createCylinder(4,22,12)

station = pi3d.createMergeShape("",0,mymap.calcHeight(0,0),0, 0,0,0, 4,4,4)
station.add(ssphere, -20,0,-20)
station.add(ssphere, 20,0,-20)
station.add(ssphere, 20,0,20)
Beispiel #5
0
def Box(name, w,d,h, gx=0.0,gy=0.0,gz=0.0):
    return pi3d.createCuboid(w,d,h, name, gx+w*0.5, gz+h*0.5, -gy-d*0.5)