treemodel2 = MergeShape("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 = Plane(1.0,0.3,"",0,-2,0) grassmodel = MergeShape("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) #Scatter them on map using Merge shape's cluster function mytrees1 = MergeShape("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 = MergeShape("trees2") mytrees2.cluster(treemodel2, mymap,0.0,0.0,200.0,200.0,30,"",6.0,3.0) # (shape,elevmap,xpos,zpos,w,d,count,options,minscl,maxscl) mytrees3 = MergeShape("trees3") mytrees3.cluster(treemodel2, mymap,0.0,0.0,300.0,300.0,30,"",4.0,2.0) # (shape,elevmap,xpos,zpos,w,d,count,options,minscl,maxscl) mygrass = MergeShape("grass") mygrass.cluster(grassmodel, mymap,0.0,0.0,100.0,100.0,100,"",10.0,4.0) #mygrass2 = MergeShape("grass2") #mygrass2.cluster(mygrass, mymap,100.0,0.0,100.0,100.0,1,"",1.0,1.0)
#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) treemodel2 = MergeShape("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 = MergeShape("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 = MergeShape("trees2") mytrees2.cluster(treemodel2, mymap,0.0,0.0,200.0,200.0,30,"",6.0,3.0) # (shape,elevmap,xpos,zpos,w,d,count,options,minscl,maxscl) mytrees3 = MergeShape("trees3") mytrees3.cluster(treemodel2, mymap,0.0,0.0,300.0,300.0,30,"",4.0,2.0) # (shape,elevmap,xpos,zpos,w,d,count,options,minscl,maxscl) #screenshot number scshots = 1 #avatar camera
name="sub") mymap.set_draw_details(shader, [rockimg1, rockimg2, shineimg], 128.0, 0.05) # Create fog for more realistic fade in distance. This can be turned on and off between drawing different object (i.e backgound not foggy) mymap.set_fog((0.1, 0.1, 0.1, 1.0), 200.0) #Create tree models treeplane = Plane(w=4.0, h=5.0) treemodel1 = MergeShape(name="baretree") treemodel1.add(treeplane.buf[0], 0, 0, 0) treemodel1.add(treeplane.buf[0], 0, 0, 0, 0, 90, 0) #Scatter them on map using Merge shape's cluster function mytrees1 = MergeShape(name="trees1") mytrees1.cluster(treemodel1.buf[0], mymap, 0.0, 0.0, 900.0, 900.0, 10, "", 8.0, 3.0) mytrees1.buf[0].set_draw_details(shader, [tree2img, rockimg2], 4.0, 0.0) mytrees1.set_fog((0.1, 0.1, 0.1, 1.0), 200.0) raspberry = MergeShape(name="rasp") raspberry.cluster(treemodel1.buf[0], mymap, -250, +250, 470.0, 470.0, 5, "", 8.0, 1.0) raspberry.buf[0].set_draw_details(shader, [raspimg, raspimg], 1.0, 0.0) raspberry.set_fog((0.1, 0.1, 0.1, 1.0), 200.0) """ MergeShape can be used to join a number of Model object for much greater rendering speed however, because Models can contain multiple Buffers, each with their own texture image it is necessary to make a merge for each Buffer and, later, draw each merged object using each of the textures. The cluster method can be used where there is only one Buffer but with more than one the different parts of the object get split up by the randomisation! Here I manually do the same thing as cluster by first generating an array
#Create tree models treeplane = Plane(w=4.0, h=5.0) treemodel1 = MergeShape(name="baretree") treemodel1.add(treeplane.buf[0], 0, 0, 0) treemodel1.add(treeplane.buf[0], 0, 0, 0, 0, 90, 0) treemodel2 = MergeShape(name="bushytree") treemodel2.add(treeplane.buf[0], 0, 0, 0) treemodel2.add(treeplane.buf[0], 0, 0, 0, 0, 60, 0) treemodel2.add(treeplane.buf[0], 0, 0, 0, 0, 120, 0) #Scatter them on map using Merge shape's cluster function mytrees1 = MergeShape(name="trees1") mytrees1.cluster(treemodel1.buf[0], mymap, 0.0, 0.0, 120.0, 120.0, 30, "", 8.0, 3.0) mytrees1.set_draw_details(flatsh, [tree2img], 0.0, 0.0) mytrees1.set_fog(*TFOG) mytrees2 = MergeShape(name="trees2") mytrees2.cluster(treemodel2.buf[0], mymap, 0.0, 0.0, 100.0, 100.0, 30, "", 6.0, 3.0) mytrees2.set_draw_details(flatsh, [tree1img], 0.0, 0.0) mytrees2.set_fog(*TFOG) mytrees3 = MergeShape(name="trees3") mytrees3.cluster(treemodel2, mymap, 0.0, 0.0, 300.0, 300.0, 30, "", 4.0, 2.0) mytrees3.set_draw_details(flatsh, [hb2img], 0.0, 0.0) mytrees3.set_fog(*TFOG) #Create monolith
divx=128, divy=128, name="sub") mymap.set_draw_details(shader, [rockimg1, rockimg2, shineimg], 128.0, 0.05) # Create fog for more realistic fade in distance. This can be turned on and off between drawing different object (i.e backgound not foggy) mymap.set_fog((0.1,0.1,0.1,1.0), 200.0) #Create tree models treeplane = Plane(w=4.0, h=5.0) treemodel1 = MergeShape(name="baretree") treemodel1.add(treeplane.buf[0], 0,0,0) treemodel1.add(treeplane.buf[0], 0,0,0, 0,90,0) #Scatter them on map using Merge shape's cluster function mytrees1 = MergeShape(name="trees1") mytrees1.cluster(treemodel1.buf[0], mymap,0.0,0.0,900.0,900.0,10,"",8.0,3.0) mytrees1.buf[0].set_draw_details(shader, [tree2img, rockimg2], 4.0, 0.0) mytrees1.set_fog((0.1,0.1,0.1,1.0), 200.0) raspberry = MergeShape(name="rasp") raspberry.cluster(treemodel1.buf[0], mymap,-250,+250,470.0,470.0,5,"",8.0,1.0) raspberry.buf[0].set_draw_details(shader, [raspimg, raspimg], 1.0, 0.0) raspberry.set_fog((0.1,0.1,0.1,1.0), 200.0) """ MergeShape can be used to join a number of Model object for much greater rendering speed however, because Models can contain multiple Buffers, each with their own texture image it is necessary to make a merge for each Buffer and, later, draw each merged object using each of the textures. The cluster method can be used where there is only one Buffer but with more than one the different parts of the object get split up by the randomisation! Here I manually do the same thing as cluster by first generating an array
#Create tree models treeplane = Plane(w=4.0, h=5.0) treemodel1 = MergeShape(name="baretree") treemodel1.add(treeplane.buf[0], 0,0,0) treemodel1.add(treeplane.buf[0], 0,0,0, 0,90,0) treemodel2 = MergeShape(name="bushytree") treemodel2.add(treeplane.buf[0], 0,0,0) treemodel2.add(treeplane.buf[0], 0,0,0, 0,60,0) treemodel2.add(treeplane.buf[0], 0,0,0, 0,120,0) #Scatter them on map using Merge shape's cluster function mytrees1 = MergeShape(name="trees1") mytrees1.cluster(treemodel1.buf[0], mymap,0.0,0.0,120.0,120.0,30,"",8.0,3.0) mytrees1.set_draw_details(flatsh, [tree2img], 0.0, 0.0) mytrees1.set_fog(*TFOG) mytrees2 = MergeShape(name="trees2") mytrees2.cluster(treemodel2.buf[0], mymap,0.0,0.0,100.0,100.0,30,"",6.0,3.0) mytrees2.set_draw_details(flatsh, [tree1img], 0.0, 0.0) mytrees2.set_fog(*TFOG) mytrees3 = MergeShape(name="trees3") mytrees3.cluster(treemodel2, mymap,0.0,0.0,300.0,300.0,30,"",4.0,2.0) mytrees3.set_draw_details(flatsh, [hb2img], 0.0, 0.0) mytrees3.set_fog(*TFOG) #Create monolith monolith = Sphere(radius=8.0, slices=12, sides=48,