/*A long building of two wings with a spire--essentially a simplified version of the marin civic center very configurable*/ SIZE = 1.0; FLOORS = 3; LENGTH = 60;//multiple of 3 length of longer wing ANGLE = 120;//angle between wings //textures win = new UniformTexture(); win.diffuseColor.setRGB(0.5,0.5,0.5); win.specularity = 0.5f; win.shininess = 1.0f; wall = new UniformTexture(); wall.diffuseColor.setRGB(0.7,0.6,0.6); roof = new UniformTexture(); roof.diffuseColor.setRGB(0.3,0.3,0.8); gold = new UniformTexture(); gold.diffuseColor.setHSV(60,0.8f,0.75f); TriangleMesh arch() { //an arch var bb, cyl; Vec3 pos; double r = 0.4*SIZE; bb = new Cube(SIZE,SIZE,0.4*SIZE); cyl = new Cylinder(SIZE,r,r,1.0f); pos = new Vec3(0,0.5*SIZE,0); one = new ObjectInfo(bb, new CoordinateSystem(pos, 0,0,0), "one"); pos = new Vec3(0,0,0); two = new ObjectInfo(cyl, new CoordinateSystem(pos, 90,0,0), "two"); lens = new CSGObject(one, two, 2); return (lens.convertToTriangleMesh(0.03)); } void twist(Object3D b, Vec3 p, double xang, double yang, double zang) { //twist an object ANGLE degrees and add it to the scene CoordinateSystem c; Mat4 m; c = new CoordinateSystem(p, xang,yang,zang); m = Mat4.yrotation(ANGLE*Math.PI/180); c.transformCoordinates(m); script.addObject(b, c); } double getx(double z) { return(2*SIZE*(40-z)/40.0 + 0.3*SIZE); } //longer wing box = new Cube((LENGTH-0.4)*SIZE,FLOORS*SIZE,12*SIZE); box.setTexture(win, win.getDefaultMapping(box)); pos = new Vec3(LENGTH*SIZE/2,FLOORS*SIZE/2,0); twist(box, pos, 0,0,0); box = new Cube(LENGTH*SIZE+0.5*SIZE,0.2*SIZE,12.5*SIZE); box.setTexture(wall, wall.getDefaultMapping(box)); window = arch(); window.setTexture(wall, wall.getDefaultMapping(window)); for (j=0;j