/*A four lobed tower.*/ FLOORS = 82; SIZE = 1.0; void segment(double x, double z) //makes a segment of the building { //textures win = new UniformTexture(); win.diffuseColor.setRGB(0.4, 0.4, 0.8); win.specularColor.setRGB(0.9, 0.9, 0.9); win.specularity = 0.25f; win.shininess = 1.0f; conc = new UniformTexture(); conc.diffuseColor.setRGB(0.8, 0.7, 0.7); box = new Cube(15*SIZE, SIZE*FLOORS, 15*SIZE); box.setTexture(win, win.getDefaultMapping(box)); p = new Vec3(x, SIZE*FLOORS/2, z); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); for (i=0; i<=FLOORS; i++) { box = new Cube(15.2*SIZE, SIZE*0.25, 15.2*SIZE); box.setTexture(conc, conc.getDefaultMapping(box)); p = new Vec3(x, SIZE*i, z); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); } for (i=-7; i<=7; i++) { box = new Cube(SIZE*0.25, SIZE*FLOORS, 15.2*SIZE); box.setTexture(conc, conc.getDefaultMapping(box)); p = new Vec3(x+i*SIZE, SIZE*FLOORS/2, z); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); p = new Vec3(x, SIZE*FLOORS/2, z+i*SIZE); script.addObject(box, new CoordinateSystem(p, 0, 90, 0)); } box = new Cube(SIZE*5, SIZE*3, SIZE*5); box.setTexture(conc, conc.getDefaultMapping(box)); p = new Vec3(x+SIZE*4, SIZE*(FLOORS+1.5), z); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); } segment(0.0, 0.0); segment(-12*SIZE, -12*SIZE); segment(-12*SIZE, 12*SIZE); segment(12*SIZE, -12*SIZE); segment(12*SIZE, 12*SIZE);