//A building where the bank of windows is surrounded by a large bevel. SIZE = 1.0; FLOORS = 38; WIDTH = 41; //how many windows wide rand = new Random(20130121); //textures frame = new UniformTexture(); frame.diffuseColor.setRGB(0.6,0.4,0.4); win = new Texture[6]; for (i=0; i<6; i++) { k = (i+1)/6.0; win[i] = new UniformTexture(); win[i].diffuseColor.setRGB(0.5+0.3*k, 0.5+0.3*k, 0.5+0.3*k); win[i].specularity = 0.35f; win[i].shininess = 1.0f; } //makes a single window unit //tex should be 0 or 1 void unit(double xpos, double ypos, double zpos, int tex) { center = new Vec3(xpos, ypos+0.1*SIZE, zpos); box = new Cube(0.8*SIZE, 0.1*SIZE, 0.1*SIZE); box.setTexture(frame, frame.getDefaultMapping(box)); pos = new Vec3(0,SIZE,0).plus(center); script.addObject(box, new CoordinateSystem(pos, 45,0,0)); pos = new Vec3(0,0,0).plus(center); script.addObject(box, new CoordinateSystem(pos, 45,0,0)); box = new Cube(0.1*SIZE, SIZE, 0.1*SIZE); box.setTexture(frame, frame.getDefaultMapping(box)); pos = new Vec3(0.4*SIZE,0.5*SIZE,0).plus(center); script.addObject(box, new CoordinateSystem(pos, 0,45,0)); pos = new Vec3(-0.4*SIZE,0.5*SIZE,0).plus(center); script.addObject(box, new CoordinateSystem(pos, 0,45,0)); box = new Cube(1*SIZE, 0.1*SIZE, 0.15*SIZE); box.setTexture(frame, frame.getDefaultMapping(box)); pos = new Vec3(0,1.05*SIZE,0).plus(center); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); pos = new Vec3(0,-.05*SIZE,0).plus(center); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); box = new Cube(0.1*SIZE, SIZE, 0.15*SIZE); box.setTexture(frame, frame.getDefaultMapping(box)); pos = new Vec3(0.45*SIZE, SIZE/2,0).plus(center); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); pos = new Vec3(-0.45*SIZE, SIZE/2,0).plus(center); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); box = new Cube(0.8*SIZE, SIZE, 0.02*SIZE); int k = 2*rand.nextInt(3)+1*tex; box.setTexture(win[k], win[k].getDefaultMapping(box)); pos = new Vec3(0,SIZE/2,0).plus(center); script.addObject(box, new CoordinateSystem(pos, 0,0,0)); } //put everything together for (int i=0;i