/*A script to generate 2 similar buildings of different heights adjustable space between. second building 83% as tall as the first.*/ FLOORS = 95; SIZE = 1.0; SPACE = 50*SIZE; //textures window = new UniformTexture(); window.diffuseColor.setRGB(0.0, 0.3, 0.5); window.specularity = 0.3f; window.shininess = 1.0f; conc = new UniformTexture(); conc.diffuseColor.setRGB(0.83, 0.8, 0.8); //generate buildings for (k=0; k<2; k++) { box = new Cube(20*SIZE, FLOORS*SIZE, 40*SIZE); box.setTexture(window, window.getDefaultMapping(box)); p = new Vec3(SPACE*k, FLOORS*SIZE/2.0, 0); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); //bars on sides for (i=1; i<20; i++) { box = new Cube(20.3*SIZE, FLOORS*SIZE, 0.3*SIZE); box.setTexture(conc, conc.getDefaultMapping(box)); z = SIZE*i*2 - 20*SIZE; p = new Vec3(SPACE*k, FLOORS*SIZE/2.0, z); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); } for (i=1; i<10; i++) { box = new Cube(0.3*SIZE, FLOORS*SIZE, 40.3*SIZE); box.setTexture(conc, conc.getDefaultMapping(box)); x = SPACE*k + SIZE*i*2 - 10*SIZE; p = new Vec3(x, FLOORS*SIZE/2.0, 0.0); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); } //corners box = new Cube(0.6*SIZE, FLOORS*SIZE, 0.6*SIZE); box.setTexture(conc, conc.getDefaultMapping(box)); x = 10*SIZE; z = 20*SIZE; p = new Vec3(SPACE*k + x, FLOORS*SIZE/2.0, z); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); p = new Vec3(SPACE*k + x, FLOORS*SIZE/2.0, -z); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); p = new Vec3(SPACE*k - x, FLOORS*SIZE/2.0, z); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); p = new Vec3(SPACE*k - x, FLOORS*SIZE/2.0, -z); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); //horizontal bars for (i=0; i