Codels
1,9 B üçgen6,88 × 6,06 × 5,56 m
Bağımsız bir ES modülü — yalnızca three paketine bağımlıdır. Fabrika fonksiyonunu çağırıp dönen grubu sahnene ekle.
/**
 * Cottage — Codels 3D model library
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 1,932 · Size (W × H × D): 6.88 × 6.06 × 5.56 m
 *
 * Usage:
 *   import { createCottage } from './cottage.js';
 *   
 *   const model = createCottage();
 *   model.position.set(0, 0, 0);
 *   scene.add(model);
 */
import * as THREE from 'three';

const deg = THREE.MathUtils.degToRad;

// 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 createCottage() {
  const root = new THREE.Group();
  root.name = 'Cottage';

  // Materials
  const plasterMat = new THREE.MeshStandardMaterial({ name: 'plaster', color: 0xefe2c6, roughness: 0.95, flatShading: true });
  const stoneMat = new THREE.MeshStandardMaterial({ name: 'stone', color: 0x8f8a83, roughness: 0.95, flatShading: true });
  const roofMat = new THREE.MeshStandardMaterial({ name: 'roof', color: 0xa4442f, roughness: 0.85, flatShading: true });
  const woodMat = new THREE.MeshStandardMaterial({ name: 'wood', color: 0x6a4a31, roughness: 0.9, flatShading: true });
  const glassMat = new THREE.MeshStandardMaterial({ name: 'glass', color: 0xa9cfe0, roughness: 0.25, metalness: 0.1, flatShading: true });
  const accentMat = new THREE.MeshStandardMaterial({ name: 'accent', color: 0x3f6f7a, roughness: 0.8, flatShading: true });

  // Shared geometries
  const boxGeo = new THREE.BoxGeometry(6.02, 0.16, 0.08);
  const boxGeo2 = new THREE.BoxGeometry(0.08, 0.16, 4.42);
  const boxGeo3 = new THREE.BoxGeometry(0.08, 0.12, 1.8916);
  const boxGeo4 = new THREE.BoxGeometry(0.08, 1.178, 0.12);
  const boxGeo5 = new THREE.BoxGeometry(6.8, 0.1, 3.4369);
  const boxGeo6 = new THREE.BoxGeometry(6.82, 0.07, 0.7424);
  const boxGeo7 = new THREE.BoxGeometry(0.08, 0.14, 3.3069);
  const boxGeo8 = new THREE.BoxGeometry(0.8, 1, 0.02);
  const boxGeo9 = new THREE.BoxGeometry(0.96, 0.08, 0.08);
  const boxGeo10 = new THREE.BoxGeometry(0.08, 1, 0.08);
  const boxGeo11 = new THREE.BoxGeometry(0.05, 1, 0.04);
  const boxGeo12 = new THREE.BoxGeometry(0.8, 0.05, 0.04);
  const boxGeo13 = new THREE.BoxGeometry(1.08, 0.07, 0.2);
  const boxGeo14 = new THREE.BoxGeometry(0.42, 1.1, 0.04);
  const boxGeo15 = new THREE.BoxGeometry(0.294, 0.05, 0.02);
  const boxGeo16 = new THREE.BoxGeometry(0.45, 0.5, 0.02);
  const boxGeo17 = new THREE.BoxGeometry(0.61, 0.08, 0.08);
  const boxGeo18 = new THREE.BoxGeometry(0.08, 0.5, 0.08);
  const boxGeo19 = new THREE.BoxGeometry(0.05, 0.5, 0.04);
  const boxGeo20 = new THREE.BoxGeometry(0.45, 0.05, 0.04);
  const boxGeo21 = new THREE.BoxGeometry(0.73, 0.07, 0.2);
  const boxGeo22 = new THREE.BoxGeometry(0.025, 1.93, 0.02);
  const boxGeo23 = new THREE.BoxGeometry(0.9, 0.08, 0.02);
  const boxGeo24 = new THREE.BoxGeometry(0.12, 2.17, 0.12);

  // Parts
  const plinth = new THREE.Mesh(new THREE.BoxGeometry(6.14, 0.35, 4.54), stoneMat);
  plinth.name = 'plinth';
  plinth.position.set(0, 0.175, 0);
  root.add(plinth);
  const walls = new THREE.Mesh(new THREE.BoxGeometry(6, 2.7, 4.4), plasterMat);
  walls.name = 'walls';
  walls.position.set(0, 1.7, 0);
  root.add(walls);
  const gables = new THREE.Mesh(extrude([[-2.2, 0], [2.2, 0], [0, 1.88]], 6), plasterMat);
  gables.name = 'gables';
  gables.position.set(0, 3.05, 0);
  gables.rotation.set(0, deg(90), 0);
  root.add(gables);
  const quoin = new THREE.Mesh(new THREE.BoxGeometry(0.4609, 0.38, 0.265), stoneMat);
  quoin.name = 'quoin';
  quoin.position.set(-2.7995, 0.56, -2.0975);
  root.add(quoin);
  const quoin2 = new THREE.Mesh(new THREE.BoxGeometry(0.3382, 0.38, 0.5159), stoneMat);
  quoin2.name = 'quoin';
  quoin2.position.set(-2.8609, 0.98, -1.972);
  root.add(quoin2);
  const quoin3 = new THREE.Mesh(new THREE.BoxGeometry(0.5017, 0.38, 0.2924), stoneMat);
  quoin3.name = 'quoin';
  quoin3.position.set(-2.7791, 1.4, -2.0838);
  root.add(quoin3);
  const quoin4 = new THREE.Mesh(new THREE.BoxGeometry(0.2973, 0.38, 0.4792), stoneMat);
  quoin4.name = 'quoin';
  quoin4.position.set(-2.8814, 1.82, -1.9904);
  root.add(quoin4);
  const quoin5 = new THREE.Mesh(new THREE.BoxGeometry(0.5043, 0.38, 0.3184), stoneMat);
  quoin5.name = 'quoin';
  quoin5.position.set(-2.7779, 2.24, -2.0708);
  root.add(quoin5);
  const quoin6 = new THREE.Mesh(new THREE.BoxGeometry(0.2806, 0.38, 0.4725), stoneMat);
  quoin6.name = 'quoin';
  quoin6.position.set(-2.8897, 2.66, -1.9938);
  root.add(quoin6);
  const quoin7 = new THREE.Mesh(new THREE.BoxGeometry(0.3211, 0.38, 0.5015), stoneMat);
  quoin7.name = 'quoin';
  quoin7.position.set(-2.8694, 0.56, 1.9793);
  root.add(quoin7);
  const quoin8 = new THREE.Mesh(new THREE.BoxGeometry(0.4758, 0.38, 0.2894), stoneMat);
  quoin8.name = 'quoin';
  quoin8.position.set(-2.7921, 0.98, 2.0853);
  root.add(quoin8);
  const quoin9 = new THREE.Mesh(new THREE.BoxGeometry(0.2835, 0.38, 0.5028), stoneMat);
  quoin9.name = 'quoin';
  quoin9.position.set(-2.8883, 1.4, 1.9786);
  root.add(quoin9);
  const quoin10 = new THREE.Mesh(new THREE.BoxGeometry(0.4837, 0.38, 0.3382), stoneMat);
  quoin10.name = 'quoin';
  quoin10.position.set(-2.7881, 1.82, 2.0609);
  root.add(quoin10);
  const quoin11 = new THREE.Mesh(new THREE.BoxGeometry(0.2798, 0.38, 0.5302), stoneMat);
  quoin11.name = 'quoin';
  quoin11.position.set(-2.8901, 2.24, 1.9649);
  root.add(quoin11);
  const quoin12 = new THREE.Mesh(new THREE.BoxGeometry(0.4753, 0.38, 0.2715), stoneMat);
  quoin12.name = 'quoin';
  quoin12.position.set(-2.7924, 2.66, 2.0943);
  root.add(quoin12);
  const quoin13 = new THREE.Mesh(new THREE.BoxGeometry(0.2724, 0.38, 0.4833), stoneMat);
  quoin13.name = 'quoin';
  quoin13.position.set(2.8938, 0.56, -1.9884);
  root.add(quoin13);
  const quoin14 = new THREE.Mesh(new THREE.BoxGeometry(0.5038, 0.38, 0.3209), stoneMat);
  quoin14.name = 'quoin';
  quoin14.position.set(2.7781, 0.98, -2.0695);
  root.add(quoin14);
  const quoin15 = new THREE.Mesh(new THREE.BoxGeometry(0.266, 0.38, 0.533), stoneMat);
  quoin15.name = 'quoin';
  quoin15.position.set(2.897, 1.4, -1.9635);
  root.add(quoin15);
  const quoin16 = new THREE.Mesh(new THREE.BoxGeometry(0.5043, 0.38, 0.3097), stoneMat);
  quoin16.name = 'quoin';
  quoin16.position.set(2.7779, 1.82, -2.0751);
  root.add(quoin16);
  const quoin17 = new THREE.Mesh(new THREE.BoxGeometry(0.3144, 0.38, 0.5373), stoneMat);
  quoin17.name = 'quoin';
  quoin17.position.set(2.8728, 2.24, -1.9614);
  root.add(quoin17);
  const quoin18 = new THREE.Mesh(new THREE.BoxGeometry(0.51, 0.38, 0.3337), stoneMat);
  quoin18.name = 'quoin';
  quoin18.position.set(2.775, 2.66, -2.0632);
  root.add(quoin18);
  const quoin19 = new THREE.Mesh(new THREE.BoxGeometry(0.5262, 0.38, 0.2632), stoneMat);
  quoin19.name = 'quoin';
  quoin19.position.set(2.7669, 0.56, 2.0984);
  root.add(quoin19);
  const quoin20 = new THREE.Mesh(new THREE.BoxGeometry(0.274, 0.38, 0.4886), stoneMat);
  quoin20.name = 'quoin';
  quoin20.position.set(2.893, 0.98, 1.9857);
  root.add(quoin20);
  const quoin21 = new THREE.Mesh(new THREE.BoxGeometry(0.494, 0.38, 0.2616), stoneMat);
  quoin21.name = 'quoin';
  quoin21.position.set(2.783, 1.4, 2.0992);
  root.add(quoin21);
  const quoin22 = new THREE.Mesh(new THREE.BoxGeometry(0.267, 0.38, 0.5214), stoneMat);
  quoin22.name = 'quoin';
  quoin22.position.set(2.8965, 1.82, 1.9693);
  root.add(quoin22);
  const quoin23 = new THREE.Mesh(new THREE.BoxGeometry(0.4895, 0.38, 0.2941), stoneMat);
  quoin23.name = 'quoin';
  quoin23.position.set(2.7852, 2.24, 2.0829);
  root.add(quoin23);
  const quoin24 = new THREE.Mesh(new THREE.BoxGeometry(0.2975, 0.38, 0.5357), stoneMat);
  quoin24.name = 'quoin';
  quoin24.position.set(2.8813, 2.66, 1.9622);
  root.add(quoin24);
  const wallPlate = new THREE.Mesh(boxGeo, woodMat);
  wallPlate.name = 'wallPlate';
  wallPlate.position.set(0, 2.99, -2.23);
  root.add(wallPlate);
  const wallPlate2 = new THREE.Mesh(boxGeo, woodMat);
  wallPlate2.name = 'wallPlate';
  wallPlate2.position.set(0, 2.99, 2.23);
  root.add(wallPlate2);
  const gableBeam = new THREE.Mesh(boxGeo2, woodMat);
  gableBeam.name = 'gableBeam';
  gableBeam.position.set(-3.03, 2.99, 0);
  root.add(gableBeam);
  const brace = new THREE.Mesh(boxGeo3, woodMat);
  brace.name = 'brace';
  brace.position.set(-3.03, 3.639, -1.16);
  brace.rotation.set(deg(-38.5179), 0, 0);
  root.add(brace);
  const gablePost = new THREE.Mesh(boxGeo4, woodMat);
  gablePost.name = 'gablePost';
  gablePost.position.set(-3.03, 3.639, -0.42);
  root.add(gablePost);
  const brace2 = new THREE.Mesh(boxGeo3, woodMat);
  brace2.name = 'brace';
  brace2.position.set(-3.03, 3.639, 1.16);
  brace2.rotation.set(deg(38.5179), 0, 0);
  root.add(brace2);
  const gablePost2 = new THREE.Mesh(boxGeo4, woodMat);
  gablePost2.name = 'gablePost';
  gablePost2.position.set(-3.03, 3.639, 0.42);
  root.add(gablePost2);
  const gableBeam2 = new THREE.Mesh(boxGeo2, woodMat);
  gableBeam2.name = 'gableBeam';
  gableBeam2.position.set(3.03, 2.99, 0);
  root.add(gableBeam2);
  const brace3 = new THREE.Mesh(boxGeo3, woodMat);
  brace3.name = 'brace';
  brace3.position.set(3.03, 3.639, -1.16);
  brace3.rotation.set(deg(-38.5179), 0, 0);
  root.add(brace3);
  const gablePost3 = new THREE.Mesh(boxGeo4, woodMat);
  gablePost3.name = 'gablePost';
  gablePost3.position.set(3.03, 3.639, -0.42);
  root.add(gablePost3);
  const brace4 = new THREE.Mesh(boxGeo3, woodMat);
  brace4.name = 'brace';
  brace4.position.set(3.03, 3.639, 1.16);
  brace4.rotation.set(deg(38.5179), 0, 0);
  root.add(brace4);
  const gablePost4 = new THREE.Mesh(boxGeo4, woodMat);
  gablePost4.name = 'gablePost';
  gablePost4.position.set(3.03, 3.639, 0.42);
  root.add(gablePost4);
  const roofFront = new THREE.Mesh(boxGeo5, roofMat);
  roofFront.name = 'roofFront';
  roofFront.position.set(0, 3.8842, 1.3105);
  roofFront.rotation.set(deg(40.8151), 0, 0);
  root.add(roofFront);
  const roofBack = new THREE.Mesh(boxGeo5, roofMat);
  roofBack.name = 'roofBack';
  roofBack.position.set(0, 3.8842, -1.3105);
  roofBack.rotation.set(deg(-40.8151), 0, 0);
  root.add(roofBack);
  const shingles = new THREE.Mesh(boxGeo6, roofMat);
  shingles.name = 'shingles';
  shingles.position.set(0, 4.8471, -0.3256);
  shingles.rotation.set(deg(-46.8151), 0, 0);
  root.add(shingles);
  const shingles2 = new THREE.Mesh(boxGeo6, roofMat);
  shingles2.name = 'shingles';
  shingles2.position.set(0, 4.8471, 0.3256);
  shingles2.rotation.set(deg(46.8151), 0, 0);
  root.add(shingles2);
  const shingles3 = new THREE.Mesh(boxGeo6, roofMat);
  shingles3.name = 'shingles';
  shingles3.position.set(0, 4.3979, -0.8459);
  shingles3.rotation.set(deg(-46.8151), 0, 0);
  root.add(shingles3);
  const shingles4 = new THREE.Mesh(boxGeo6, roofMat);
  shingles4.name = 'shingles';
  shingles4.position.set(0, 4.3979, 0.8459);
  shingles4.rotation.set(deg(46.8151), 0, 0);
  root.add(shingles4);
  const shingles5 = new THREE.Mesh(boxGeo6, roofMat);
  shingles5.name = 'shingles';
  shingles5.position.set(0, 3.9486, -1.3661);
  shingles5.rotation.set(deg(-46.8151), 0, 0);
  root.add(shingles5);
  const shingles6 = new THREE.Mesh(boxGeo6, roofMat);
  shingles6.name = 'shingles';
  shingles6.position.set(0, 3.9486, 1.3661);
  shingles6.rotation.set(deg(46.8151), 0, 0);
  root.add(shingles6);
  const shingles7 = new THREE.Mesh(boxGeo6, roofMat);
  shingles7.name = 'shingles';
  shingles7.position.set(0, 3.4993, -1.8863);
  shingles7.rotation.set(deg(-46.8151), 0, 0);
  root.add(shingles7);
  const shingles8 = new THREE.Mesh(boxGeo6, roofMat);
  shingles8.name = 'shingles';
  shingles8.position.set(0, 3.4993, 1.8863);
  shingles8.rotation.set(deg(46.8151), 0, 0);
  root.add(shingles8);
  const shingles9 = new THREE.Mesh(boxGeo6, roofMat);
  shingles9.name = 'shingles';
  shingles9.position.set(0, 3.05, -2.4065);
  shingles9.rotation.set(deg(-46.8151), 0, 0);
  root.add(shingles9);
  const shingles10 = new THREE.Mesh(boxGeo6, roofMat);
  shingles10.name = 'shingles';
  shingles10.position.set(0, 3.05, 2.4065);
  shingles10.rotation.set(deg(46.8151), 0, 0);
  root.add(shingles10);
  const ridge = new THREE.Mesh(new THREE.BoxGeometry(6.88, 0.22, 0.22), woodMat);
  ridge.name = 'ridge';
  ridge.position.set(0, 5.1746, 0);
  ridge.rotation.set(deg(45), 0, 0);
  root.add(ridge);
  const fascia = new THREE.Mesh(boxGeo7, woodMat);
  fascia.name = 'fascia';
  fascia.position.set(-3.36, 3.8193, -1.2514);
  fascia.rotation.set(deg(-40.8151), 0, 0);
  root.add(fascia);
  const fascia2 = new THREE.Mesh(boxGeo7, woodMat);
  fascia2.name = 'fascia';
  fascia2.position.set(-3.36, 3.8193, 1.2514);
  fascia2.rotation.set(deg(40.8151), 0, 0);
  root.add(fascia2);
  const fascia3 = new THREE.Mesh(boxGeo7, woodMat);
  fascia3.name = 'fascia';
  fascia3.position.set(3.36, 3.8193, -1.2514);
  fascia3.rotation.set(deg(-40.8151), 0, 0);
  root.add(fascia3);
  const fascia4 = new THREE.Mesh(boxGeo7, woodMat);
  fascia4.name = 'fascia';
  fascia4.position.set(3.36, 3.8193, 1.2514);
  fascia4.rotation.set(deg(40.8151), 0, 0);
  root.add(fascia4);
  const frontWindow = new THREE.Group();
  frontWindow.name = 'frontWindow';
  frontWindow.position.set(-1.725, 1.8, 2.2);
  root.add(frontWindow);
  const glass = new THREE.Mesh(boxGeo8, glassMat);
  glass.name = 'glass';
  glass.position.set(0, 0, 0.005);
  frontWindow.add(glass);
  const box59 = new THREE.Mesh(boxGeo9, woodMat);
  box59.position.set(0, 0.54, 0.04);
  frontWindow.add(box59);
  const box60 = new THREE.Mesh(boxGeo9, woodMat);
  box60.position.set(0, -0.54, 0.04);
  frontWindow.add(box60);
  const box61 = new THREE.Mesh(boxGeo10, woodMat);
  box61.position.set(-0.44, 0, 0.04);
  frontWindow.add(box61);
  const box62 = new THREE.Mesh(boxGeo10, woodMat);
  box62.position.set(0.44, 0, 0.04);
  frontWindow.add(box62);
  const box63 = new THREE.Mesh(boxGeo11, woodMat);
  box63.position.set(0, 0, 0.025);
  frontWindow.add(box63);
  const box64 = new THREE.Mesh(boxGeo12, woodMat);
  box64.position.set(0, 0, 0.025);
  frontWindow.add(box64);
  const sill = new THREE.Mesh(boxGeo13, woodMat);
  sill.name = 'sill';
  sill.position.set(0, -0.615, 0.1);
  frontWindow.add(sill);
  const shutter = new THREE.Mesh(boxGeo14, accentMat);
  shutter.name = 'shutter';
  shutter.position.set(-0.72, 0, 0.03);
  frontWindow.add(shutter);
  const box67 = new THREE.Mesh(boxGeo15, woodMat);
  box67.position.set(-0.72, 0.28, 0.055);
  frontWindow.add(box67);
  const box68 = new THREE.Mesh(boxGeo15, woodMat);
  box68.position.set(-0.72, -0.28, 0.055);
  frontWindow.add(box68);
  const shutter2 = new THREE.Mesh(boxGeo14, accentMat);
  shutter2.name = 'shutter';
  shutter2.position.set(0.72, 0, 0.03);
  frontWindow.add(shutter2);
  const box70 = new THREE.Mesh(boxGeo15, woodMat);
  box70.position.set(0.72, 0.28, 0.055);
  frontWindow.add(box70);
  const box71 = new THREE.Mesh(boxGeo15, woodMat);
  box71.position.set(0.72, -0.28, 0.055);
  frontWindow.add(box71);
  const backWindow = new THREE.Group();
  backWindow.name = 'backWindow';
  backWindow.position.set(-1.725, 1.8, -2.2);
  backWindow.rotation.set(0, deg(180), 0);
  root.add(backWindow);
  const glass2 = new THREE.Mesh(boxGeo8, glassMat);
  glass2.name = 'glass';
  glass2.position.set(0, 0, 0.005);
  backWindow.add(glass2);
  const box74 = new THREE.Mesh(boxGeo9, woodMat);
  box74.position.set(0, 0.54, 0.04);
  backWindow.add(box74);
  const box75 = new THREE.Mesh(boxGeo9, woodMat);
  box75.position.set(0, -0.54, 0.04);
  backWindow.add(box75);
  const box76 = new THREE.Mesh(boxGeo10, woodMat);
  box76.position.set(-0.44, 0, 0.04);
  backWindow.add(box76);
  const box77 = new THREE.Mesh(boxGeo10, woodMat);
  box77.position.set(0.44, 0, 0.04);
  backWindow.add(box77);
  const box78 = new THREE.Mesh(boxGeo11, woodMat);
  box78.position.set(0, 0, 0.025);
  backWindow.add(box78);
  const box79 = new THREE.Mesh(boxGeo12, woodMat);
  box79.position.set(0, 0, 0.025);
  backWindow.add(box79);
  const sill2 = new THREE.Mesh(boxGeo13, woodMat);
  sill2.name = 'sill';
  sill2.position.set(0, -0.615, 0.1);
  backWindow.add(sill2);
  const frontWindow2 = new THREE.Group();
  frontWindow2.name = 'frontWindow';
  frontWindow2.position.set(1.725, 1.8, 2.2);
  root.add(frontWindow2);
  const glass3 = new THREE.Mesh(boxGeo8, glassMat);
  glass3.name = 'glass';
  glass3.position.set(0, 0, 0.005);
  frontWindow2.add(glass3);
  const box83 = new THREE.Mesh(boxGeo9, woodMat);
  box83.position.set(0, 0.54, 0.04);
  frontWindow2.add(box83);
  const box84 = new THREE.Mesh(boxGeo9, woodMat);
  box84.position.set(0, -0.54, 0.04);
  frontWindow2.add(box84);
  const box85 = new THREE.Mesh(boxGeo10, woodMat);
  box85.position.set(-0.44, 0, 0.04);
  frontWindow2.add(box85);
  const box86 = new THREE.Mesh(boxGeo10, woodMat);
  box86.position.set(0.44, 0, 0.04);
  frontWindow2.add(box86);
  const box87 = new THREE.Mesh(boxGeo11, woodMat);
  box87.position.set(0, 0, 0.025);
  frontWindow2.add(box87);
  const box88 = new THREE.Mesh(boxGeo12, woodMat);
  box88.position.set(0, 0, 0.025);
  frontWindow2.add(box88);
  const sill3 = new THREE.Mesh(boxGeo13, woodMat);
  sill3.name = 'sill';
  sill3.position.set(0, -0.615, 0.1);
  frontWindow2.add(sill3);
  const shutter3 = new THREE.Mesh(boxGeo14, accentMat);
  shutter3.name = 'shutter';
  shutter3.position.set(-0.72, 0, 0.03);
  frontWindow2.add(shutter3);
  const box91 = new THREE.Mesh(boxGeo15, woodMat);
  box91.position.set(-0.72, 0.28, 0.055);
  frontWindow2.add(box91);
  const box92 = new THREE.Mesh(boxGeo15, woodMat);
  box92.position.set(-0.72, -0.28, 0.055);
  frontWindow2.add(box92);
  const shutter4 = new THREE.Mesh(boxGeo14, accentMat);
  shutter4.name = 'shutter';
  shutter4.position.set(0.72, 0, 0.03);
  frontWindow2.add(shutter4);
  const box94 = new THREE.Mesh(boxGeo15, woodMat);
  box94.position.set(0.72, 0.28, 0.055);
  frontWindow2.add(box94);
  const box95 = new THREE.Mesh(boxGeo15, woodMat);
  box95.position.set(0.72, -0.28, 0.055);
  frontWindow2.add(box95);
  const backWindow2 = new THREE.Group();
  backWindow2.name = 'backWindow';
  backWindow2.position.set(1.725, 1.8, -2.2);
  backWindow2.rotation.set(0, deg(180), 0);
  root.add(backWindow2);
  const glass4 = new THREE.Mesh(boxGeo8, glassMat);
  glass4.name = 'glass';
  glass4.position.set(0, 0, 0.005);
  backWindow2.add(glass4);
  const box98 = new THREE.Mesh(boxGeo9, woodMat);
  box98.position.set(0, 0.54, 0.04);
  backWindow2.add(box98);
  const box99 = new THREE.Mesh(boxGeo9, woodMat);
  box99.position.set(0, -0.54, 0.04);
  backWindow2.add(box99);
  const box100 = new THREE.Mesh(boxGeo10, woodMat);
  box100.position.set(-0.44, 0, 0.04);
  backWindow2.add(box100);
  const box101 = new THREE.Mesh(boxGeo10, woodMat);
  box101.position.set(0.44, 0, 0.04);
  backWindow2.add(box101);
  const box102 = new THREE.Mesh(boxGeo11, woodMat);
  box102.position.set(0, 0, 0.025);
  backWindow2.add(box102);
  const box103 = new THREE.Mesh(boxGeo12, woodMat);
  box103.position.set(0, 0, 0.025);
  backWindow2.add(box103);
  const sill4 = new THREE.Mesh(boxGeo13, woodMat);
  sill4.name = 'sill';
  sill4.position.set(0, -0.615, 0.1);
  backWindow2.add(sill4);
  const sideWindow = new THREE.Group();
  sideWindow.name = 'sideWindow';
  sideWindow.position.set(-3, 1.8, 0);
  sideWindow.rotation.set(0, deg(-90), 0);
  root.add(sideWindow);
  const glass5 = new THREE.Mesh(boxGeo8, glassMat);
  glass5.name = 'glass';
  glass5.position.set(0, 0, 0.005);
  sideWindow.add(glass5);
  const box107 = new THREE.Mesh(boxGeo9, woodMat);
  box107.position.set(0, 0.54, 0.04);
  sideWindow.add(box107);
  const box108 = new THREE.Mesh(boxGeo9, woodMat);
  box108.position.set(0, -0.54, 0.04);
  sideWindow.add(box108);
  const box109 = new THREE.Mesh(boxGeo10, woodMat);
  box109.position.set(-0.44, 0, 0.04);
  sideWindow.add(box109);
  const box110 = new THREE.Mesh(boxGeo10, woodMat);
  box110.position.set(0.44, 0, 0.04);
  sideWindow.add(box110);
  const box111 = new THREE.Mesh(boxGeo11, woodMat);
  box111.position.set(0, 0, 0.025);
  sideWindow.add(box111);
  const box112 = new THREE.Mesh(boxGeo12, woodMat);
  box112.position.set(0, 0, 0.025);
  sideWindow.add(box112);
  const sill5 = new THREE.Mesh(boxGeo13, woodMat);
  sill5.name = 'sill';
  sill5.position.set(0, -0.615, 0.1);
  sideWindow.add(sill5);
  const shutter5 = new THREE.Mesh(boxGeo14, accentMat);
  shutter5.name = 'shutter';
  shutter5.position.set(-0.72, 0, 0.03);
  sideWindow.add(shutter5);
  const box115 = new THREE.Mesh(boxGeo15, woodMat);
  box115.position.set(-0.72, 0.28, 0.055);
  sideWindow.add(box115);
  const box116 = new THREE.Mesh(boxGeo15, woodMat);
  box116.position.set(-0.72, -0.28, 0.055);
  sideWindow.add(box116);
  const shutter6 = new THREE.Mesh(boxGeo14, accentMat);
  shutter6.name = 'shutter';
  shutter6.position.set(0.72, 0, 0.03);
  sideWindow.add(shutter6);
  const box118 = new THREE.Mesh(boxGeo15, woodMat);
  box118.position.set(0.72, 0.28, 0.055);
  sideWindow.add(box118);
  const box119 = new THREE.Mesh(boxGeo15, woodMat);
  box119.position.set(0.72, -0.28, 0.055);
  sideWindow.add(box119);
  const atticWindow = new THREE.Group();
  atticWindow.name = 'atticWindow';
  atticWindow.position.set(-3.02, 3.772, 0);
  atticWindow.rotation.set(0, deg(-90), 0);
  root.add(atticWindow);
  const glass6 = new THREE.Mesh(boxGeo16, glassMat);
  glass6.name = 'glass';
  glass6.position.set(0, 0, 0.005);
  atticWindow.add(glass6);
  const box122 = new THREE.Mesh(boxGeo17, woodMat);
  box122.position.set(0, 0.29, 0.04);
  atticWindow.add(box122);
  const box123 = new THREE.Mesh(boxGeo17, woodMat);
  box123.position.set(0, -0.29, 0.04);
  atticWindow.add(box123);
  const box124 = new THREE.Mesh(boxGeo18, woodMat);
  box124.position.set(-0.265, 0, 0.04);
  atticWindow.add(box124);
  const box125 = new THREE.Mesh(boxGeo18, woodMat);
  box125.position.set(0.265, 0, 0.04);
  atticWindow.add(box125);
  const box126 = new THREE.Mesh(boxGeo19, woodMat);
  box126.position.set(0, 0, 0.025);
  atticWindow.add(box126);
  const box127 = new THREE.Mesh(boxGeo20, woodMat);
  box127.position.set(0, 0, 0.025);
  atticWindow.add(box127);
  const sill6 = new THREE.Mesh(boxGeo21, woodMat);
  sill6.name = 'sill';
  sill6.position.set(0, -0.365, 0.1);
  atticWindow.add(sill6);
  const sideWindow2 = new THREE.Group();
  sideWindow2.name = 'sideWindow';
  sideWindow2.position.set(3, 1.8, 0);
  sideWindow2.rotation.set(0, deg(90), 0);
  root.add(sideWindow2);
  const glass7 = new THREE.Mesh(boxGeo8, glassMat);
  glass7.name = 'glass';
  glass7.position.set(0, 0, 0.005);
  sideWindow2.add(glass7);
  const box131 = new THREE.Mesh(boxGeo9, woodMat);
  box131.position.set(0, 0.54, 0.04);
  sideWindow2.add(box131);
  const box132 = new THREE.Mesh(boxGeo9, woodMat);
  box132.position.set(0, -0.54, 0.04);
  sideWindow2.add(box132);
  const box133 = new THREE.Mesh(boxGeo10, woodMat);
  box133.position.set(-0.44, 0, 0.04);
  sideWindow2.add(box133);
  const box134 = new THREE.Mesh(boxGeo10, woodMat);
  box134.position.set(0.44, 0, 0.04);
  sideWindow2.add(box134);
  const box135 = new THREE.Mesh(boxGeo11, woodMat);
  box135.position.set(0, 0, 0.025);
  sideWindow2.add(box135);
  const box136 = new THREE.Mesh(boxGeo12, woodMat);
  box136.position.set(0, 0, 0.025);
  sideWindow2.add(box136);
  const sill7 = new THREE.Mesh(boxGeo13, woodMat);
  sill7.name = 'sill';
  sill7.position.set(0, -0.615, 0.1);
  sideWindow2.add(sill7);
  const shutter7 = new THREE.Mesh(boxGeo14, accentMat);
  shutter7.name = 'shutter';
  shutter7.position.set(-0.72, 0, 0.03);
  sideWindow2.add(shutter7);
  const box139 = new THREE.Mesh(boxGeo15, woodMat);
  box139.position.set(-0.72, 0.28, 0.055);
  sideWindow2.add(box139);
  const box140 = new THREE.Mesh(boxGeo15, woodMat);
  box140.position.set(-0.72, -0.28, 0.055);
  sideWindow2.add(box140);
  const shutter8 = new THREE.Mesh(boxGeo14, accentMat);
  shutter8.name = 'shutter';
  shutter8.position.set(0.72, 0, 0.03);
  sideWindow2.add(shutter8);
  const box142 = new THREE.Mesh(boxGeo15, woodMat);
  box142.position.set(0.72, 0.28, 0.055);
  sideWindow2.add(box142);
  const box143 = new THREE.Mesh(boxGeo15, woodMat);
  box143.position.set(0.72, -0.28, 0.055);
  sideWindow2.add(box143);
  const atticWindow2 = new THREE.Group();
  atticWindow2.name = 'atticWindow';
  atticWindow2.position.set(3.02, 3.772, 0);
  atticWindow2.rotation.set(0, deg(90), 0);
  root.add(atticWindow2);
  const glass8 = new THREE.Mesh(boxGeo16, glassMat);
  glass8.name = 'glass';
  glass8.position.set(0, 0, 0.005);
  atticWindow2.add(glass8);
  const box146 = new THREE.Mesh(boxGeo17, woodMat);
  box146.position.set(0, 0.29, 0.04);
  atticWindow2.add(box146);
  const box147 = new THREE.Mesh(boxGeo17, woodMat);
  box147.position.set(0, -0.29, 0.04);
  atticWindow2.add(box147);
  const box148 = new THREE.Mesh(boxGeo18, woodMat);
  box148.position.set(-0.265, 0, 0.04);
  atticWindow2.add(box148);
  const box149 = new THREE.Mesh(boxGeo18, woodMat);
  box149.position.set(0.265, 0, 0.04);
  atticWindow2.add(box149);
  const box150 = new THREE.Mesh(boxGeo19, woodMat);
  box150.position.set(0, 0, 0.025);
  atticWindow2.add(box150);
  const box151 = new THREE.Mesh(boxGeo20, woodMat);
  box151.position.set(0, 0, 0.025);
  atticWindow2.add(box151);
  const sill8 = new THREE.Mesh(boxGeo21, woodMat);
  sill8.name = 'sill';
  sill8.position.set(0, -0.365, 0.1);
  atticWindow2.add(sill8);
  const door = new THREE.Group();
  door.name = 'door';
  door.position.set(0, 0.35, 2.2);
  root.add(door);
  const doorPanel = new THREE.Mesh(new THREE.BoxGeometry(1, 2.05, 0.06), accentMat);
  doorPanel.name = 'doorPanel';
  doorPanel.position.set(0, 1.025, 0.02);
  door.add(doorPanel);
  const box155 = new THREE.Mesh(boxGeo22, woodMat);
  box155.position.set(-0.125, 1.025, 0.055);
  door.add(box155);
  const box156 = new THREE.Mesh(boxGeo22, woodMat);
  box156.position.set(0.125, 1.025, 0.055);
  door.add(box156);
  const box157 = new THREE.Mesh(boxGeo22, woodMat);
  box157.position.set(0.375, 1.025, 0.055);
  door.add(box157);
  const box158 = new THREE.Mesh(boxGeo23, woodMat);
  box158.position.set(0, 0.5125, 0.055);
  door.add(box158);
  const box159 = new THREE.Mesh(boxGeo23, woodMat);
  box159.position.set(0, 1.5375, 0.055);
  door.add(box159);
  const box160 = new THREE.Mesh(boxGeo24, woodMat);
  box160.position.set(-0.56, 1.085, 0.05);
  door.add(box160);
  const box161 = new THREE.Mesh(boxGeo24, woodMat);
  box161.position.set(0.56, 1.085, 0.05);
  door.add(box161);
  const lintel = new THREE.Mesh(new THREE.BoxGeometry(1.44, 0.16, 0.16), woodMat);
  lintel.name = 'lintel';
  lintel.position.set(0, 2.17, 0.07);
  door.add(lintel);
  const knob = new THREE.Mesh(new THREE.SphereGeometry(0.045, 6, 4), stoneMat);
  knob.name = 'knob';
  knob.position.set(0.34, 0.9635, 0.09);
  door.add(knob);
  const step = new THREE.Mesh(new THREE.BoxGeometry(1.5, 0.2, 0.6), stoneMat);
  step.name = 'step';
  step.position.set(0, 0.1, 2.57);
  root.add(step);
  const chimney = new THREE.Mesh(new THREE.BoxGeometry(0.62, 2.95, 0.62), stoneMat);
  chimney.name = 'chimney';
  chimney.position.set(2.15, 4.225, -0.88);
  root.add(chimney);
  const chimneyCap = new THREE.Mesh(new THREE.BoxGeometry(0.78, 0.14, 0.78), stoneMat);
  chimneyCap.name = 'chimneyCap';
  chimneyCap.position.set(2.15, 5.77, -0.88);
  root.add(chimneyCap);
  const chimneyPot = new THREE.Mesh(new THREE.CylinderGeometry(0.12, 0.14, 0.22, 7), roofMat);
  chimneyPot.name = 'chimneyPot';
  chimneyPot.position.set(2.15, 5.95, -0.88);
  root.add(chimneyPot);

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

export default createCottage;

Puanlar ve yorumlar

—
Henüz puan yok — ilk puanı sen ver.
5
0
4
0
3
0
2
0
1
0

Puan vermek ve yorum yapmak için giriş yap.

0 yorum

Henüz yorum yok. Bu modeli nasıl kullandığını ya da neyin daha iyi olabileceğini paylaş.

Benzer modeller

Aynı kategori ya da benzer etiketler