Codels
3,3 k tris10,3 × 11,2 × 8,61 m

Utiliser dans le code

Remixer dans l’éditeur
Module ES autonome — ne dépend que de three. Appelez la fonction factory et ajoutez le groupe à votre scène.
/**
 * Timber-Frame Tavern — Codels 3D model library
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 3,264 · Size (W × H × D): 10.29 × 11.21 × 8.61 m
 *
 * Usage:
 *   import { createTavern } from './tavern.js';
 *   
 *   const model = createTavern();
 *   model.position.set(0, 0, 0);
 *   scene.add(model);
 */
import * as THREE from 'three';

const deg = THREE.MathUtils.degToRad;

// Deterministic vertex displacement (organic low-poly look).
function jitter(geometry, amount, seed) {
  const pos = geometry.attributes.position;
  const h = (a, b, c, s) => {
    let x = Math.imul(a, 73856093) ^ Math.imul(b, 19349663) ^ Math.imul(c, 83492791) ^ Math.imul(s, 2654435761);
    x = Math.imul(x ^ (x >>> 16), 2246822507);
    x = Math.imul(x ^ (x >>> 13), 3266489909);
    return ((x ^ (x >>> 16)) >>> 0) / 4294967295 - 0.5;
  };
  for (let i = 0; i < pos.count; i++) {
    const x = pos.getX(i), y = pos.getY(i), z = pos.getZ(i);
    const qx = Math.round(x * 1000), qy = Math.round(y * 1000), qz = Math.round(z * 1000);
    pos.setXYZ(i, x + h(qx, qy, qz, seed) * 2 * amount, y + h(qx, qy, qz, seed + 1) * 2 * amount, z + h(qx, qy, qz, seed + 2) * 2 * amount);
  }
  pos.needsUpdate = true;
  geometry.computeVertexNormals();
  return geometry;
}

// Extrude a 2D outline along Z (centered). bevel = [thickness, size, segments].
function extrude(outline, depth, holes = [], bevel = null) {
  const shape = new THREE.Shape(outline.map(([x, y]) => new THREE.Vector2(x, y)));
  for (const hole of holes) shape.holes.push(new THREE.Path(hole.map(([x, y]) => new THREE.Vector2(x, y))));
  const options = bevel
    ? { depth, bevelEnabled: true, bevelThickness: bevel[0], bevelSize: bevel[1], bevelSegments: bevel[2] }
    : { depth, bevelEnabled: false };
  return new THREE.ExtrudeGeometry(shape, options).translate(0, 0, -depth / 2);
}

