//a building with a circular cutout SIZE = 1.0; FLOORS = 23; TODEG = 180/Math.PI; //textures grey = new UniformTexture(); grey.diffuseColor.setRGB(0.7,0.7,0.7); red = new UniformTexture(); red.diffuseColor.setRGB(0.7,0.3,0.1); cream = new UniformTexture(); cream.diffuseColor.setRGB(0.75,0.73,0.6); win = new UniformTexture(); win.diffuseColor.setRGB(0.7,0.7,0.7); win.shininess = 1.0f; win.specularity = 0.5f; //main part box = new Cube(10.3*SIZE,SIZE*FLOORS,11.8*SIZE); box.setTexture(win,win.getDefaultMapping(box)); pos = new Vec3(11*SIZE,SIZE*FLOORS/2.0,0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); pos = new Vec3(-11*SIZE,SIZE*FLOORS/2.0,0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); box = new Cube(12*SIZE,SIZE*FLOORS,5.8*SIZE); box.setTexture(win,win.getDefaultMapping(box)); pos = new Vec3(0,SIZE*FLOORS/2.0,-3*SIZE); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); //verticals box = new Cube(0.6*SIZE,SIZE*(FLOORS+0.5),0.3*SIZE); box.setTexture(red,red.getDefaultMapping(box)); for (i=-16;i<=16;i=i+2) { pos = new Vec3(i*SIZE,SIZE*FLOORS/2.0,-5.9*SIZE); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); } for (i=8;i<=16;i=i+2) { pos = new Vec3(i*SIZE,SIZE*FLOORS/2.0,5.9*SIZE); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); pos = new Vec3(-i*SIZE,SIZE*FLOORS/2.0,5.9*SIZE); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); } for (i=-5.75;i<=6;i=i+1.87) { pos = new Vec3(16.15*SIZE,SIZE*FLOORS/2.0,i*SIZE); script.addObject(box, new CoordinateSystem(pos, 0,90,0)); pos = new Vec3(-16.15*SIZE,SIZE*FLOORS/2.0,i*SIZE); script.addObject(box, new CoordinateSystem(pos, 0,90,0)); } //horizontals box = new Cube(32*SIZE,0.5*SIZE,0.2*SIZE); box.setTexture(cream,cream.getDefaultMapping(box)); for (i=0;i<=FLOORS;i++) { pos = new Vec3(0,i*SIZE,-5.9*SIZE); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); } box = new Cube(10*SIZE,0.5*SIZE,0.2*SIZE); box.setTexture(cream,cream.getDefaultMapping(box)); for (i=0;i<=FLOORS;i++) { pos = new Vec3(11*SIZE,i*SIZE,5.9*SIZE); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); pos = new Vec3(-11*SIZE,i*SIZE,5.9*SIZE); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); } box = new Cube(0.4*SIZE,0.5*SIZE,12*SIZE); box.setTexture(cream,cream.getDefaultMapping(box)); for (i=0;i<=FLOORS;i++) { pos = new Vec3(16.05*SIZE,SIZE*i,0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); pos = new Vec3(-16.05*SIZE,SIZE*i,0); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); } //curve box = new Cube(0.4*SIZE,SIZE*(FLOORS+0.25),0.66*SIZE); box.setTexture(grey, grey.getDefaultMapping(box)); for (i=0;i<=30;i=i+2) { th = 2*Math.PI/60*i+Math.PI/2; pos = new Vec3(6*SIZE*Math.sin(th),SIZE*(FLOORS+0.25)/2.0,6*SIZE+6*SIZE*Math.cos(th)); script.addObject(box, new CoordinateSystem(pos, 0,90-th*TODEG,0)); } box = new Cube(0.4*SIZE,0.5*SIZE,0.66*SIZE); box.setTexture(grey, grey.getDefaultMapping(box)); for (i=1;i<=30;i=i+2) { for (j=0;j<=FLOORS;j++) { th = 2*Math.PI/60*i+Math.PI/2; pos = new Vec3(6*SIZE*Math.sin(th),j*SIZE,6*SIZE+6*SIZE*Math.cos(th)); script.addObject(box, new CoordinateSystem(pos, 0,90-th*TODEG,0)); } } window = new Cube(0.3*SIZE,0.5*SIZE,0.66*SIZE); window.setTexture(win, win.getDefaultMapping(window)); for (i=1;i<=30;i=i+2) { for (j=0;j