/*A building of several staggered layers.*/ FLOORS = 80; SIZE = 1.0; LEVELS = 4;//number of sections to each side of the middle //textures win = new UniformTexture(); win.diffuseColor.setRGB(0.5, 0.6, 0.6); win.specularity = 0.3f; win.shininess = 1.0f; conc = new UniformTexture(); conc.diffuseColor.setRGB(0.53, 0.5, 0.5); void building(double x, int floors, int width) { double YSIZE = 1.3*SIZE; double xoffset = x*SIZE*8; int i; //window box = new Cube(SIZE*8, YSIZE*floors, SIZE*width); box.setTexture(win, win.getDefaultMapping(box)); p = new Vec3(x*SIZE*8, YSIZE*floors/2.0, 0.0); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); //vertical bars box = new Cube(SIZE*0.25, YSIZE*(floors+2), SIZE*(width+0.5)); box.setTexture(conc, conc.getDefaultMapping(box)); for (i=-4; i<=4; i++) { p = new Vec3(xoffset+SIZE*i, YSIZE*floors/2.0+YSIZE, 0.0); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); } //horizontal bars box = new Cube(SIZE*8, YSIZE*0.3, SIZE*(width+0.1)); box.setTexture(conc, conc.getDefaultMapping(box)); for (i=0; i