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)
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)
import pi3d # Setup display and initialise pi3d display = pi3d.display() display.create3D(100,100,1200,900) # x,y,width,height display.setBackColour(0,0,0,1) # r,g,b,alpha # Load textures patimg = pi3d.loadTexture("textures/PATRN.PNG") coffimg = pi3d.loadTexture("textures/COFFEE.PNG") #Create inbuilt shapes mysphere = pi3d.createSphere(1,24,24,0.0,"sphere",-4,2,-7) mytcone = pi3d.createTCone(0.8,0.6,1,24,"TCone", -2,2,-7) myspiral = pi3d.createSpiral(0.4,0.1,12,24,1.5,3.0,"spiral", 0,2,-7) mytube = pi3d.createTube(0.4,0.1,1.5,24,"tube",2,2,-7, 30,0,0) myextrude = pi3d.createExtrude( ((-0.5, 1),(0.5,0),(0.5,-0.2),(-0.5,-0.3)), 0.05,"Extrude",4,2,-7) mycone = pi3d.createCone(1,2,24,"Cone",-4,-1,-7) mycylinder = pi3d.createCylinder(.7,1.5,24,"Cyli",-2,-1,-7) myhemisphere = pi3d.createSphere(1,24,24,0.5,"hsphere",0,-1,-7) mytorus = pi3d.createTorus(1,0.3,12,24,"Torus", 2,-1,-7) mylathe = pi3d.createLathe( ((1,0),(0.1,0.2),(0.08,0.21),(0.08,1),(0.7,1.2),(0.9, 1.4), (1.1,1.7)), 24,"Cup",4,-1,-7, 0,0,0, 0.8,0.8,0.8) arialFont = pi3d.font("AR_CENA","#dd00aa") #load AR_CENA font and set the font colour to 'raspberry' destineFont = pi3d.font("AR_Destine", "#0055ff") # Fetch key presses mykeys = pi3d.key()