//A round church type building. Cross removable. SIZE = 1.0; BHIGH = 3;//height of base TOP = true;//true for cross, false for no cross //textures roof = new UniformTexture(); roof.diffuseColor.setRGB(0.8,0.6,0.1); gray = new UniformTexture(); gray.diffuseColor.setRGB(0.7,0.6,0.6); //body c = new Cylinder(BHIGH*SIZE,2.5*SIZE,2.5*SIZE,1.0); c.setTexture(gray, gray.getDefaultMapping(c)); p = new Vec3(0,BHIGH*SIZE/2,0); script.addObject(c, new CoordinateSystem(p,0,0,0)); c = new Cylinder(0.5*SIZE,2.8*SIZE,2.8*SIZE,1.0); c.setTexture(gray, gray.getDefaultMapping(c)); p = new Vec3(0,BHIGH*SIZE-0.25*SIZE,0); script.addObject(c, new CoordinateSystem(p,0,0,0)); p = new Vec3(0,0.25*SIZE,0); script.addObject(c, new CoordinateSystem(p,0,0,0)); for (i=5;i>0;i--) { c = new Cylinder(0.5*SIZE,(2.8+0.1*i)*SIZE,(2.8+0.1*i)*SIZE,1.0); c.setTexture(gray, gray.getDefaultMapping(c)); p = new Vec3(0,(0.3-0.1*i)*SIZE,0); script.addObject(c, new CoordinateSystem(p,0,0,0)); } //pillars c = new Cylinder(BHIGH*SIZE,0.2*SIZE,0.2*SIZE,1.0); c.setTexture(gray, gray.getDefaultMapping(c)); for (i=0;i<18;i++) { th = i*2*Math.PI/18.0; pos = new Vec3(2.65*Math.sin(th), BHIGH*SIZE/2, 2.65*Math.cos(th)); script.addObject(c, new CoordinateSystem(pos,0,0,0)); } offset = BHIGH*SIZE; //main part of the roof for (int i=0;i<25;i++) { x = i/10.0; r = Math.exp(-x); next = Math.exp(-(i+1)/10.0); c = new Cylinder(0.3*SIZE,r*SIZE*3,r*SIZE*3,next/r); c.setTexture(roof, roof.getDefaultMapping(c)); p = new Vec3(0,offset + 0.15*SIZE,0); script.addObject(c, new CoordinateSystem(p, 0, 0, 0)); offset = offset+0.3*SIZE; } //cross on top if (TOP) { box = new Cube(0.1*SIZE,3*SIZE,0.2*SIZE); box.setTexture(gray, gray.getDefaultMapping(box)); p = new Vec3(-0.1*SIZE,offset+1.5*SIZE,0); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); p = new Vec3(0.1*SIZE,offset+1.5*SIZE,0); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); box = new Cube(1.5*SIZE,0.1*SIZE,0.2*SIZE); box.setTexture(gray, gray.getDefaultMapping(box)); p = new Vec3(0,offset+2.1*SIZE,0); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); p = new Vec3(0,offset+1.9*SIZE,0); script.addObject(box, new CoordinateSystem(p, 0, 0, 0)); }