# 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) station.add(ssphere, 20, 0, 20) station.add(ssphere, -20, 0, 20)
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) station.add(ssphere, -20,0,20) station.add(scorrid, -20,0,0, 90,0,0)
mapdepth=1000.0 mapheight=60.0 landimg = pi3d.loadTexture("textures/stonygrass.jpg") #surface1 = pi3d.loadTextureAlpha("textures/gravel3.png") mymap = pi3d.createElevationMapFromTexture("textures/mountainsHgt.jpg",mapwidth,mapdepth,mapheight,64,64,10.0) #testislands.jpg #mymap2 = pi3d.createElevationMapFromTexture("textures/mountainsHgt.jpg",mapwidth,mapdepth,mapheight,64,64, 128) myclip = pi3d.clipPlane() light = pi3d.createLight(0, 10,10,10, "", 0,100,0) light.on() #Create tree models treeplane = pi3d.createPlane(4.0,5.0) treemodel1 = pi3d.createMergeShape("baretree") treemodel1.add(treeplane, 0,0,0) treemodel1.add(treeplane, 0,0,0, 0,90,0) treemodel2 = pi3d.createMergeShape("bushytree") treemodel2.add(treeplane, 0,0,0) treemodel2.add(treeplane, 0,0,0, 0,60,0) treemodel2.add(treeplane, 0,0,0, 0,120,0) #Scatter them on map using Merge shape's cluster function mytrees1 = pi3d.createMergeShape("trees1") mytrees1.cluster(treemodel1, mymap,0.0,0.0,200.0,200.0,30,"",8.0,3.0) # (shape,elevmap,xpos,zpos,w,d,count,options,minscl,maxscl) mytrees2 = pi3d.createMergeShape("trees2") mytrees2.cluster(treemodel2, mymap,0.0,0.0,200.0,200.0,30,"",6.0,3.0)
hb2img = pi3d.loadTextureAlpha("textures/hornbeam2.png") ectex = pi3d.loadTexture("textures/SkyBox.png") myecube = pi3d.createEnvironmentCube(900.0,"CROSS") # Create elevation map mapwidth=1000.0 mapdepth=1000.0 mapheight=60.0 mountimg1 = pi3d.loadTexture("textures/mountains3_512.jpg") mymap = pi3d.createElevationMapFromTexture("textures/mountainsHgt.jpg",mapwidth,mapdepth,mapheight,64,64) #testislands.jpg #Create tree models treeplane = pi3d.createPlane(4.0,5.0) treemodel1 = pi3d.createMergeShape("baretree") treemodel1.add(treeplane, 0,0,0) treemodel1.add(treeplane, 0,0,0, 0,90,0) treemodel2 = pi3d.createMergeShape("bushytree") treemodel2.add(treeplane, 0,0,0) treemodel2.add(treeplane, 0,0,0, 0,60,0) treemodel2.add(treeplane, 0,0,0, 0,120,0) #Create grass model grassplane = pi3d.createPlane(1.0,0.3,"",0,-2,0) grassmodel = pi3d.createMergeShape("grass") grassmodel.add(grassplane, 0,0,0) grassmodel.add(grassplane, 0,0,0, 0,60,0) grassmodel.add(grassplane, 0,0,0, 0,120,0)
ectex = texs.loadTexture("textures/ecubes/skybox_stormydays.jpg") myecube = pi3d.createEnvironmentCube(900.0,"CROSS") # Create elevation map mapwidth=1000.0 mapdepth=1000.0 mapheight=110.0 mymap = pi3d.createElevationMapFromTexture("textures/maze1.jpg",mapwidth,mapdepth,mapheight,128,128,1,"sub",0,0,0, smooth=False) mymap2 = pi3d.createElevationMapFromTexture("textures/maze1.jpg",mapwidth,mapdepth,mapheight+0.1,128,128 ,64,"detail",0.0, 0.01, 0.0, smooth=True) myfog = pi3d.fog(0.02, (0.1,0.1,0.1,1.0)) #Create tree models treeplane = pi3d.createPlane(4.0,5.0) treemodel1 = pi3d.createMergeShape("baretree") treemodel1.add(treeplane, 0,0,0) treemodel1.add(treeplane, 0,0,0, 0,90,0) shed = pi3d.loadModel("models/shed1.obj",texs,"shed",0,3,0, 0,0,0, 2,2,2) #Scatter them on map using Merge shape's cluster function mytrees1 = pi3d.createMergeShape("trees1") mytrees1.cluster(treemodel1, mymap,0.0,0.0,900.0,900.0,10,"",8.0,3.0) # (shape,elevmap,xpos,zpos,w,d,count,options,minscl,maxscl) raspberry = pi3d.createMergeShape("rasp") raspberry.cluster(treemodel1, mymap,-250,+250,470.0,470.0,5,"",8.0,1.0) # createMergeShape can be used to join loadModel object for much greater rendering speed # however, because these objects can contain multiple vGroups, each with their own texture image # it is necessary to make a merge for each vGroup and, later, draw each merged object using each # of the textures
mapdepth=1000.0 mapheight=60.0 landimg = texs.loadTexture("textures/stonygrass.jpg") #surface1 = pi3d.loadTextureAlpha("textures/gravel3.png") mymap = pi3d.createElevationMapFromTexture("textures/mountainsHgt.jpg",mapwidth,mapdepth,mapheight,64,64,10.0) #testislands.jpg #mymap2 = pi3d.createElevationMapFromTexture("textures/mountainsHgt.jpg",mapwidth,mapdepth,mapheight,64,64, 128) myclip = pi3d.clipPlane() light = pi3d.createLight(0, 10,10,10, "", 0,100,0) light.on() #Create tree models treeplane = pi3d.createPlane(4.0,5.0) treemodel1 = pi3d.createMergeShape("baretree") treemodel1.add(treeplane, 0,0,0) treemodel1.add(treeplane, 0,0,0, 0,90,0) treemodel2 = pi3d.createMergeShape("bushytree") treemodel2.add(treeplane, 0,0,0) treemodel2.add(treeplane, 0,0,0, 0,60,0) treemodel2.add(treeplane, 0,0,0, 0,120,0) #Scatter them on map using Merge shape's cluster function mytrees1 = pi3d.createMergeShape("trees1") mytrees1.cluster(treemodel1, mymap,0.0,0.0,200.0,200.0,30,"",8.0,3.0) # (shape,elevmap,xpos,zpos,w,d,count,options,minscl,maxscl) mytrees2 = pi3d.createMergeShape("trees2") mytrees2.cluster(treemodel2, mymap,0.0,0.0,200.0,200.0,30,"",6.0,3.0)