/*a group of towers based loosely on those of South City, Kolkata, India grouping easily adjustable*/ SIZE = 1.0; FLOORS = 36; //multiple of 3 //textures white = new UniformTexture(); white.diffuseColor.setRGB(0.95,0.9,0.9); grey = new UniformTexture(); grey.diffuseColor.setRGB(0.5,0.5,0.5); brown = new UniformTexture(); brown.diffuseColor.setRGB(0.67,0.52,0.34); //various convenient values BFLOORS = 2*FLOORS/3; TORAD = Math.PI/180; //functions that make various pieces of building void colA(Vec3 pos, double angle, int WFLOORS) //5 unit square { //set up variables int i, j; Vec3 vv; Mat4 th, mpos; th = Mat4.yrotation(angle*TORAD); mpos = Mat4.translation(pos.x, pos.y, pos.z); //brown box = new Cube(SIZE,BFLOORS*SIZE,SIZE); box.setTexture(brown, brown.getDefaultMapping(box)); for (i=-1;i<2;i++) { for (j=-1;j<2;j++) { if (!(i==0&&j==0)){ vv = new Vec3(2*i*SIZE,BFLOORS*SIZE/2.0,2*j*SIZE); rr = new CoordinateSystem(vv, 0,0,0); rr.transformCoordinates(th); rr.transformOrigin(mpos); script.addObject(box, rr);} } } box = new Cube(5*SIZE,0.3*SIZE,5*SIZE); box.setTexture(brown, brown.getDefaultMapping(box)); for (i=0;i