//A cylindrical building with balconies and a decorative top. Designed in collaberation with my students. SIZE = 1.0; //the radii of the inside wall and outside wall IRADIUS = 77.5*SIZE; ORADIUS = 112.5*SIZE; //number of floors devoted to various activities RFLOORS = 108; BFLOORS = 12; //some mathmatical constants TWOPI = Math.PI*2; //fix variables SIZE = SIZE/15.0; IRADIUS = IRADIUS/15.0; ORADIUS = ORADIUS/15.0; //textures railing = new UniformTexture(); railing.diffuseColor.setRGB(0.8, 0.0, 0.0); balcony = new UniformTexture(); balcony.diffuseColor.setRGB(0.6, 0.6, 0.6); tower_color = new UniformTexture(); tower_color.diffuseColor.setRGB(0.5, 0.5, 0.5); //main script pos = new Vec3(0.0, 0.0, 0); cdx = new CoordinateSystem(pos, 0, 0, 0); //base1 = new ObjectInfo( new Cylinder((RFLOORS+BFLOORS)*15.0, ORADIUS, ORADIUS, 1.0), cdx, "HI"); //base2 = new ObjectInfo( new Cylinder((RFLOORS+BFLOORS)*15.0, IRADIUS, IRADIUS, 1.0), cdx, "Lo"); //building = new CSGObject(base1, base2, 2); building = new Cylinder((RFLOORS+BFLOORS)*15.0*SIZE, ORADIUS, ORADIUS, 1.0); building.setTexture(tower_color, tower_color.getDefaultMapping(building)); p = new Vec3(0.0, (RFLOORS+BFLOORS)*7.5*SIZE, 0.0); script.addObject(building, new CoordinateSystem(p, 0, 0, 0)); //add balconies for (i=0; i<20; i++) { for (j=0; j