/*A building based on a building in San Francisco CA.*/ SIZE = 1.0; FLOORS = 45; //adjust paramaters FLOORS = FLOORS-5; //textures concrete = new UniformTexture(); concrete.diffuseColor.setHSV(54.0f,0.4f,0.55f); window = new UniformTexture(); window.diffuseColor.setRGB(0.7,0.7,0.7); window.specularity = 0.5f; window.shininess = 1.0f; pipe = new UniformTexture(); pipe.diffuseColor.setRGB(0.75,0.75,0.75); box = new Cube(16.35*SIZE, SIZE*FLOORS, 6.8*SIZE); box.setTexture(window, window.getDefaultMapping(box)); pos = new Vec3(0,SIZE*FLOORS/2,0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); //verticals box = new Cube(0.45*SIZE,SIZE*FLOORS,7*SIZE); box.setTexture(concrete, concrete.getDefaultMapping(box)); for (i=-7;i<8;i++) { pos = new Vec3(SIZE*i, SIZE*FLOORS/2,0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); } //horizontals box = new Cube(16.4*SIZE,0.3*SIZE,6.9*SIZE); box.setTexture(concrete, concrete.getDefaultMapping(box)); for (i=0;i<=FLOORS;i++) { pos = new Vec3(0,SIZE*i,0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); } //ends box = new Cube(0.45*SIZE,SIZE*FLOORS,1.5*SIZE); box.setTexture(concrete, concrete.getDefaultMapping(box)); for (i=-1;i<=1;i=i+2) { pos = new Vec3(8*SIZE, SIZE*FLOORS/2,2.75*SIZE*i); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); pos = new Vec3(-8*SIZE, SIZE*FLOORS/2,2.75*SIZE*i); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); } box = new Cube(0.45*SIZE,SIZE*FLOORS,0.5*SIZE); box.setTexture(concrete, concrete.getDefaultMapping(box)); for (i=-1;i<=2;i++) { pos = new Vec3(8*SIZE, SIZE*FLOORS/2,SIZE*i-0.25*SIZE); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); pos = new Vec3(-8*SIZE, SIZE*FLOORS/2,SIZE*i-0.25*SIZE); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); } //top box = new Cube(3.45*SIZE,.6*SIZE,7*SIZE); box.setTexture(concrete, concrete.getDefaultMapping(box)); pos = new Vec3(6.5*SIZE,SIZE*FLOORS+0.15*SIZE,0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); pos = new Vec3(-6.5*SIZE,SIZE*FLOORS+0.15*SIZE,0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); // box = new Cube(10*SIZE, SIZE*5, 6.8*SIZE); box.setTexture(window, window.getDefaultMapping(box)); pos = new Vec3(0,SIZE*FLOORS+SIZE*2.5,0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); //verticals box = new Cube(0.45*SIZE,SIZE*5,7*SIZE); box.setTexture(concrete, concrete.getDefaultMapping(box)); for (i=-5;i<=5;i++) { pos = new Vec3(SIZE*i, SIZE*FLOORS+SIZE*2.5,0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); } //horizontals box = new Cube(10*SIZE,0.3*SIZE,6.9*SIZE); box.setTexture(concrete, concrete.getDefaultMapping(box)); for (i=1;i<5;i++) { pos = new Vec3(0,SIZE*FLOORS+SIZE*i,0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); } //top top box = new Cube(10.45*SIZE,.6*SIZE,7*SIZE); box.setTexture(concrete, concrete.getDefaultMapping(box)); pos = new Vec3(0,SIZE*(FLOORS+5)+0.15*SIZE,0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); //hvac etc box = new Cube(4*SIZE, 1.5*SIZE, 2*SIZE); box.setTexture(concrete, concrete.getDefaultMapping(box)); pos = new Vec3(1.5*SIZE, (FLOORS+6)*SIZE, 0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); box = new Cube(1*SIZE, 1.5*SIZE, 3*SIZE); box.setTexture(concrete, concrete.getDefaultMapping(box)); pos = new Vec3(6.5*SIZE, (FLOORS+1)*SIZE, 0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); //communication c = new Cylinder(6*SIZE, 0.1*SIZE, 0.1*SIZE, 1.0); c.setTexture(pipe, pipe.getDefaultMapping(c)); pos = new Vec3(-3*SIZE, (FLOORS+8)*SIZE, 3.3*SIZE); script.addObject(c, new CoordinateSystem(pos, 0,0,0)); pos = new Vec3(-2*SIZE, (FLOORS+7)*SIZE, 3.1*SIZE); script.addObject(c, new CoordinateSystem(pos, 0,0,0)); pos = new Vec3(1*SIZE, (FLOORS+5)*SIZE, 3.4*SIZE); script.addObject(c, new CoordinateSystem(pos, 0,0,0)); pos = new Vec3(0.6*SIZE,(FLOORS+6)*SIZE, -2*SIZE); script.addObject(c, new CoordinateSystem(pos, 0,0,0)); offset = (FLOORS+5)*SIZE; c = new Cylinder(4*SIZE,0.2*SIZE,0.2*SIZE,0.8); c.setTexture(pipe, pipe.getDefaultMapping(c)); pos = new Vec3(4.8*SIZE,offset+2*SIZE,-.5*SIZE); script.addObject(c, new CoordinateSystem(pos, 0,0,0)); box = new Cube(0.1*SIZE,1.1*SIZE,0.4*SIZE); box.setTexture(pipe, pipe.getDefaultMapping(box)); p = new Vec3(0.1*SIZE,1*SIZE,0.1*SIZE); script.addObject(box, new CoordinateSystem(pos.plus(p), 0,45,0)); p = new Vec3(0.1*SIZE,0.6*SIZE,-0.1*SIZE); script.addObject(box, new CoordinateSystem(pos.plus(p), 0,-45,0)); p = new Vec3(-0.15*SIZE,1.1*SIZE,-0.0*SIZE); script.addObject(box, new CoordinateSystem(pos.plus(p), 0,0,0));