export function createTavern() {
  const root = new THREE.Group();
  root.name = 'Tavern';

  // Materials
  const stoneMat = new THREE.MeshStandardMaterial({ name: 'stone', color: 0x958d80, roughness: 0.95, flatShading: true });
  const stone2Mat = new THREE.MeshStandardMaterial({ name: 'stone2', color: 0x7a7268, roughness: 0.95, flatShading: true });
  const plasterMat = new THREE.MeshStandardMaterial({ name: 'plaster', color: 0xecdcb8, roughness: 0.95, flatShading: true });
  const timberMat = new THREE.MeshStandardMaterial({ name: 'timber', color: 0x4f3424, roughness: 0.9, flatShading: true });
  const woodMat = new THREE.MeshStandardMaterial({ name: 'wood', color: 0x8a5a33, roughness: 0.9, flatShading: true });
  const roofMat = new THREE.MeshStandardMaterial({ name: 'roof', color: 0x7b4430, roughness: 0.85, flatShading: true });
  const glassMat = new THREE.MeshStandardMaterial({ name: 'glass', color: 0xffd68a, roughness: 0.4, emissive: 0xffa63d, flatShading: true });
  const ironMat = new THREE.MeshStandardMaterial({ name: 'iron', color: 0x2e2f33, roughness: 0.55, metalness: 0.6, flatShading: true });
  const goldMat = new THREE.MeshStandardMaterial({ name: 'gold', color: 0xd4a43a, roughness: 0.45, metalness: 0.5, flatShading: true });

  // Shared geometries
  const boxGeo = new THREE.BoxGeometry(0.14, 0.16, 0.51);
  const boxGeo2 = new THREE.BoxGeometry(0.12, 1.0406, 0.12);
  const boxGeo3 = new THREE.BoxGeometry(9.06, 0.2, 0.09);
  const boxGeo4 = new THREE.BoxGeometry(9.06, 0.18, 0.09);
  const boxGeo5 = new THREE.BoxGeometry(0.16, 2.3, 0.08);
  const boxGeo6 = new THREE.BoxGeometry(0.13, 2.4354, 0.07);
  const boxGeo7 = new THREE.BoxGeometry(1.1157, 0.95, 0.04);
  const boxGeo8 = new THREE.BoxGeometry(1.2957, 0.09, 0.12);
  const boxGeo9 = new THREE.BoxGeometry(0.05, 0.95, 0.05);
  const boxGeo10 = new THREE.BoxGeometry(1.3957, 0.08, 0.2);
  const boxGeo11 = new THREE.BoxGeometry(6.96, 0.2, 0.09);
  const boxGeo12 = new THREE.BoxGeometry(6.96, 0.18, 0.09);
  const boxGeo13 = new THREE.BoxGeometry(0.13, 2.4789, 0.07);
  const boxGeo14 = new THREE.BoxGeometry(0.08, 3, 0.16);
  const boxGeo15 = new THREE.BoxGeometry(0.08, 0.16, 3.902);
  const boxGeo16 = new THREE.BoxGeometry(0.08, 2.2183, 0.13);
  const boxGeo17 = new THREE.BoxGeometry(0.09, 0.6, 0.1);
  const boxGeo18 = new THREE.BoxGeometry(9.8, 0.1, 5.4662);
  const boxGeo19 = new THREE.BoxGeometry(9.82, 0.07, 0.9839);
  const boxGeo20 = new THREE.BoxGeometry(0.08, 0.18, 5.3362);
  const boxGeo21 = new THREE.BoxGeometry(0.09, 0.7, 0.1);
  const boxGeo22 = new THREE.BoxGeometry(0.12, 1.45, 0.08);
  const boxGeo23 = new THREE.BoxGeometry(1.2215, 0.09, 1.9854);
  const cylinderGeo = new THREE.CylinderGeometry(0.09, 0.11, 0.3, 6);
  const boxGeo24 = new THREE.BoxGeometry(1.44, 0.09, 0.025);
  const torusGeo = new THREE.TorusGeometry(0.06, 0.012, 3, 6);
  const boxGeo25 = new THREE.BoxGeometry(1.25, 1.05, 0.04);
  const boxGeo26 = new THREE.BoxGeometry(1.53, 0.14, 0.12);
  const boxGeo27 = new THREE.BoxGeometry(0.14, 1.05, 0.1);
  const boxGeo28 = new THREE.BoxGeometry(0.05, 1.05, 0.05);
  const boxGeo29 = new THREE.BoxGeometry(1.63, 0.08, 0.2);
  const boxGeo30 = new THREE.BoxGeometry(1, 1, 0.04);
  const boxGeo31 = new THREE.BoxGeometry(1.28, 0.08, 0.2);
  const boxGeo32 = new THREE.BoxGeometry(0.14, 1, 0.1);
  const boxGeo33 = new THREE.BoxGeometry(0.05, 0.05, 0.3);
  const cylinderGeo2 = new THREE.CylinderGeometry(0.07, 0.09, 0.08, 4, 1, false, Math.PI / 4);
  const boxGeo34 = new THREE.BoxGeometry(0.13, 0.2, 0.13);
  const boxGeo35 = new THREE.BoxGeometry(0.15, 0.03, 0.15);
  const cylinderGeo3 = new THREE.CylinderGeometry(0.01, 0.01, 0.2, 4);
  const boxGeo36 = new THREE.BoxGeometry(0.08, 0.66, 0.06);
  const cylinderGeo4 = new THREE.CylinderGeometry(0.11, 0.1, 0.26, 8);
  const torusGeo2 = new THREE.TorusGeometry(0.07, 0.02, 3, 5, Math.PI);
  const boxGeo37 = new THREE.BoxGeometry(0.035, 0.07, 0.24);
  const cylinderGeo5 = new THREE.CylinderGeometry(0.3, 0.3, 0.8, 8);
  const cylinderGeo6 = new THREE.CylinderGeometry(0.315, 0.315, 0.06, 8, 1, true);
  const boxGeo38 = new THREE.BoxGeometry(0.08, 0.42, 0.3);

  // Parts
  const plinth = new THREE.Mesh(jitter(new THREE.BoxGeometry(9.16, 0.4, 6.16), 0.01, 1), stone2Mat);
  plinth.name = 'plinth';
  plinth.position.set(0, 0.2, 0);
  root.add(plinth);
  const groundWalls = new THREE.Mesh(new THREE.BoxGeometry(9, 2.9, 6), stoneMat);
  groundWalls.name = 'groundWalls';
  groundWalls.position.set(0, 1.85, 0);
  root.add(groundWalls);
  const quoin = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.55, 0.53, 0.32), 0.01, 2), stone2Mat);
  quoin.name = 'quoin';
  quoin.position.set(-4.255, 0.685, -2.87);
  root.add(quoin);
  const quoin2 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.32, 0.53, 0.55), 0.01, 3), stone2Mat);
  quoin2.name = 'quoin';
  quoin2.position.set(-4.37, 1.255, -2.755);
  root.add(quoin2);
  const quoin3 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.55, 0.53, 0.32), 0.01, 4), stone2Mat);
  quoin3.name = 'quoin';
  quoin3.position.set(-4.255, 1.825, -2.87);
  root.add(quoin3);
  const quoin4 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.32, 0.53, 0.55), 0.01, 5), stone2Mat);
  quoin4.name = 'quoin';
  quoin4.position.set(-4.37, 2.395, -2.755);
  root.add(quoin4);
  const quoin5 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.55, 0.53, 0.32), 0.01, 6), stone2Mat);
  quoin5.name = 'quoin';
  quoin5.position.set(-4.255, 2.965, -2.87);
  root.add(quoin5);
  const quoin6 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.32, 0.53, 0.55), 0.01, 7), stone2Mat);
  quoin6.name = 'quoin';
  quoin6.position.set(-4.37, 0.685, 2.755);
  root.add(quoin6);
  const quoin7 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.55, 0.53, 0.32), 0.01, 8), stone2Mat);
  quoin7.name = 'quoin';
  quoin7.position.set(-4.255, 1.255, 2.87);
  root.add(quoin7);
  const quoin8 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.32, 0.53, 0.55), 0.01, 9), stone2Mat);
  quoin8.name = 'quoin';
  quoin8.position.set(-4.37, 1.825, 2.755);
  root.add(quoin8);
  const quoin9 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.55, 0.53, 0.32), 0.01, 10), stone2Mat);
  quoin9.name = 'quoin';
  quoin9.position.set(-4.255, 2.395, 2.87);
  root.add(quoin9);
  const quoin10 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.32, 0.53, 0.55), 0.01, 11), stone2Mat);
  quoin10.name = 'quoin';
  quoin10.position.set(-4.37, 2.965, 2.755);
  root.add(quoin10);
  const quoin11 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.32, 0.53, 0.55), 0.01, 12), stone2Mat);
  quoin11.name = 'quoin';
  quoin11.position.set(4.37, 0.685, -2.755);
  root.add(quoin11);
  const quoin12 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.55, 0.53, 0.32), 0.01, 13), stone2Mat);
  quoin12.name = 'quoin';
  quoin12.position.set(4.255, 1.255, -2.87);
  root.add(quoin12);
  const quoin13 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.32, 0.53, 0.55), 0.01, 14), stone2Mat);
  quoin13.name = 'quoin';
  quoin13.position.set(4.37, 1.825, -2.755);
  root.add(quoin13);
  const quoin14 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.55, 0.53, 0.32), 0.01, 15), stone2Mat);
  quoin14.name = 'quoin';
  quoin14.position.set(4.255, 2.395, -2.87);
  root.add(quoin14);
  const quoin15 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.32, 0.53, 0.55), 0.01, 16), stone2Mat);
  quoin15.name = 'quoin';
  quoin15.position.set(4.37, 2.965, -2.755);
  root.add(quoin15);
  const quoin16 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.55, 0.53, 0.32), 0.01, 17), stone2Mat);
  quoin16.name = 'quoin';
  quoin16.position.set(4.255, 0.685, 2.87);
  root.add(quoin16);
  const quoin17 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.32, 0.53, 0.55), 0.01, 18), stone2Mat);
  quoin17.name = 'quoin';
  quoin17.position.set(4.37, 1.255, 2.755);
  root.add(quoin17);
  const quoin18 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.55, 0.53, 0.32), 0.01, 19), stone2Mat);
  quoin18.name = 'quoin';
  quoin18.position.set(4.255, 1.825, 2.87);
  root.add(quoin18);
  const quoin19 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.32, 0.53, 0.55), 0.01, 20), stone2Mat);
  quoin19.name = 'quoin';
  quoin19.position.set(4.37, 2.395, 2.755);
  root.add(quoin19);
  const quoin20 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.55, 0.53, 0.32), 0.01, 21), stone2Mat);
  quoin20.name = 'quoin';
  quoin20.position.set(4.255, 2.965, 2.87);
  root.add(quoin20);
  const wallStone = new THREE.Group();
  wallStone.name = 'wallStone';
  wallStone.position.set(3.1785, 1.4192, -3);
  wallStone.rotation.set(0, deg(180), 0);
  root.add(wallStone);
  const box24 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.5584, 0.2606, 0.05), 0.008, 22), stoneMat);
  box24.position.set(0, 0, 0.01);
  wallStone.add(box24);
  const wallStone2 = new THREE.Group();
  wallStone2.name = 'wallStone';
  wallStone2.position.set(-1.2778, 2.1378, 3);
  root.add(wallStone2);
  const box26 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.5859, 0.2424, 0.05), 0.008, 23), stoneMat);
  box26.position.set(0, 0, 0.01);
  wallStone2.add(box26);
  const wallStone3 = new THREE.Group();
  wallStone3.name = 'wallStone';
  wallStone3.position.set(2.7809, 1.7722, -3);
  wallStone3.rotation.set(0, deg(180), 0);
  root.add(wallStone3);
  const box28 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.6019, 0.2318, 0.05), 0.008, 24), stoneMat);
  box28.position.set(0, 0, 0.01);
  wallStone3.add(box28);
  const wallStone4 = new THREE.Group();
  wallStone4.name = 'wallStone';
  wallStone4.position.set(-2.9889, 0.9097, 3);
  root.add(wallStone4);
  const box30 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.5761, 0.2571, 0.05), 0.008, 25), stoneMat);
  box30.position.set(0, 0, 0.01);
  wallStone4.add(box30);
  const wallStone5 = new THREE.Group();
  wallStone5.name = 'wallStone';
  wallStone5.position.set(0.2376, 1.1293, -3);
  wallStone5.rotation.set(0, deg(180), 0);
  root.add(wallStone5);
  const box32 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.4264, 0.2112, 0.05), 0.008, 26), stoneMat);
  box32.position.set(0, 0, 0.01);
  wallStone5.add(box32);
  const wallStone6 = new THREE.Group();
  wallStone6.name = 'wallStone';
  wallStone6.position.set(-1.5328, 1.0619, 3);
  root.add(wallStone6);
  const box34 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.7085, 0.2216, 0.05), 0.008, 27), stoneMat);
  box34.position.set(0, 0, 0.01);
  wallStone6.add(box34);
  const wallStone7 = new THREE.Group();
  wallStone7.name = 'wallStone';
  wallStone7.position.set(-3.1856, 1.7449, -3);
  wallStone7.rotation.set(0, deg(180), 0);
  root.add(wallStone7);
  const box36 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.454, 0.2211, 0.05), 0.008, 28), stoneMat);
  box36.position.set(0, 0, 0.01);
  wallStone7.add(box36);
  const wallStone8 = new THREE.Group();
  wallStone8.name = 'wallStone';
  wallStone8.position.set(2.6308, 0.7032, 3);
  root.add(wallStone8);
  const box38 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.5085, 0.2747, 0.05), 0.008, 29), stoneMat);
  box38.position.set(0, 0, 0.01);
  wallStone8.add(box38);
  const wallStone9 = new THREE.Group();
  wallStone9.name = 'wallStone';
  wallStone9.position.set(0.0488, 1.5618, -3);
  wallStone9.rotation.set(0, deg(180), 0);
  root.add(wallStone9);
  const box40 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.4691, 0.2233, 0.05), 0.008, 30), stoneMat);
  box40.position.set(0, 0, 0.01);
  wallStone9.add(box40);
  const jettyBand = new THREE.Mesh(new THREE.BoxGeometry(9.12, 0.26, 6.96), timberMat);
  jettyBand.name = 'jettyBand';
  jettyBand.position.set(0, 3.43, 0);
  root.add(jettyBand);
  const joistEnd = new THREE.Mesh(boxGeo, timberMat);
  joistEnd.name = 'joistEnd';
  joistEnd.position.set(-4.2, 3.22, -3.225);
  root.add(joistEnd);
  const joistEnd2 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd2.name = 'joistEnd';
  joistEnd2.position.set(-3, 3.22, -3.225);
  root.add(joistEnd2);
  const joistEnd3 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd3.name = 'joistEnd';
  joistEnd3.position.set(-1.8, 3.22, -3.225);
  root.add(joistEnd3);
  const joistEnd4 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd4.name = 'joistEnd';
  joistEnd4.position.set(-0.6, 3.22, -3.225);
  root.add(joistEnd4);
  const joistEnd5 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd5.name = 'joistEnd';
  joistEnd5.position.set(0.6, 3.22, -3.225);
  root.add(joistEnd5);
  const joistEnd6 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd6.name = 'joistEnd';
  joistEnd6.position.set(1.8, 3.22, -3.225);
  root.add(joistEnd6);
  const joistEnd7 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd7.name = 'joistEnd';
  joistEnd7.position.set(3, 3.22, -3.225);
  root.add(joistEnd7);
  const joistEnd8 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd8.name = 'joistEnd';
  joistEnd8.position.set(4.2, 3.22, -3.225);
  root.add(joistEnd8);
  const jettyBracket = new THREE.Mesh(boxGeo2, timberMat);
  jettyBracket.name = 'jettyBracket';
  jettyBracket.position.set(-4.3, 2.69, -3.225);
  jettyBracket.rotation.set(deg(-19.6538), 0, 0);
  root.add(jettyBracket);
  const jettyBracket2 = new THREE.Mesh(boxGeo2, timberMat);
  jettyBracket2.name = 'jettyBracket';
  jettyBracket2.position.set(4.3, 2.69, -3.225);
  jettyBracket2.rotation.set(deg(-19.6538), 0, 0);
  root.add(jettyBracket2);
  const joistEnd9 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd9.name = 'joistEnd';
  joistEnd9.position.set(-4.2, 3.22, 3.225);
  root.add(joistEnd9);
  const joistEnd10 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd10.name = 'joistEnd';
  joistEnd10.position.set(-3, 3.22, 3.225);
  root.add(joistEnd10);
  const joistEnd11 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd11.name = 'joistEnd';
  joistEnd11.position.set(-1.8, 3.22, 3.225);
  root.add(joistEnd11);
  const joistEnd12 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd12.name = 'joistEnd';
  joistEnd12.position.set(-0.6, 3.22, 3.225);
  root.add(joistEnd12);
  const joistEnd13 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd13.name = 'joistEnd';
  joistEnd13.position.set(0.6, 3.22, 3.225);
  root.add(joistEnd13);
  const joistEnd14 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd14.name = 'joistEnd';
  joistEnd14.position.set(1.8, 3.22, 3.225);
  root.add(joistEnd14);
  const joistEnd15 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd15.name = 'joistEnd';
  joistEnd15.position.set(3, 3.22, 3.225);
  root.add(joistEnd15);
  const joistEnd16 = new THREE.Mesh(boxGeo, timberMat);
  joistEnd16.name = 'joistEnd';
  joistEnd16.position.set(4.2, 3.22, 3.225);
  root.add(joistEnd16);
  const jettyBracket3 = new THREE.Mesh(boxGeo2, timberMat);
  jettyBracket3.name = 'jettyBracket';
  jettyBracket3.position.set(-4.3, 2.69, 3.225);
  jettyBracket3.rotation.set(deg(-160.3462), 0, deg(-180));
  root.add(jettyBracket3);
  const jettyBracket4 = new THREE.Mesh(boxGeo2, timberMat);
  jettyBracket4.name = 'jettyBracket';
  jettyBracket4.position.set(4.3, 2.69, 3.225);
  jettyBracket4.rotation.set(deg(-160.3462), 0, deg(-180));
  root.add(jettyBracket4);
  const upperWalls = new THREE.Mesh(new THREE.BoxGeometry(9, 2.6, 6.9), plasterMat);
  upperWalls.name = 'upperWalls';
  upperWalls.position.set(0, 4.86, 0);
  root.add(upperWalls);
  const gables = new THREE.Mesh(extrude([[-3.45, 0], [3.45, 0], [0, 3.58]], 9), plasterMat);
  gables.name = 'gables';
  gables.position.set(0, 6.16, 0);
  gables.rotation.set(0, deg(90), 0);
  root.add(gables);
  const frontFrame = new THREE.Group();
  frontFrame.name = 'frontFrame';
  frontFrame.position.set(0, 3.56, 3.45);
  root.add(frontFrame);
  const sillBeam = new THREE.Mesh(boxGeo3, timberMat);
  sillBeam.name = 'sillBeam';
  sillBeam.position.set(0, 0.1, 0.035);
  frontFrame.add(sillBeam);
  const wallPlate = new THREE.Mesh(boxGeo4, timberMat);
  wallPlate.name = 'wallPlate';
  wallPlate.position.set(0, 2.51, 0.035);
  frontFrame.add(wallPlate);
  const post = new THREE.Mesh(boxGeo5, timberMat);
  post.name = 'post';
  post.position.set(-4.5, 1.3, 0.035);
  frontFrame.add(post);
  const post2 = new THREE.Mesh(boxGeo5, timberMat);
  post2.name = 'post';
  post2.position.set(-3.2143, 1.3, 0.035);
  frontFrame.add(post2);
  const post3 = new THREE.Mesh(boxGeo5, timberMat);
  post3.name = 'post';
  post3.position.set(-1.9286, 1.3, 0.035);
  frontFrame.add(post3);
  const post4 = new THREE.Mesh(boxGeo5, timberMat);
  post4.name = 'post';
  post4.position.set(-0.6429, 1.3, 0.035);
  frontFrame.add(post4);
  const post5 = new THREE.Mesh(boxGeo5, timberMat);
  post5.name = 'post';
  post5.position.set(0.6429, 1.3, 0.035);
  frontFrame.add(post5);
  const post6 = new THREE.Mesh(boxGeo5, timberMat);
  post6.name = 'post';
  post6.position.set(1.9286, 1.3, 0.035);
  frontFrame.add(post6);
  const post7 = new THREE.Mesh(boxGeo5, timberMat);
  post7.name = 'post';
  post7.position.set(3.2143, 1.3, 0.035);
  frontFrame.add(post7);
  const post8 = new THREE.Mesh(boxGeo5, timberMat);
  post8.name = 'post';
  post8.position.set(4.5, 1.3, 0.035);
  frontFrame.add(post8);
  const brace = new THREE.Mesh(boxGeo6, timberMat);
  brace.name = 'brace';
  brace.position.set(-3.8571, 1.31, 0.035);
  brace.rotation.set(0, 0, deg(-26.4749));
  frontFrame.add(brace);
  const upperWindow = new THREE.Group();
  upperWindow.name = 'upperWindow';
  upperWindow.position.set(-2.5714, 1.35, 0.02);
  frontFrame.add(upperWindow);
  const glass = new THREE.Mesh(boxGeo7, glassMat);
  glass.name = 'glass';
  upperWindow.add(glass);
  const frame = new THREE.Mesh(boxGeo8, timberMat);
  frame.name = 'frame';
  frame.position.set(0, 0.52, 0.04);
  upperWindow.add(frame);
  const mullion = new THREE.Mesh(boxGeo9, timberMat);
  mullion.name = 'mullion';
  mullion.position.set(0, 0, 0.03);
  upperWindow.add(mullion);
  const sill = new THREE.Mesh(boxGeo10, timberMat);
  sill.name = 'sill';
  sill.position.set(0, -0.515, 0.08);
  upperWindow.add(sill);
  const brace2 = new THREE.Mesh(boxGeo6, timberMat);
  brace2.name = 'brace';
  brace2.position.set(-1.2857, 1.31, 0.035);
  brace2.rotation.set(0, 0, deg(-26.4749));
  frontFrame.add(brace2);
  const upperWindow2 = new THREE.Group();
  upperWindow2.name = 'upperWindow';
  upperWindow2.position.set(0, 1.35, 0.02);
  frontFrame.add(upperWindow2);
  const glass2 = new THREE.Mesh(boxGeo7, glassMat);
  glass2.name = 'glass';
  upperWindow2.add(glass2);
  const frame2 = new THREE.Mesh(boxGeo8, timberMat);
  frame2.name = 'frame';
  frame2.position.set(0, 0.52, 0.04);
  upperWindow2.add(frame2);
  const mullion2 = new THREE.Mesh(boxGeo9, timberMat);
  mullion2.name = 'mullion';
  mullion2.position.set(0, 0, 0.03);
  upperWindow2.add(mullion2);
  const sill2 = new THREE.Mesh(boxGeo10, timberMat);
  sill2.name = 'sill';
  sill2.position.set(0, -0.515, 0.08);
  upperWindow2.add(sill2);
  const brace3 = new THREE.Mesh(boxGeo6, timberMat);
  brace3.name = 'brace';
  brace3.position.set(1.2857, 1.31, 0.035);
  brace3.rotation.set(0, 0, deg(26.4749));
  frontFrame.add(brace3);
  const upperWindow3 = new THREE.Group();
  upperWindow3.name = 'upperWindow';
  upperWindow3.position.set(2.5714, 1.35, 0.02);
  frontFrame.add(upperWindow3);
  const glass3 = new THREE.Mesh(boxGeo7, glassMat);
  glass3.name = 'glass';
  upperWindow3.add(glass3);
  const frame3 = new THREE.Mesh(boxGeo8, timberMat);
  frame3.name = 'frame';
  frame3.position.set(0, 0.52, 0.04);
  upperWindow3.add(frame3);
  const mullion3 = new THREE.Mesh(boxGeo9, timberMat);
  mullion3.name = 'mullion';
  mullion3.position.set(0, 0, 0.03);
  upperWindow3.add(mullion3);
  const sill3 = new THREE.Mesh(boxGeo10, timberMat);
  sill3.name = 'sill';
  sill3.position.set(0, -0.515, 0.08);
  upperWindow3.add(sill3);
  const brace4 = new THREE.Mesh(boxGeo6, timberMat);
  brace4.name = 'brace';
  brace4.position.set(3.8571, 1.31, 0.035);
  brace4.rotation.set(0, 0, deg(26.4749));
  frontFrame.add(brace4);
  const backFrame = new THREE.Group();
  backFrame.name = 'backFrame';
  backFrame.position.set(0, 3.56, -3.45);
  backFrame.rotation.set(0, deg(180), 0);
  root.add(backFrame);
  const sillBeam2 = new THREE.Mesh(boxGeo3, timberMat);
  sillBeam2.name = 'sillBeam';
  sillBeam2.position.set(0, 0.1, 0.035);
  backFrame.add(sillBeam2);
  const wallPlate2 = new THREE.Mesh(boxGeo4, timberMat);
  wallPlate2.name = 'wallPlate';
  wallPlate2.position.set(0, 2.51, 0.035);
  backFrame.add(wallPlate2);
  const post9 = new THREE.Mesh(boxGeo5, timberMat);
  post9.name = 'post';
  post9.position.set(-4.5, 1.3, 0.035);
  backFrame.add(post9);
  const post10 = new THREE.Mesh(boxGeo5, timberMat);
  post10.name = 'post';
  post10.position.set(-3.2143, 1.3, 0.035);
  backFrame.add(post10);
  const post11 = new THREE.Mesh(boxGeo5, timberMat);
  post11.name = 'post';
  post11.position.set(-1.9286, 1.3, 0.035);
  backFrame.add(post11);
  const post12 = new THREE.Mesh(boxGeo5, timberMat);
  post12.name = 'post';
  post12.position.set(-0.6429, 1.3, 0.035);
  backFrame.add(post12);
  const post13 = new THREE.Mesh(boxGeo5, timberMat);
  post13.name = 'post';
  post13.position.set(0.6429, 1.3, 0.035);
  backFrame.add(post13);
  const post14 = new THREE.Mesh(boxGeo5, timberMat);
  post14.name = 'post';
  post14.position.set(1.9286, 1.3, 0.035);
  backFrame.add(post14);
  const post15 = new THREE.Mesh(boxGeo5, timberMat);
  post15.name = 'post';
  post15.position.set(3.2143, 1.3, 0.035);
  backFrame.add(post15);
  const post16 = new THREE.Mesh(boxGeo5, timberMat);
  post16.name = 'post';
  post16.position.set(4.5, 1.3, 0.035);
  backFrame.add(post16);
  const brace5 = new THREE.Mesh(boxGeo6, timberMat);
  brace5.name = 'brace';
  brace5.position.set(-3.8571, 1.31, 0.035);
  brace5.rotation.set(0, 0, deg(-26.4749));
  backFrame.add(brace5);
  const upperWindow4 = new THREE.Group();
  upperWindow4.name = 'upperWindow';
  upperWindow4.position.set(-2.5714, 1.35, 0.02);
  backFrame.add(upperWindow4);
  const glass4 = new THREE.Mesh(boxGeo7, glassMat);
  glass4.name = 'glass';
  upperWindow4.add(glass4);
  const sill4 = new THREE.Mesh(boxGeo10, timberMat);
  sill4.name = 'sill';
  sill4.position.set(0, -0.515, 0.08);
  upperWindow4.add(sill4);
  const brace6 = new THREE.Mesh(boxGeo6, timberMat);
  brace6.name = 'brace';
  brace6.position.set(-1.2857, 1.31, 0.035);
  brace6.rotation.set(0, 0, deg(-26.4749));
  backFrame.add(brace6);
  const brace7 = new THREE.Mesh(boxGeo6, timberMat);
  brace7.name = 'brace';
  brace7.position.set(0, 1.31, 0.035);
  brace7.rotation.set(0, 0, deg(26.4749));
  backFrame.add(brace7);
  const brace8 = new THREE.Mesh(boxGeo6, timberMat);
  brace8.name = 'brace';
  brace8.position.set(1.2857, 1.31, 0.035);
  brace8.rotation.set(0, 0, deg(26.4749));
  backFrame.add(brace8);
  const upperWindow5 = new THREE.Group();
  upperWindow5.name = 'upperWindow';
  upperWindow5.position.set(2.5714, 1.35, 0.02);
  backFrame.add(upperWindow5);
  const glass5 = new THREE.Mesh(boxGeo7, glassMat);
  glass5.name = 'glass';
  upperWindow5.add(glass5);
  const sill5 = new THREE.Mesh(boxGeo10, timberMat);
  sill5.name = 'sill';
  sill5.position.set(0, -0.515, 0.08);
  upperWindow5.add(sill5);
  const brace9 = new THREE.Mesh(boxGeo6, timberMat);
  brace9.name = 'brace';
  brace9.position.set(3.8571, 1.31, 0.035);
  brace9.rotation.set(0, 0, deg(26.4749));
  backFrame.add(brace9);
  const rightFrame = new THREE.Group();
  rightFrame.name = 'rightFrame';
  rightFrame.position.set(4.5, 3.56, 0);
  rightFrame.rotation.set(0, deg(90), 0);
  root.add(rightFrame);
  const sillBeam3 = new THREE.Mesh(boxGeo11, timberMat);
  sillBeam3.name = 'sillBeam';
  sillBeam3.position.set(0, 0.1, 0.035);
  rightFrame.add(sillBeam3);
  const wallPlate3 = new THREE.Mesh(boxGeo12, timberMat);
  wallPlate3.name = 'wallPlate';
  wallPlate3.position.set(0, 2.51, 0.035);
  rightFrame.add(wallPlate3);
  const post17 = new THREE.Mesh(boxGeo5, timberMat);
  post17.name = 'post';
  post17.position.set(-3.45, 1.3, 0.035);
  rightFrame.add(post17);
  const post18 = new THREE.Mesh(boxGeo5, timberMat);
  post18.name = 'post';
  post18.position.set(-2.07, 1.3, 0.035);
  rightFrame.add(post18);
  const post19 = new THREE.Mesh(boxGeo5, timberMat);
  post19.name = 'post';
  post19.position.set(-0.69, 1.3, 0.035);
  rightFrame.add(post19);
  const post20 = new THREE.Mesh(boxGeo5, timberMat);
  post20.name = 'post';
  post20.position.set(0.69, 1.3, 0.035);
  rightFrame.add(post20);
  const post21 = new THREE.Mesh(boxGeo5, timberMat);
  post21.name = 'post';
  post21.position.set(2.07, 1.3, 0.035);
  rightFrame.add(post21);
  const post22 = new THREE.Mesh(boxGeo5, timberMat);
  post22.name = 'post';
  post22.position.set(3.45, 1.3, 0.035);
  rightFrame.add(post22);
  const brace10 = new THREE.Mesh(boxGeo13, timberMat);
  brace10.name = 'brace';
  brace10.position.set(-2.76, 1.31, 0.035);
  brace10.rotation.set(0, 0, deg(-28.426));
  rightFrame.add(brace10);
  const brace11 = new THREE.Mesh(boxGeo13, timberMat);
  brace11.name = 'brace';
  brace11.position.set(-1.38, 1.31, 0.035);
  brace11.rotation.set(0, 0, deg(-28.426));
  rightFrame.add(brace11);
  const upperWindow6 = new THREE.Group();
  upperWindow6.name = 'upperWindow';
  upperWindow6.position.set(0, 1.35, 0.02);
  rightFrame.add(upperWindow6);
  const glass6 = new THREE.Mesh(new THREE.BoxGeometry(1.21, 0.95, 0.04), glassMat);
  glass6.name = 'glass';
  upperWindow6.add(glass6);
  const frame4 = new THREE.Mesh(new THREE.BoxGeometry(1.39, 0.09, 0.12), timberMat);
  frame4.name = 'frame';
  frame4.position.set(0, 0.52, 0.04);
  upperWindow6.add(frame4);
  const mullion4 = new THREE.Mesh(boxGeo9, timberMat);
  mullion4.name = 'mullion';
  mullion4.position.set(0, 0, 0.03);
  upperWindow6.add(mullion4);
  const sill6 = new THREE.Mesh(new THREE.BoxGeometry(1.49, 0.08, 0.2), timberMat);
  sill6.name = 'sill';
  sill6.position.set(0, -0.515, 0.08);
  upperWindow6.add(sill6);
  const brace12 = new THREE.Mesh(boxGeo13, timberMat);
  brace12.name = 'brace';
  brace12.position.set(1.38, 1.31, 0.035);
  brace12.rotation.set(0, 0, deg(28.426));
  rightFrame.add(brace12);
  const brace13 = new THREE.Mesh(boxGeo13, timberMat);
  brace13.name = 'brace';
  brace13.position.set(2.76, 1.31, 0.035);
  brace13.rotation.set(0, 0, deg(28.426));
  rightFrame.add(brace13);
  const leftFrame = new THREE.Group();
  leftFrame.name = 'leftFrame';
  leftFrame.position.set(-4.5, 3.56, 0);
  leftFrame.rotation.set(0, deg(-90), 0);
  root.add(leftFrame);
  const sillBeam4 = new THREE.Mesh(boxGeo11, timberMat);
  sillBeam4.name = 'sillBeam';
  sillBeam4.position.set(0, 0.1, 0.035);
  leftFrame.add(sillBeam4);
  const wallPlate4 = new THREE.Mesh(boxGeo12, timberMat);
  wallPlate4.name = 'wallPlate';
  wallPlate4.position.set(0, 2.51, 0.035);
  leftFrame.add(wallPlate4);
  const post23 = new THREE.Mesh(boxGeo5, timberMat);
  post23.name = 'post';
  post23.position.set(-3.45, 1.3, 0.035);
  leftFrame.add(post23);
  const post24 = new THREE.Mesh(boxGeo5, timberMat);
  post24.name = 'post';
  post24.position.set(-2.07, 1.3, 0.035);
  leftFrame.add(post24);
  const post25 = new THREE.Mesh(boxGeo5, timberMat);
  post25.name = 'post';
  post25.position.set(-0.69, 1.3, 0.035);
  leftFrame.add(post25);
  const post26 = new THREE.Mesh(boxGeo5, timberMat);
  post26.name = 'post';
  post26.position.set(0.69, 1.3, 0.035);
  leftFrame.add(post26);
  const post27 = new THREE.Mesh(boxGeo5, timberMat);
  post27.name = 'post';
  post27.position.set(2.07, 1.3, 0.035);
  leftFrame.add(post27);
  const post28 = new THREE.Mesh(boxGeo5, timberMat);
  post28.name = 'post';
  post28.position.set(3.45, 1.3, 0.035);
  leftFrame.add(post28);
  const brace14 = new THREE.Mesh(boxGeo13, timberMat);
  brace14.name = 'brace';
  brace14.position.set(-2.76, 1.31, 0.035);
  brace14.rotation.set(0, 0, deg(-28.426));
  leftFrame.add(brace14);
  const brace15 = new THREE.Mesh(boxGeo13, timberMat);
  brace15.name = 'brace';
  brace15.position.set(-1.38, 1.31, 0.035);
  brace15.rotation.set(0, 0, deg(-28.426));
  leftFrame.add(brace15);
  const brace16 = new THREE.Mesh(boxGeo13, timberMat);
  brace16.name = 'brace';
  brace16.position.set(0, 1.31, 0.035);
  brace16.rotation.set(0, 0, deg(28.426));
  leftFrame.add(brace16);
  const brace17 = new THREE.Mesh(boxGeo13, timberMat);
  brace17.name = 'brace';
  brace17.position.set(1.38, 1.31, 0.035);
  brace17.rotation.set(0, 0, deg(28.426));
  leftFrame.add(brace17);
  const brace18 = new THREE.Mesh(boxGeo13, timberMat);
  brace18.name = 'brace';
  brace18.position.set(2.76, 1.31, 0.035);
  brace18.rotation.set(0, 0, deg(28.426));
  leftFrame.add(brace18);
  const kingPost = new THREE.Mesh(boxGeo14, timberMat);
  kingPost.name = 'kingPost';
  kingPost.position.set(-4.535, 7.66, 0);
  root.add(kingPost);
  const collar = new THREE.Mesh(boxGeo15, timberMat);
  collar.name = 'collar';
  collar.position.set(-4.535, 7.672, 0);
  root.add(collar);
  const strut = new THREE.Mesh(boxGeo16, timberMat);
  strut.name = 'strut';
  strut.position.set(-4.535, 6.941, -0.8755);
  strut.rotation.set(deg(-52.1228), deg(90), 0);
  root.add(strut);
  const strut2 = new THREE.Mesh(boxGeo16, timberMat);
  strut2.name = 'strut';
  strut2.position.set(-4.535, 6.941, 0.8755);
  strut2.rotation.set(deg(52.1228), deg(90), 0);
  root.add(strut2);
  const kingPost2 = new THREE.Mesh(boxGeo14, timberMat);
  kingPost2.name = 'kingPost';
  kingPost2.position.set(4.535, 7.66, 0);
  root.add(kingPost2);
  const collar2 = new THREE.Mesh(boxGeo15, timberMat);
  collar2.name = 'collar';
  collar2.position.set(4.535, 7.672, 0);
  root.add(collar2);
  const strut3 = new THREE.Mesh(boxGeo16, timberMat);
  strut3.name = 'strut';
  strut3.position.set(4.535, 6.941, -0.8755);
  strut3.rotation.set(deg(-52.1228), deg(90), 0);
  root.add(strut3);
  const strut4 = new THREE.Mesh(boxGeo16, timberMat);
  strut4.name = 'strut';
  strut4.position.set(4.535, 6.941, 0.8755);
  strut4.rotation.set(deg(52.1228), deg(90), 0);
  root.add(strut4);
  const atticWindow = new THREE.Group();
  atticWindow.name = 'atticWindow';
  atticWindow.position.set(4.5, 7.002, 0);
  atticWindow.rotation.set(0, deg(90), 0);
  root.add(atticWindow);
  const glass7 = new THREE.Mesh(new THREE.BoxGeometry(0.5, 0.6, 0.04), glassMat);
  glass7.name = 'glass';
  atticWindow.add(glass7);
  const frame5 = new THREE.Mesh(new THREE.BoxGeometry(0.68, 0.09, 0.12), timberMat);
  frame5.name = 'frame';
  frame5.position.set(0, 0.345, 0.04);
  atticWindow.add(frame5);
  const frame6 = new THREE.Mesh(boxGeo17, timberMat);
  frame6.name = 'frame';
  frame6.position.set(-0.295, 0, 0.03);
  atticWindow.add(frame6);
  const frame7 = new THREE.Mesh(boxGeo17, timberMat);
  frame7.name = 'frame';
  frame7.position.set(0.295, 0, 0.03);
  atticWindow.add(frame7);
  const mullion5 = new THREE.Mesh(new THREE.BoxGeometry(0.05, 0.6, 0.05), timberMat);
  mullion5.name = 'mullion';
  mullion5.position.set(0, 0, 0.03);
  atticWindow.add(mullion5);
  const sill7 = new THREE.Mesh(new THREE.BoxGeometry(0.78, 0.08, 0.2), timberMat);
  sill7.name = 'sill';
  sill7.position.set(0, -0.34, 0.08);
  atticWindow.add(sill7);
  const roof = new THREE.Group();
  roof.name = 'roof';
  root.add(roof);
  const roofSlab = new THREE.Mesh(boxGeo18, roofMat);
  roofSlab.name = 'roofSlab';
  roofSlab.position.set(0, 7.843, -1.9064);
  roofSlab.rotation.set(deg(-46.2189), 0, 0);
  roof.add(roofSlab);
  const shingles = new THREE.Mesh(boxGeo19, roofMat);
  shingles.name = 'shingles';
  shingles.position.set(0, 9.5462, -0.3919);
  shingles.rotation.set(deg(-52.2189), 0, 0);
  roof.add(shingles);
  const shingles2 = new THREE.Mesh(boxGeo19, roofMat);
  shingles2.name = 'shingles';
  shingles2.position.set(0, 8.8884, -1.0222);
  shingles2.rotation.set(deg(-52.2189), 0, 0);
  roof.add(shingles2);
  const shingles3 = new THREE.Mesh(boxGeo19, roofMat);
  shingles3.name = 'shingles';
  shingles3.position.set(0, 8.2307, -1.6526);
  shingles3.rotation.set(deg(-52.2189), 0, 0);
  roof.add(shingles3);
  const shingles4 = new THREE.Mesh(boxGeo19, roofMat);
  shingles4.name = 'shingles';
  shingles4.position.set(0, 7.5729, -2.2829);
  shingles4.rotation.set(deg(-52.2189), 0, 0);
  roof.add(shingles4);
  const shingles5 = new THREE.Mesh(boxGeo19, roofMat);
  shingles5.name = 'shingles';
  shingles5.position.set(0, 6.9152, -2.9133);
  shingles5.rotation.set(deg(-52.2189), 0, 0);
  roof.add(shingles5);
  const shingles6 = new THREE.Mesh(boxGeo19, roofMat);
  shingles6.name = 'shingles';
  shingles6.position.set(0, 6.2574, -3.5436);
  shingles6.rotation.set(deg(-52.2189), 0, 0);
  roof.add(shingles6);
  const roofSlab2 = new THREE.Mesh(boxGeo18, roofMat);
  roofSlab2.name = 'roofSlab';
  roofSlab2.position.set(0, 7.843, 1.9064);
  roofSlab2.rotation.set(deg(46.2189), 0, 0);
  roof.add(roofSlab2);
  const shingles7 = new THREE.Mesh(boxGeo19, roofMat);
  shingles7.name = 'shingles';
  shingles7.position.set(0, 9.5462, 0.3919);
  shingles7.rotation.set(deg(52.2189), 0, 0);
  roof.add(shingles7);
  const shingles8 = new THREE.Mesh(boxGeo19, roofMat);
  shingles8.name = 'shingles';
  shingles8.position.set(0, 8.8884, 1.0222);
  shingles8.rotation.set(deg(52.2189), 0, 0);
  roof.add(shingles8);
  const shingles9 = new THREE.Mesh(boxGeo19, roofMat);
  shingles9.name = 'shingles';
  shingles9.position.set(0, 8.2307, 1.6526);
  shingles9.rotation.set(deg(52.2189), 0, 0);
  roof.add(shingles9);
  const shingles10 = new THREE.Mesh(boxGeo19, roofMat);
  shingles10.name = 'shingles';
  shingles10.position.set(0, 7.5729, 2.2829);
  shingles10.rotation.set(deg(52.2189), 0, 0);
  roof.add(shingles10);
  const shingles11 = new THREE.Mesh(boxGeo19, roofMat);
  shingles11.name = 'shingles';
  shingles11.position.set(0, 6.9152, 2.9133);
  shingles11.rotation.set(deg(52.2189), 0, 0);
  roof.add(shingles11);
  const shingles12 = new THREE.Mesh(boxGeo19, roofMat);
  shingles12.name = 'shingles';
  shingles12.position.set(0, 6.2574, 3.5436);
  shingles12.rotation.set(deg(52.2189), 0, 0);
  roof.add(shingles12);
  const ridge = new THREE.Mesh(new THREE.BoxGeometry(9.88, 0.2, 0.2), timberMat);
  ridge.name = 'ridge';
  ridge.position.set(0, 10.0057, 0);
  ridge.rotation.set(deg(45), 0, 0);
  roof.add(ridge);
  const bargeBoard = new THREE.Mesh(boxGeo20, timberMat);
  bargeBoard.name = 'bargeBoard';
  bargeBoard.position.set(-4.86, 7.7737, -1.8461);
  bargeBoard.rotation.set(deg(-46.2189), 0, 0);
  roof.add(bargeBoard);
  const bargeBoard2 = new THREE.Mesh(boxGeo20, timberMat);
  bargeBoard2.name = 'bargeBoard';
  bargeBoard2.position.set(-4.86, 7.7737, 1.8461);
  bargeBoard2.rotation.set(deg(46.2189), 0, 0);
  roof.add(bargeBoard2);
  const bargeBoard3 = new THREE.Mesh(boxGeo20, timberMat);
  bargeBoard3.name = 'bargeBoard';
  bargeBoard3.position.set(4.86, 7.7737, -1.8461);
  bargeBoard3.rotation.set(deg(-46.2189), 0, 0);
  roof.add(bargeBoard3);
  const bargeBoard4 = new THREE.Mesh(boxGeo20, timberMat);
  bargeBoard4.name = 'bargeBoard';
  bargeBoard4.position.set(4.86, 7.7737, 1.8461);
  bargeBoard4.rotation.set(deg(46.2189), 0, 0);
  roof.add(bargeBoard4);
  const dormer = new THREE.Mesh(new THREE.BoxGeometry(1.5, 1.45, 1.4854), plasterMat);
  dormer.name = 'dormer';
  dormer.position.set(0, 6.985, 2.4573);
  root.add(dormer);
  const dormerWindow = new THREE.Group();
  dormerWindow.name = 'dormerWindow';
  dormerWindow.position.set(0, 7.01, 3.22);
  root.add(dormerWindow);
  const glass8 = new THREE.Mesh(new THREE.BoxGeometry(0.6, 0.7, 0.04), glassMat);
  glass8.name = 'glass';
  dormerWindow.add(glass8);
  const frame8 = new THREE.Mesh(new THREE.BoxGeometry(0.78, 0.09, 0.12), timberMat);
  frame8.name = 'frame';
  frame8.position.set(0, 0.395, 0.04);
  dormerWindow.add(frame8);
  const frame9 = new THREE.Mesh(boxGeo21, timberMat);
  frame9.name = 'frame';
  frame9.position.set(-0.345, 0, 0.03);
  dormerWindow.add(frame9);
  const frame10 = new THREE.Mesh(boxGeo21, timberMat);
  frame10.name = 'frame';
  frame10.position.set(0.345, 0, 0.03);
  dormerWindow.add(frame10);
  const mullion6 = new THREE.Mesh(new THREE.BoxGeometry(0.05, 0.7, 0.05), timberMat);
  mullion6.name = 'mullion';
  mullion6.position.set(0, 0, 0.03);
  dormerWindow.add(mullion6);
  const sill8 = new THREE.Mesh(new THREE.BoxGeometry(0.88, 0.08, 0.2), timberMat);
  sill8.name = 'sill';
  sill8.position.set(0, -0.39, 0.08);
  dormerWindow.add(sill8);
  const dormerPost = new THREE.Mesh(boxGeo22, timberMat);
  dormerPost.name = 'dormerPost';
  dormerPost.position.set(-0.73, 6.985, 3.22);
  root.add(dormerPost);
  const dormerPost2 = new THREE.Mesh(boxGeo22, timberMat);
  dormerPost2.name = 'dormerPost';
  dormerPost2.position.set(0.73, 6.985, 3.22);
  root.add(dormerPost2);
  const dormerGable = new THREE.Mesh(extrude([[-0.75, 0], [0.75, 0], [0, 0.71]], 0.1), plasterMat);
  dormerGable.name = 'dormerGable';
  dormerGable.position.set(0, 7.71, 3.15);
  root.add(dormerGable);
  const dormerRoof = new THREE.Mesh(boxGeo23, roofMat);
  dormerRoof.name = 'dormerRoof';
  dormerRoof.position.set(-0.4404, 8.1036, 2.6073);
  dormerRoof.rotation.set(0, 0, deg(39.8056));
  root.add(dormerRoof);
  const dormerRoof2 = new THREE.Mesh(boxGeo23, roofMat);
  dormerRoof2.name = 'dormerRoof';
  dormerRoof2.position.set(0.4404, 8.1036, 2.6073);
  dormerRoof2.rotation.set(0, 0, deg(-39.8056));
  root.add(dormerRoof2);
  const dormerRidge = new THREE.Mesh(new THREE.BoxGeometry(0.12, 0.12, 2.0254), timberMat);
  dormerRidge.name = 'dormerRidge';
  dormerRidge.position.set(0, 8.53, 2.6073);
  dormerRidge.rotation.set(0, 0, deg(45));
  root.add(dormerRidge);
  const chimneyBase = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.85, 5.56, 1.5), 0.01, 31), stoneMat);
  chimneyBase.name = 'chimneyBase';
  chimneyBase.position.set(-4.92, 2.78, 0);
  root.add(chimneyBase);
  const chimneyShoulder = new THREE.Mesh(extrude([[-0.75, 0], [0.75, 0], [0.42, 0.6], [-0.42, 0.6]], 0.85), stone2Mat);
  chimneyShoulder.name = 'chimneyShoulder';
  chimneyShoulder.position.set(-4.92, 5.56, 0);
  chimneyShoulder.rotation.set(0, deg(-90), 0);
  root.add(chimneyShoulder);
  const chimneyStack = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.62, 4.9, 0.8), 0.008, 32), stoneMat);
  chimneyStack.name = 'chimneyStack';
  chimneyStack.position.set(-4.92, 8.31, 0);
  root.add(chimneyStack);
  const chimneyCap = new THREE.Mesh(new THREE.BoxGeometry(0.78, 0.14, 0.96), stone2Mat);
  chimneyCap.name = 'chimneyCap';
  chimneyCap.position.set(-4.92, 10.83, 0);
  root.add(chimneyCap);
  const chimneyPot = new THREE.Mesh(cylinderGeo, woodMat);
  chimneyPot.name = 'chimneyPot';
  chimneyPot.position.set(-4.92, 11.05, -0.18);
  root.add(chimneyPot);
  const chimneyPot2 = new THREE.Mesh(cylinderGeo, woodMat);
  chimneyPot2.name = 'chimneyPot';
  chimneyPot2.position.set(-4.92, 11.05, 0.18);
  root.add(chimneyPot2);
  const frontDoor = new THREE.Group();
  frontDoor.name = 'frontDoor';
  frontDoor.position.set(0, 0.4, 3);
  root.add(frontDoor);
  const doorArch = new THREE.Mesh(extrude([[-0.97, 0], [-0.75, 0], [-0.75, 1.6], [-0.7133, 1.8318], [-0.6068, 2.0408], [-0.4408, 2.2068], [-0.2318, 2.3133], [0, 2.35], [0.2318, 2.3133], [0.4408, 2.2068], [0.6068, 2.0408], [0.7133, 1.8318], [0.75, 1.6], [0.75, 0], [0.97, 0], [0.97, 1.6], [0.9225, 1.8997], [0.7847, 2.1702], [0.5702, 2.3847], [0.2997, 2.5225], [0, 2.57], [-0.2997, 2.5225], [-0.5702, 2.3847], [-0.7847, 2.1702], [-0.9225, 1.8997], [-0.97, 1.6]], 0.16), stone2Mat);
  doorArch.name = 'doorArch';
  doorArch.position.set(0, 0, 0.04);
  frontDoor.add(doorArch);
  const doorLeaves = new THREE.Mesh(extrude([[-0.75, 0], [0.75, 0], [0.75, 1.6], [0.7133, 1.8318], [0.6068, 2.0408], [0.4408, 2.2068], [0.2318, 2.3133], [0, 2.35], [-0.2318, 2.3133], [-0.4408, 2.2068], [-0.6068, 2.0408], [-0.7133, 1.8318], [-0.75, 1.6]], 0.08), woodMat);
  doorLeaves.name = 'doorLeaves';
  frontDoor.add(doorLeaves);
  const doorSplit = new THREE.Mesh(new THREE.BoxGeometry(0.04, 2.25, 0.04), timberMat);
  doorSplit.name = 'doorSplit';
  doorSplit.position.set(0, 1.145, 0.05);
  frontDoor.add(doorSplit);
  const doorBand = new THREE.Mesh(boxGeo24, ironMat);
  doorBand.name = 'doorBand';
  doorBand.position.set(0, 0.45, 0.05);
  frontDoor.add(doorBand);
  const doorBand2 = new THREE.Mesh(boxGeo24, ironMat);
  doorBand2.name = 'doorBand';
  doorBand2.position.set(0, 1.5, 0.05);
  frontDoor.add(doorBand2);
  const doorRing = new THREE.Mesh(torusGeo, ironMat);
  doorRing.name = 'doorRing';
  doorRing.position.set(-0.16, 1.08, 0.07);
  frontDoor.add(doorRing);
  const doorRing2 = new THREE.Mesh(torusGeo, ironMat);
  doorRing2.name = 'doorRing';
  doorRing2.position.set(0.16, 1.08, 0.07);
  frontDoor.add(doorRing2);
  const doorStep = new THREE.Mesh(jitter(new THREE.BoxGeometry(2.1, 0.4, 0.55), 0.008, 33), stone2Mat);
  doorStep.name = 'doorStep';
  doorStep.position.set(0, 0.2, 3.27);
  root.add(doorStep);
  const groundWindow = new THREE.Group();
  groundWindow.name = 'groundWindow';
  groundWindow.position.set(-2.6, 1.95, 3);
  root.add(groundWindow);
  const glass9 = new THREE.Mesh(boxGeo25, glassMat);
  glass9.name = 'glass';
  groundWindow.add(glass9);
  const frame11 = new THREE.Mesh(boxGeo26, stone2Mat);
  frame11.name = 'frame';
  frame11.position.set(0, 0.595, 0.04);
  groundWindow.add(frame11);
  const frame12 = new THREE.Mesh(boxGeo27, stone2Mat);
  frame12.name = 'frame';
  frame12.position.set(-0.695, 0, 0.03);
  groundWindow.add(frame12);
  const frame13 = new THREE.Mesh(boxGeo27, stone2Mat);
  frame13.name = 'frame';
  frame13.position.set(0.695, 0, 0.03);
  groundWindow.add(frame13);
  const mullion7 = new THREE.Mesh(boxGeo28, timberMat);
  mullion7.name = 'mullion';
  mullion7.position.set(0, 0, 0.03);
  groundWindow.add(mullion7);
  const sill9 = new THREE.Mesh(boxGeo29, stone2Mat);
  sill9.name = 'sill';
  sill9.position.set(0, -0.565, 0.08);
  groundWindow.add(sill9);
  const groundWindow2 = new THREE.Group();
  groundWindow2.name = 'groundWindow';
  groundWindow2.position.set(2.6, 1.95, -3);
  groundWindow2.rotation.set(0, deg(180), 0);
  root.add(groundWindow2);
  const glass10 = new THREE.Mesh(boxGeo30, glassMat);
  glass10.name = 'glass';
  groundWindow2.add(glass10);
  const sill10 = new THREE.Mesh(boxGeo31, timberMat);
  sill10.name = 'sill';
  sill10.position.set(0, -0.54, 0.08);
  groundWindow2.add(sill10);
  const groundWindow3 = new THREE.Group();
  groundWindow3.name = 'groundWindow';
  groundWindow3.position.set(2.6, 1.95, 3);
  root.add(groundWindow3);
  const glass11 = new THREE.Mesh(boxGeo25, glassMat);
  glass11.name = 'glass';
  groundWindow3.add(glass11);
  const frame14 = new THREE.Mesh(boxGeo26, stone2Mat);
  frame14.name = 'frame';
  frame14.position.set(0, 0.595, 0.04);
  groundWindow3.add(frame14);
  const frame15 = new THREE.Mesh(boxGeo27, stone2Mat);
  frame15.name = 'frame';
  frame15.position.set(-0.695, 0, 0.03);
  groundWindow3.add(frame15);
  const frame16 = new THREE.Mesh(boxGeo27, stone2Mat);
  frame16.name = 'frame';
  frame16.position.set(0.695, 0, 0.03);
  groundWindow3.add(frame16);
  const mullion8 = new THREE.Mesh(boxGeo28, timberMat);
  mullion8.name = 'mullion';
  mullion8.position.set(0, 0, 0.03);
  groundWindow3.add(mullion8);
  const sill11 = new THREE.Mesh(boxGeo29, stone2Mat);
  sill11.name = 'sill';
  sill11.position.set(0, -0.565, 0.08);
  groundWindow3.add(sill11);
  const groundWindow4 = new THREE.Group();
  groundWindow4.name = 'groundWindow';
  groundWindow4.position.set(-2.6, 1.95, -3);
  groundWindow4.rotation.set(0, deg(180), 0);
  root.add(groundWindow4);
  const glass12 = new THREE.Mesh(boxGeo30, glassMat);
  glass12.name = 'glass';
  groundWindow4.add(glass12);
  const sill12 = new THREE.Mesh(boxGeo31, timberMat);
  sill12.name = 'sill';
  sill12.position.set(0, -0.54, 0.08);
  groundWindow4.add(sill12);
  const groundWindow5 = new THREE.Group();
  groundWindow5.name = 'groundWindow';
  groundWindow5.position.set(4.5, 1.95, 0);
  groundWindow5.rotation.set(0, deg(90), 0);
  root.add(groundWindow5);
  const glass13 = new THREE.Mesh(new THREE.BoxGeometry(1.1, 1, 0.04), glassMat);
  glass13.name = 'glass';
  groundWindow5.add(glass13);
  const frame17 = new THREE.Mesh(new THREE.BoxGeometry(1.38, 0.14, 0.12), stone2Mat);
  frame17.name = 'frame';
  frame17.position.set(0, 0.57, 0.04);
  groundWindow5.add(frame17);
  const frame18 = new THREE.Mesh(boxGeo32, stone2Mat);
  frame18.name = 'frame';
  frame18.position.set(-0.62, 0, 0.03);
  groundWindow5.add(frame18);
  const frame19 = new THREE.Mesh(boxGeo32, stone2Mat);
  frame19.name = 'frame';
  frame19.position.set(0.62, 0, 0.03);
  groundWindow5.add(frame19);
  const mullion9 = new THREE.Mesh(new THREE.BoxGeometry(0.05, 1, 0.05), timberMat);
  mullion9.name = 'mullion';
  mullion9.position.set(0, 0, 0.03);
  groundWindow5.add(mullion9);
  const sill13 = new THREE.Mesh(new THREE.BoxGeometry(1.48, 0.08, 0.2), stone2Mat);
  sill13.name = 'sill';
  sill13.position.set(0, -0.54, 0.08);
  groundWindow5.add(sill13);
  const wallLantern = new THREE.Group();
  wallLantern.name = 'wallLantern';
  wallLantern.position.set(-1.3, 2.45, 3);
  root.add(wallLantern);
  const lanternArm = new THREE.Mesh(boxGeo33, ironMat);
  lanternArm.name = 'lanternArm';
  lanternArm.position.set(0, 0.18, 0.15);
  wallLantern.add(lanternArm);
  const lanternRoof = new THREE.Mesh(cylinderGeo2, ironMat);
  lanternRoof.name = 'lanternRoof';
  lanternRoof.position.set(0, 0.12, 0.27);
  wallLantern.add(lanternRoof);
  const lanternGlass = new THREE.Mesh(boxGeo34, glassMat);
  lanternGlass.name = 'lanternGlass';
  lanternGlass.position.set(0, -0.02, 0.27);
  wallLantern.add(lanternGlass);
  const lanternBase = new THREE.Mesh(boxGeo35, ironMat);
  lanternBase.name = 'lanternBase';
  lanternBase.position.set(0, -0.135, 0.27);
  wallLantern.add(lanternBase);
  const wallLantern2 = new THREE.Group();
  wallLantern2.name = 'wallLantern';
  wallLantern2.position.set(1.3, 2.45, 3);
  root.add(wallLantern2);
  const lanternArm2 = new THREE.Mesh(boxGeo33, ironMat);
  lanternArm2.name = 'lanternArm';
  lanternArm2.position.set(0, 0.18, 0.15);
  wallLantern2.add(lanternArm2);
  const lanternRoof2 = new THREE.Mesh(cylinderGeo2, ironMat);
  lanternRoof2.name = 'lanternRoof';
  lanternRoof2.position.set(0, 0.12, 0.27);
  wallLantern2.add(lanternRoof2);
  const lanternGlass2 = new THREE.Mesh(boxGeo34, glassMat);
  lanternGlass2.name = 'lanternGlass';
  lanternGlass2.position.set(0, -0.02, 0.27);
  wallLantern2.add(lanternGlass2);
  const lanternBase2 = new THREE.Mesh(boxGeo35, ironMat);
  lanternBase2.name = 'lanternBase';
  lanternBase2.position.set(0, -0.135, 0.27);
  wallLantern2.add(lanternBase2);
  const signArm = new THREE.Mesh(new THREE.BoxGeometry(0.06, 0.06, 1.25), ironMat);
  signArm.name = 'signArm';
  signArm.position.set(3.95, 4.31, 4.115);
  root.add(signArm);
  const signStay = new THREE.Mesh(new THREE.BoxGeometry(0.04, 0.9126, 0.04), ironMat);
  signStay.name = 'signStay';
  signStay.position.set(3.95, 4.02, 3.865);
  signStay.rotation.set(deg(-124.7349), 0, deg(-180));
  root.add(signStay);
  const signScroll = new THREE.Mesh(new THREE.TorusGeometry(0.12, 0.015, 3, 8, Math.PI), ironMat);
  signScroll.name = 'signScroll';
  signScroll.position.set(3.95, 4.33, 3.865);
  signScroll.rotation.set(0, deg(90), 0);
  root.add(signScroll);
  const signChain = new THREE.Mesh(cylinderGeo3, ironMat);
  signChain.name = 'signChain';
  signChain.position.set(3.95, 4.16, 3.98);
  root.add(signChain);
  const signChain2 = new THREE.Mesh(cylinderGeo3, ironMat);
  signChain2.name = 'signChain';
  signChain2.position.set(3.95, 4.16, 4.5);
  root.add(signChain2);
  const signBoard = new THREE.Mesh(new THREE.BoxGeometry(0.06, 0.6, 0.75), woodMat);
  signBoard.name = 'signBoard';
  signBoard.position.set(3.95, 3.76, 4.24);
  root.add(signBoard);
  const signFrame = new THREE.Mesh(boxGeo36, timberMat);
  signFrame.name = 'signFrame';
  signFrame.position.set(3.95, 3.76, 3.86);
  root.add(signFrame);
  const signFrame2 = new THREE.Mesh(boxGeo36, timberMat);
  signFrame2.name = 'signFrame';
  signFrame2.position.set(3.95, 3.76, 4.62);
  root.add(signFrame2);
  const tankard = new THREE.Mesh(cylinderGeo4, goldMat);
  tankard.name = 'tankard';
  tankard.position.set(3.905, 3.72, 4.19);
  tankard.scale.set(0.3, 1, 1);
  root.add(tankard);
  const tankardHandle = new THREE.Mesh(torusGeo2, goldMat);
  tankardHandle.name = 'tankardHandle';
  tankardHandle.position.set(3.905, 3.72, 4.28);
  tankardHandle.rotation.set(deg(90), deg(90), 0);
  root.add(tankardHandle);
  const tankardFoam = new THREE.Mesh(boxGeo37, plasterMat);
  tankardFoam.name = 'tankardFoam';
  tankardFoam.position.set(3.905, 3.87, 4.19);
  root.add(tankardFoam);
  const tankard2 = new THREE.Mesh(cylinderGeo4, goldMat);
  tankard2.name = 'tankard';
  tankard2.position.set(3.995, 3.72, 4.19);
  tankard2.scale.set(0.3, 1, 1);
  root.add(tankard2);
  const tankardHandle2 = new THREE.Mesh(torusGeo2, goldMat);
  tankardHandle2.name = 'tankardHandle';
  tankardHandle2.position.set(3.995, 3.72, 4.28);
  tankardHandle2.rotation.set(deg(90), deg(90), 0);
  root.add(tankardHandle2);
  const tankardFoam2 = new THREE.Mesh(boxGeo37, plasterMat);
  tankardFoam2.name = 'tankardFoam';
  tankardFoam2.position.set(3.995, 3.87, 4.19);
  root.add(tankardFoam2);
  const barrel = new THREE.Mesh(cylinderGeo5, woodMat);
  barrel.name = 'barrel';
  barrel.position.set(-1.95, 0.4, 3.55);
  root.add(barrel);
  const barrelHoop = new THREE.Mesh(cylinderGeo6, ironMat);
  barrelHoop.name = 'barrelHoop';
  barrelHoop.position.set(-1.95, 0.15, 3.55);
  root.add(barrelHoop);
  const barrelHoop2 = new THREE.Mesh(cylinderGeo6, ironMat);
  barrelHoop2.name = 'barrelHoop';
  barrelHoop2.position.set(-1.95, 0.65, 3.55);
  root.add(barrelHoop2);
  const barrel2 = new THREE.Mesh(cylinderGeo5, woodMat);
  barrel2.name = 'barrel';
  barrel2.position.set(-2.6, 0.4, 3.45);
  barrel2.rotation.set(0, deg(20), 0);
  root.add(barrel2);
  const barrelHoop3 = new THREE.Mesh(cylinderGeo6, ironMat);
  barrelHoop3.name = 'barrelHoop';
  barrelHoop3.position.set(-2.6, 0.15, 3.45);
  root.add(barrelHoop3);
  const barrelHoop4 = new THREE.Mesh(cylinderGeo6, ironMat);
  barrelHoop4.name = 'barrelHoop';
  barrelHoop4.position.set(-2.6, 0.65, 3.45);
  root.add(barrelHoop4);
  const benchSeat = new THREE.Mesh(new THREE.BoxGeometry(1.5, 0.08, 0.36), woodMat);
  benchSeat.name = 'benchSeat';
  benchSeat.position.set(2.6, 0.46, 3.45);
  root.add(benchSeat);
  const benchLeg = new THREE.Mesh(boxGeo38, timberMat);
  benchLeg.name = 'benchLeg';
  benchLeg.position.set(2, 0.21, 3.45);
  root.add(benchLeg);
  const benchLeg2 = new THREE.Mesh(boxGeo38, timberMat);
  benchLeg2.name = 'benchLeg';
  benchLeg2.position.set(3.2, 0.21, 3.45);
  root.add(benchLeg2);

  root.traverse((o) => {
    if (o.isMesh) {
      o.castShadow = true;
      o.receiveShadow = true;
    }
  });
  return root;
}

export default createTavern;

Notes et commentaires

—
Aucune note pour l’instant — soyez le premier.
5
0
4
0
3
0
2
0
1
0

Connectez-vous pour noter et commenter.

0 commentaire

Aucun commentaire pour l’instant. Dites comment vous avez utilisé ce modèle ou ce qui pourrait être amélioré.

Modèles similaires

Même catégorie ou étiquettes proches