Codels
1464 Tris5,36 × 3,46 × 5,42 m

Im Code verwenden

Im Editor remixen
Eigenständiges ES-Modul — hängt nur von three ab. Ruf die Factory auf und füge die Gruppe deiner Szene hinzu.
/**
 * Stone Ruins — Codels 3D model library
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 1,464 · Size (W × H × D): 5.36 × 3.46 × 5.42 m
 *
 * Usage:
 *   import { createRuins } from './ruins.js';
 *   
 *   const model = createRuins();
 *   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 createRuins() {
  const root = new THREE.Group();
  root.name = 'Ruins';

  // Materials
  const stoneMat = new THREE.MeshStandardMaterial({ name: 'stone', color: 0x9a9286, roughness: 0.95, flatShading: true });
  const stone2Mat = new THREE.MeshStandardMaterial({ name: 'stone2', color: 0x847e73, roughness: 0.95, flatShading: true });
  const mortarMat = new THREE.MeshStandardMaterial({ name: 'mortar', color: 0x55504a, roughness: 1, flatShading: true });
  const mossMat = new THREE.MeshStandardMaterial({ name: 'moss', color: 0x55702f, roughness: 1, flatShading: true });
  const moss2Mat = new THREE.MeshStandardMaterial({ name: 'moss2', color: 0x68823c, roughness: 1, flatShading: true });

  // Shared geometries
  const cylinderGeo = new THREE.CylinderGeometry(0.25, 0.26, 0.6, 8, 1, true);
  const cylinderGeo2 = new THREE.CylinderGeometry(0.25, 0.25, 0.58, 8);

  // Parts
  const backWall = new THREE.Group();
  backWall.name = 'backWall';
  backWall.position.set(-2, 0, -2);
  root.add(backWall);
  const wallCore = new THREE.Mesh(extrude([[-0.27, 0], [4.25, 0], [4.25, 0.39], [4.0656, 0.42], [4.0656, 0.81], [3.2872, 0.84], [3.2872, 1.23], [2.7392, 1.26], [2.7392, 1.65], [2.446, 1.68], [2.446, 2.07], [1.9753, 2.1], [1.9753, 2.49], [1.2471, 2.52], [1.2471, 2.91], [0.6581, 2.94], [0.6581, 3.33], [-0.27, 3.33]], 0.5, [[[1.02, 0.86], [1.83, 0.86], [1.83, 2.08], [1.02, 2.08]]]), mortarMat);
  wallCore.name = 'wallCore';
  backWall.add(wallCore);
  const block = new THREE.Mesh(jitter(new THREE.BoxGeometry(1.0291, 0.385, 0.5932), 0.012, 700), stoneMat);
  block.name = 'block';
  block.position.set(0.2353, 0.2065, 0.0286);
  block.rotation.set(0, deg(0.0052), 0);
  backWall.add(block);
  const block2 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.6667, 0.385, 0.6298), 0.012, 701), stoneMat);
  block2.name = 'block';
  block2.position.set(1.1119, 0.2065, 0.012);
  block2.rotation.set(0, deg(-0.4547), 0);
  backWall.add(block2);
  const block3 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.9783, 0.385, 0.5505), 0.012, 702), stoneMat);
  block3.name = 'block';
  block3.position.set(1.9751, 0.2065, 0.0268);
  block3.rotation.set(0, deg(-0.5562), 0);
  backWall.add(block3);
  const block4 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.8978, 0.385, 0.5728), 0.012, 703), stoneMat);
  block4.name = 'block';
  block4.position.set(2.9504, 0.2065, 0.0097);
  block4.rotation.set(0, deg(0.225), 0);
  backWall.add(block4);
  const block5 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.8532, 0.385, 0.5948), 0.012, 704), stoneMat);
  block5.name = 'block';
  block5.position.set(3.8532, 0.2065, 0.0111);
  block5.rotation.set(0, deg(-0.0392), 0);
  backWall.add(block5);
  const block6 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.4775, 0.385, 0.6035), 0.02, 705), stone2Mat);
  block6.name = 'block';
  block6.position.set(-0.0503, 0.63, -0.0153);
  block6.rotation.set(deg(-0.1554), deg(-0.979), deg(0.6549));
  backWall.add(block6);
  const block7 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.7017, 0.385, 0.5998), 0.02, 706), stoneMat);
  block7.name = 'block';
  block7.position.set(0.583, 0.63, 0.029);
  block7.rotation.set(deg(0.5729), deg(0.4244), deg(0.5997));
  backWall.add(block7);
  const block8 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.6872, 0.385, 0.6003), 0.02, 707), stoneMat);
  block8.name = 'block';
  block8.position.set(1.3189, 0.63, -0.016);
  block8.rotation.set(deg(0.4139), deg(0.4263), deg(-0.6448));
  backWall.add(block8);
  const block9 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.8514, 0.385, 0.6358), 0.02, 708), stoneMat);
  block9.name = 'block';
  block9.position.set(2.1061, 0.63, -0.0172);
  block9.rotation.set(deg(0.196), deg(0.0788), deg(0.621));
  backWall.add(block9);
  const block10 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.7655, 0.385, 0.566), 0.035, 709), stoneMat);
  block10.name = 'block';
  block10.position.set(2.9533, 0.63, -0.0269);
  block10.rotation.set(deg(-1.4644), deg(-1.3848), deg(1.0763));
  backWall.add(block10);
  const block11 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.7223, 0.385, 0.6175), 0.035, 710), stoneMat);
  block11.name = 'block';
  block11.position.set(3.74, 0.63, 0.0118);
  block11.rotation.set(deg(0.2254), deg(-0.2702), deg(2.1756));
  backWall.add(block11);
  const block12 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.7478, 0.385, 0.6109), 0.02, 711), stone2Mat);
  block12.name = 'block';
  block12.position.set(0.0925, 1.05, 0.0271);
  block12.rotation.set(deg(0.3367), deg(0.7575), deg(-0.7349));
  backWall.add(block12);
  const block13 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.4822, 0.385, 0.6447), 0.02, 712), stone2Mat);
  block13.name = 'block';
  block13.position.set(0.7455, 1.05, 0.0052);
  block13.rotation.set(deg(0.6671), deg(-0.8923), deg(-0.7941));
  backWall.add(block13);
  const block14 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.9308, 0.385, 0.5563), 0.035, 713), stone2Mat);
  block14.name = 'block';
  block14.position.set(2.3344, 1.05, 0.0181);
  block14.rotation.set(deg(2.2358), deg(-2.0836), deg(2.8663));
  backWall.add(block14);
  const block15 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.4864, 0.385, 0.6127), 0.035, 714), stoneMat);
  block15.name = 'block';
  block15.position.set(3.0718, 1.05, 0.0129);
  block15.rotation.set(deg(-1.1655), deg(-3.698), deg(2.5722));
  backWall.add(block15);
  const block16 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.4904, 0.385, 0.5579), 0.02, 715), stone2Mat);
  block16.name = 'block';
  block16.position.set(-0.0444, 1.47, -0.026);
  block16.rotation.set(deg(-0.4979), deg(-0.612), deg(0.1444));
  backWall.add(block16);
  const block17 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.7396, 0.385, 0.6046), 0.02, 716), stoneMat);
  block17.name = 'block';
  block17.position.set(0.6178, 1.47, -0.0002);
  block17.rotation.set(deg(-0.0752), deg(0.9676), deg(0.2332));
  backWall.add(block17);
  const block18 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.9042, 0.385, 0.6211), 0.035, 717), stoneMat);
  block18.name = 'block';
  block18.position.set(2.3234, 1.47, -0.0211);
  block18.rotation.set(deg(2.2538), deg(-3.0669), deg(1.9609));
  backWall.add(block18);
  const block19 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.7538, 0.385, 0.6078), 0.02, 718), stoneMat);
  block19.name = 'block';
  block19.position.set(0.0971, 1.89, -0.0153);
  block19.rotation.set(deg(0.7347), deg(-0.6719), deg(0.0064));
  backWall.add(block19);
  const block20 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.4762, 0.385, 0.5864), 0.02, 719), stone2Mat);
  block20.name = 'block';
  block20.position.set(0.7409, 1.89, -0.0164);
  block20.rotation.set(deg(0.054), deg(0.5905), deg(0.4515));
  backWall.add(block20);
  const block21 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.611, 0.385, 0.6463), 0.035, 720), stoneMat);
  block21.name = 'block';
  block21.position.set(2.1713, 1.89, 0.0138);
  block21.rotation.set(deg(1.8337), deg(-3.047), deg(2.7213));
  backWall.add(block21);
  const block22 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.4483, 0.385, 0.6019), 0.02, 721), stoneMat);
  block22.name = 'block';
  block22.position.set(-0.0533, 2.31, 0.0083);
  block22.rotation.set(deg(0.1681), deg(0.3621), deg(0.1407));
  backWall.add(block22);
  const block23 = new THREE.Mesh(jitter(new THREE.BoxGeometry(1.047, 0.385, 0.5737), 0.02, 722), stoneMat);
  block23.name = 'block';
  block23.position.set(0.7273, 2.31, -0.0002);
  block23.rotation.set(deg(0.7688), deg(0.7861), deg(-0.392));
  backWall.add(block23);
  const block24 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.725, 0.385, 0.6424), 0.035, 723), stone2Mat);
  block24.name = 'block';
  block24.position.set(1.6501, 2.31, 0.018);
  block24.rotation.set(deg(-1.7483), deg(2.1923), deg(2.1432));
  backWall.add(block24);
  const block25 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.6822, 0.385, 0.6326), 0.02, 724), stoneMat);
  block25.name = 'block';
  block25.position.set(0.0635, 2.73, -0.0203);
  block25.rotation.set(deg(-0.172), deg(0.7219), deg(-0.0996));
  backWall.add(block25);
  const block26 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.8448, 0.385, 0.5694), 0.035, 725), stone2Mat);
  block26.name = 'block';
  block26.position.set(0.8514, 2.73, -0.023);
  block26.rotation.set(deg(2.2087), deg(1.8476), deg(-2.9377));
  backWall.add(block26);
  const block27 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.633, 0.385, 0.5665), 0.035, 726), stoneMat);
  block27.name = 'block';
  block27.position.set(0.0355, 3.15, -0.0177);
  block27.rotation.set(deg(0.495), deg(2.453), deg(-0.4978));
  backWall.add(block27);
  const block28 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.3051, 0.385, 0.5685), 0.035, 727), stoneMat);
  block28.name = 'block';
  block28.position.set(0.5352, 3.13, 0.0112);
  block28.rotation.set(deg(1.2747), deg(1.4128), deg(-0.1801));
  backWall.add(block28);
  const sideWall = new THREE.Group();
  sideWall.name = 'sideWall';
  sideWall.position.set(-2, 0, -2);
  sideWall.rotation.set(0, deg(-90), 0);
  root.add(sideWall);
  const wallCore2 = new THREE.Mesh(extrude([[0.33, 0], [4.25, 0], [4.25, 0.39], [3.9889, 0.42], [3.9889, 0.81], [3.5144, 0.84], [3.5144, 1.23], [3.0841, 1.26], [3.0841, 1.65], [2.6601, 1.68], [2.6601, 2.07], [1.7608, 2.1], [1.7608, 2.49], [1.0902, 2.52], [1.0902, 2.91], [0.33, 2.91]], 0.5), mortarMat);
  wallCore2.name = 'wallCore';
  sideWall.add(wallCore2);
  const block29 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.8623, 0.385, 0.6255), 0.012, 728), stoneMat);
  block29.name = 'block';
  block29.position.set(0.7415, 0.2065, -0.0077);
  block29.rotation.set(0, deg(0.4856), 0);
  sideWall.add(block29);
  const block30 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.7328, 0.385, 0.5729), 0.012, 729), stoneMat);
  block30.name = 'block';
  block30.position.set(1.5818, 0.2065, -0.0264);
  block30.rotation.set(0, deg(-0.3317), 0);
  sideWall.add(block30);
  const block31 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.7853, 0.385, 0.6262), 0.012, 730), stone2Mat);
  block31.name = 'block';
  block31.position.set(2.3784, 0.2065, -0.0088);
  block31.rotation.set(0, deg(0.4352), 0);
  sideWall.add(block31);
  const block32 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.8376, 0.385, 0.6076), 0.012, 731), stoneMat);
  block32.name = 'block';
  block32.position.set(3.2302, 0.2065, 0.0277);
  block32.rotation.set(0, deg(0.1611), 0);
  sideWall.add(block32);
  const block33 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.607, 0.385, 0.5755), 0.012, 732), stoneMat);
  block33.name = 'block';
  block33.position.set(3.9791, 0.2065, 0.021);
  block33.rotation.set(0, deg(0.2117), 0);
  sideWall.add(block33);
  const block34 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.4928, 0.385, 0.6031), 0.02, 733), stone2Mat);
  block34.name = 'block';
  block34.position.set(0.5668, 0.63, 0.019);
  block34.rotation.set(deg(0.0339), deg(-0.3061), deg(-0.7586));
  sideWall.add(block34);
  const block35 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.6416, 0.385, 0.5862), 0.02, 734), stoneMat);
  block35.name = 'block';
  block35.position.set(1.1657, 0.63, 0.0176);
  block35.rotation.set(deg(-0.5142), deg(-0.7192), deg(-0.5086));
  sideWall.add(block35);
  const block36 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.9794, 0.385, 0.5697), 0.02, 735), stone2Mat);
  block36.name = 'block';
  block36.position.set(2.0198, 0.63, -0.0238);
  block36.rotation.set(deg(-0.6845), deg(-0.7728), deg(-0.7712));
  sideWall.add(block36);
  const block37 = new THREE.Mesh(jitter(new THREE.BoxGeometry(1.0807, 0.385, 0.5844), 0.035, 736), stoneMat);
  block37.name = 'block';
  block37.position.set(3.0706, 0.63, 0.0295);
  block37.rotation.set(deg(-1.8481), deg(2.1666), deg(-0.243));
  sideWall.add(block37);
  const block38 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.3694, 0.385, 0.5753), 0.035, 737), stoneMat);
  block38.name = 'block';
  block38.position.set(3.8316, 0.63, 0.0165);
  block38.rotation.set(deg(0.8639), deg(0.8274), deg(-2.1319));
  sideWall.add(block38);
  const block39 = new THREE.Mesh(jitter(new THREE.BoxGeometry(1.0572, 0.385, 0.5905), 0.02, 738), stone2Mat);
  block39.name = 'block';
  block39.position.set(0.8556, 1.05, 0.0002);
  block39.rotation.set(deg(0.3098), deg(0.7385), deg(-0.2723));
  sideWall.add(block39);
  const block40 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.8285, 0.385, 0.6477), 0.02, 739), stoneMat);
  block40.name = 'block';
  block40.position.set(1.8264, 1.05, 0.0042);
  block40.rotation.set(deg(0.6763), deg(0.1462), deg(0.682));
  sideWall.add(block40);
  const block41 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.6326, 0.385, 0.6145), 0.02, 740), stoneMat);
  block41.name = 'block';
  block41.position.set(2.5862, 1.05, -0.0096);
  block41.rotation.set(deg(0.7409), deg(-0.1067), deg(-0.455));
  sideWall.add(block41);
  const block42 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.6061, 0.385, 0.5675), 0.035, 741), stone2Mat);
  block42.name = 'block';
  block42.position.set(3.2369, 1.05, -0.0013);
  block42.rotation.set(deg(-0.2856), deg(-1.4052), deg(0.1203));
  sideWall.add(block42);
  const block43 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.469, 0.385, 0.6399), 0.02, 742), stoneMat);
  block43.name = 'block';
  block43.position.set(0.5449, 1.47, 0.0083);
  block43.rotation.set(deg(0.6623), deg(-0.3336), deg(-0.1129));
  sideWall.add(block43);
  const block44 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.8669, 0.385, 0.5848), 0.02, 743), stone2Mat);
  block44.name = 'block';
  block44.position.set(1.2544, 1.47, 0.0262);
  block44.rotation.set(deg(-0.4842), deg(-0.8858), deg(0.1988));
  sideWall.add(block44);
  const block45 = new THREE.Mesh(jitter(new THREE.BoxGeometry(1.0077, 0.385, 0.6057), 0.035, 744), stoneMat);
  block45.name = 'block';
  block45.position.set(2.22, 1.47, -0.011);
  block45.rotation.set(deg(-1.0761), deg(-1.6433), deg(0.3671));
  sideWall.add(block45);
  const block46 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.3505, 0.385, 0.6483), 0.035, 745), stone2Mat);
  block46.name = 'block';
  block46.position.set(2.9366, 1.47, 0);
  block46.rotation.set(deg(-1.503), deg(-1.7229), deg(-2.6148));
  sideWall.add(block46);
  const block47 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.7961, 0.385, 0.637), 0.02, 746), stoneMat);
  block47.name = 'block';
  block47.position.set(0.7223, 1.89, -0.01);
  block47.rotation.set(deg(-0.7135), deg(-0.7645), deg(0.0549));
  sideWall.add(block47);
  const block48 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.6991, 0.385, 0.6176), 0.035, 747), stone2Mat);
  block48.name = 'block';
  block48.position.set(1.4935, 1.89, -0.0069);
  block48.rotation.set(deg(-0.78), deg(1.3504), deg(0.6807));
  sideWall.add(block48);
  const block49 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.8098, 0.385, 0.5641), 0.035, 748), stone2Mat);
  block49.name = 'block';
  block49.position.set(2.2824, 1.89, -0.0289);
  block49.rotation.set(deg(-1.1664), deg(0.8245), deg(-0.579));
  sideWall.add(block49);
  const block50 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.7047, 0.385, 0.6224), 0.02, 749), stoneMat);
  block50.name = 'block';
  block50.position.set(0.6681, 2.31, -0.0034);
  block50.rotation.set(deg(-0.6292), deg(-0.4523), deg(0.263));
  sideWall.add(block50);
  const block51 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.7361, 0.385, 0.6356), 0.035, 750), stone2Mat);
  block51.name = 'block';
  block51.position.set(1.4281, 2.31, -0.0018);
  block51.rotation.set(deg(-1.4585), deg(-1.8231), deg(0.0119));
  sideWall.add(block51);
  const block52 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.8052, 0.385, 0.5973), 0.035, 751), stoneMat);
  block52.name = 'block';
  block52.position.set(0.7178, 2.71, -0.0148);
  block52.rotation.set(deg(0.8202), deg(-3.3667), deg(0.7432));
  sideWall.add(block52);
  const flagstone = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.639, 0.06, 0.6727), 0.012, 752), stone2Mat);
  flagstone.name = 'flagstone';
  flagstone.position.set(-0.4353, 0.03, 1.0033);
  flagstone.rotation.set(0, deg(78.2124), 0);
  root.add(flagstone);
  const flagstone2 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.6713, 0.06, 0.6705), 0.012, 753), stoneMat);
  flagstone2.name = 'flagstone';
  flagstone2.position.set(0.6469, 0.03, -0.6731);
  flagstone2.rotation.set(0, deg(24.0286), 0);
  root.add(flagstone2);
  const flagstone3 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.7802, 0.06, 0.5068), 0.012, 754), stoneMat);
  flagstone3.name = 'flagstone';
  flagstone3.position.set(1.109, 0.03, 1.0945);
  flagstone3.rotation.set(0, deg(9.1272), 0);
  root.add(flagstone3);
  const flagstone4 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.8537, 0.06, 0.6688), 0.012, 755), stoneMat);
  flagstone4.name = 'flagstone';
  flagstone4.position.set(0.7874, 0.03, 0.0185);
  flagstone4.rotation.set(0, deg(50.645), 0);
  root.add(flagstone4);
  const flagstone5 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.6139, 0.06, 0.6311), 0.012, 756), stoneMat);
  flagstone5.name = 'flagstone';
  flagstone5.position.set(-0.6744, 0.03, 0.2105);
  flagstone5.rotation.set(0, deg(3.2514), 0);
  root.add(flagstone5);
  const flagstone6 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.6776, 0.06, 0.5463), 0.012, 757), stoneMat);
  flagstone6.name = 'flagstone';
  flagstone6.position.set(-0.0264, 0.03, -0.9014);
  flagstone6.rotation.set(0, deg(6.7788), 0);
  root.add(flagstone6);
  const columnPlinth = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.72, 0.2, 0.72), 0.015, 758), stone2Mat);
  columnPlinth.name = 'columnPlinth';
  columnPlinth.position.set(1.55, 0.1, -0.9563);
  columnPlinth.rotation.set(0, deg(5.0054), 0);
  root.add(columnPlinth);
  const columnDrum = new THREE.Mesh(cylinderGeo, stoneMat);
  columnDrum.name = 'columnDrum';
  columnDrum.position.set(1.5471, 0.5, -0.9488);
  columnDrum.rotation.set(0, deg(0.2576), 0);
  root.add(columnDrum);
  const columnDrum2 = new THREE.Mesh(cylinderGeo, stone2Mat);
  columnDrum2.name = 'columnDrum';
  columnDrum2.position.set(1.5447, 1.1, -0.9371);
  columnDrum2.rotation.set(0, deg(9.883), 0);
  root.add(columnDrum2);
  const columnDrum3 = new THREE.Mesh(cylinderGeo, stoneMat);
  columnDrum3.name = 'columnDrum';
  columnDrum3.position.set(1.5447, 1.7, -0.9546);
  columnDrum3.rotation.set(0, deg(-5.4193), 0);
  root.add(columnDrum3);
  const brokenDrum = new THREE.Mesh(jitter(extrude([[0, 0], [0.0719, 0.2342], [-0.0795, 0.2317], [-0.2006, 0.1407], [-0.245, -0.004], [-0.1958, -0.1472], [-0.0719, -0.2342], [0.0795, -0.2317]], 0.3122), 0.015, 759), stoneMat);
  brokenDrum.name = 'brokenDrum';
  brokenDrum.position.set(1.55, 2.1461, -0.9563);
  brokenDrum.rotation.set(deg(-90), 0, 0);
  root.add(brokenDrum);
  const columnPlinth2 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.72, 0.2, 0.72), 0.015, 760), stone2Mat);
  columnPlinth2.name = 'columnPlinth';
  columnPlinth2.position.set(1.55, 0.1, 0.3037);
  columnPlinth2.rotation.set(0, deg(-3.9138), 0);
  root.add(columnPlinth2);
  const columnDrum4 = new THREE.Mesh(cylinderGeo, stoneMat);
  columnDrum4.name = 'columnDrum';
  columnDrum4.position.set(1.5358, 0.5, 0.2919);
  columnDrum4.rotation.set(0, deg(6.2207), 0);
  root.add(columnDrum4);
  const columnDrum5 = new THREE.Mesh(cylinderGeo, stone2Mat);
  columnDrum5.name = 'columnDrum';
  columnDrum5.position.set(1.5385, 1.1, 0.3076);
  columnDrum5.rotation.set(0, deg(1.2682), 0);
  root.add(columnDrum5);
  const brokenDrum2 = new THREE.Mesh(jitter(extrude([[0, 0], [-0.2371, 0.0616], [-0.2281, -0.0895], [-0.1319, -0.2065], [0.0146, -0.2446], [0.1556, -0.1892], [0.2371, -0.0616], [0.2281, 0.0895]], 0.3484), 0.015, 761), stoneMat);
  brokenDrum2.name = 'brokenDrum';
  brokenDrum2.position.set(1.55, 1.5642, 0.3037);
  brokenDrum2.rotation.set(deg(-90), 0, 0);
  root.add(brokenDrum2);
  const columnPlinth3 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.72, 0.2, 0.72), 0.015, 762), stone2Mat);
  columnPlinth3.name = 'columnPlinth';
  columnPlinth3.position.set(-0.7111, 0.1, 1.65);
  columnPlinth3.rotation.set(0, deg(-2.6814), 0);
  root.add(columnPlinth3);
  const columnDrum6 = new THREE.Mesh(cylinderGeo, stoneMat);
  columnDrum6.name = 'columnDrum';
  columnDrum6.position.set(-0.705, 0.5, 1.636);
  columnDrum6.rotation.set(0, deg(-6.0993), 0);
  root.add(columnDrum6);
  const columnDrum7 = new THREE.Mesh(cylinderGeo, stone2Mat);
  columnDrum7.name = 'columnDrum';
  columnDrum7.position.set(-0.7228, 1.1, 1.6499);
  columnDrum7.rotation.set(0, deg(-5.055), 0);
  root.add(columnDrum7);
  const columnDrum8 = new THREE.Mesh(cylinderGeo, stoneMat);
  columnDrum8.name = 'columnDrum';
  columnDrum8.position.set(-0.7009, 1.7, 1.64);
  columnDrum8.rotation.set(0, deg(3.0167), 0);
  root.add(columnDrum8);
  const brokenDrum3 = new THREE.Mesh(jitter(extrude([[0, 0], [-0.2341, 0.0722], [-0.2318, -0.0792], [-0.141, -0.2003], [0.0037, -0.245], [0.147, -0.196], [0.2341, -0.0722], [0.2318, 0.0792]], 0.2987), 0.015, 763), stoneMat);
  brokenDrum3.name = 'brokenDrum';
  brokenDrum3.position.set(-0.7111, 2.1393, 1.65);
  brokenDrum3.rotation.set(deg(-90), 0, 0);
  root.add(brokenDrum3);
  const fallenColumn = new THREE.Group();
  fallenColumn.name = 'fallenColumn';
  fallenColumn.position.set(0.7529, 0.2543, 1.85);
  fallenColumn.rotation.set(0, deg(11.2969), 0);
  root.add(fallenColumn);
  const columnDrum9 = new THREE.Mesh(cylinderGeo2, stoneMat);
  columnDrum9.name = 'columnDrum';
  columnDrum9.position.set(-0.31, 0, 0);
  columnDrum9.rotation.set(0, 0, deg(90));
  fallenColumn.add(columnDrum9);
  const columnDrum10 = new THREE.Mesh(cylinderGeo2, stone2Mat);
  columnDrum10.name = 'columnDrum';
  columnDrum10.position.set(0.3, 0.02, 0);
  columnDrum10.rotation.set(0, 0, deg(95));
  fallenColumn.add(columnDrum10);
  const rubble = new THREE.Mesh(jitter(new THREE.TetrahedronGeometry(0.1297, 0), 0.015, 764), stoneMat);
  rubble.name = 'rubble';
  rubble.position.set(2.7244, 0.0841, -1.8892);
  rubble.rotation.set(deg(8.9201), deg(19.492), deg(-16.2947));
  root.add(rubble);
  const rubble2 = new THREE.Mesh(jitter(new THREE.OctahedronGeometry(0.1385, 0), 0.0208, 765), stone2Mat);
  rubble2.name = 'rubble';
  rubble2.position.set(2.5188, 0.1349, -2.2951);
  rubble2.rotation.set(deg(-7.155), deg(44.8564), deg(-14.8191));
  root.add(rubble2);
  const rubble3 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.2973, 0.1784, 0.223), 0.0223, 766), stone2Mat);
  rubble3.name = 'rubble';
  rubble3.position.set(2.4736, 0.1361, -1.8226);
  rubble3.rotation.set(deg(-8.9871), deg(7.7013), deg(22.2746));
  root.add(rubble3);
  const rubble4 = new THREE.Mesh(jitter(new THREE.TetrahedronGeometry(0.2258, 0), 0.0261, 767), stoneMat);
  rubble4.name = 'rubble';
  rubble4.position.set(2.8656, 0.1774, -1.7863);
  rubble4.rotation.set(deg(-21.9998), deg(82.7826), deg(-12.8018));
  root.add(rubble4);
  const rubble5 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.2093, 0.1256, 0.157), 0.0157, 768), stoneMat);
  rubble5.name = 'rubble';
  rubble5.position.set(-1.5174, 0.1216, 2.6782);
  rubble5.rotation.set(deg(16.4384), deg(77.7782), deg(16.891));
  root.add(rubble5);
  const rubble6 = new THREE.Mesh(jitter(new THREE.OctahedronGeometry(0.2022, 0), 0.0303, 769), stoneMat);
  rubble6.name = 'rubble';
  rubble6.position.set(-1.3093, 0.2018, 2.5635);
  rubble6.rotation.set(deg(4.647), deg(6.0516), deg(14.1682));
  root.add(rubble6);
  const rubble7 = new THREE.Mesh(jitter(new THREE.OctahedronGeometry(0.1231, 0), 0.0185, 770), stone2Mat);
  rubble7.name = 'rubble';
  rubble7.position.set(-1.9614, 0.1207, 2.5752);
  rubble7.rotation.set(deg(-13.6954), deg(54.7872), deg(13.857));
  root.add(rubble7);
  const rubble8 = new THREE.Mesh(jitter(new THREE.OctahedronGeometry(0.1991, 0), 0.0299, 771), stone2Mat);
  rubble8.name = 'rubble';
  rubble8.position.set(-2.1435, 0.144, 2.8405);
  rubble8.rotation.set(deg(23.0428), deg(29.2159), deg(23.441));
  root.add(rubble8);
  const rubble9 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.2256, 0.1353, 0.1692), 0.0169, 772), stone2Mat);
  rubble9.name = 'rubble';
  rubble9.position.set(1.5276, 0.1095, 0.6811);
  rubble9.rotation.set(deg(-19.9874), deg(73.0392), deg(8.0462));
  root.add(rubble9);
  const rubble10 = new THREE.Mesh(jitter(new THREE.OctahedronGeometry(0.1369, 0), 0.0205, 773), stone2Mat);
  rubble10.name = 'rubble';
  rubble10.position.set(-1.0907, 0.1332, -0.7429);
  rubble10.rotation.set(deg(22.2342), deg(44.318), deg(-0.3585));
  root.add(rubble10);
  const rubble11 = new THREE.Mesh(jitter(new THREE.TetrahedronGeometry(0.1392, 0), 0.0161, 774), stoneMat);
  rubble11.name = 'rubble';
  rubble11.position.set(1.5308, 0.0766, -0.911);
  rubble11.rotation.set(deg(18.0032), deg(77.5051), deg(-17.0776));
  root.add(rubble11);
  const rubble12 = new THREE.Mesh(jitter(new THREE.BoxGeometry(0.2277, 0.1366, 0.1708), 0.0171, 775), stoneMat);
  rubble12.name = 'rubble';
  rubble12.position.set(1.1308, 0.0921, 1.8014);
  rubble12.rotation.set(deg(9.2719), deg(60.8261), deg(-4.5406));
  root.add(rubble12);
  const rubble13 = new THREE.Mesh(jitter(new THREE.OctahedronGeometry(0.1214, 0), 0.0182, 776), stoneMat);
  rubble13.name = 'rubble';
  rubble13.position.set(1.8098, 0.0968, -0.126);
  rubble13.rotation.set(deg(1.5861), deg(81.0361), deg(18.6279));
  root.add(rubble13);
  const moss = new THREE.Mesh(jitter(new THREE.IcosahedronGeometry(0.171, 0), 0.0205, 777), mossMat);
  moss.name = 'moss';
  moss.position.set(1.737, 0.8605, -1.9012);
  moss.scale.set(1.4, 0.38, 1.2);
  root.add(moss);
  const moss2 = new THREE.Mesh(jitter(new THREE.IcosahedronGeometry(0.169, 0), 0.0203, 778), mossMat);
  moss2.name = 'moss';
  moss2.position.set(0.173, 2.1203, -2.0942);
  moss2.scale.set(1.4, 0.38, 1.2);
  root.add(moss2);
  const moss3 = new THREE.Mesh(jitter(new THREE.IcosahedronGeometry(0.1832, 0), 0.022, 779), mossMat);
  moss3.name = 'moss';
  moss3.position.set(-1.966, 3.382, -2.0152);
  moss3.scale.set(1.4, 0.38, 1.2);
  root.add(moss3);
  const moss4 = new THREE.Mesh(jitter(new THREE.IcosahedronGeometry(0.2322, 0), 0.0279, 780), mossMat);
  moss4.name = 'moss';
  moss4.position.set(-1.8695, 0.8679, 1.8367);
  moss4.scale.set(1.4, 0.38, 1.2);
  root.add(moss4);
  const moss5 = new THREE.Mesh(jitter(new THREE.IcosahedronGeometry(0.1563, 0), 0.0188, 781), mossMat);
  moss5.name = 'moss';
  moss5.position.set(-1.9244, 1.6988, 0.9414);
  moss5.scale.set(1.4, 0.38, 1.2);
  root.add(moss5);
  const moss6 = new THREE.Mesh(jitter(new THREE.IcosahedronGeometry(0.1601, 0), 0.0192, 782), mossMat);
  moss6.name = 'moss';
  moss6.position.set(-2.0837, 2.5392, -0.5747);
  moss6.scale.set(1.4, 0.38, 1.2);
  root.add(moss6);
  const moss7 = new THREE.Mesh(jitter(new THREE.IcosahedronGeometry(0.2093, 0), 0.0251, 783), moss2Mat);
  moss7.name = 'moss';
  moss7.position.set(0.5635, 0.1396, -1.5744);
  moss7.scale.set(1.3, 0.7, 1.1);
  root.add(moss7);
  const moss8 = new THREE.Mesh(jitter(new THREE.IcosahedronGeometry(0.2572, 0), 0.0309, 784), mossMat);
  moss8.name = 'moss';
  moss8.position.set(-1.5457, 0.1699, 0.6496);
  moss8.scale.set(1.3, 0.7, 1.1);
  root.add(moss8);
  const moss9 = new THREE.Mesh(jitter(new THREE.IcosahedronGeometry(0.1728, 0), 0.0207, 785), mossMat);
  moss9.name = 'moss';
  moss9.position.set(1.4283, 0.1111, -1.5963);
  moss9.scale.set(1.3, 0.7, 1.1);
  root.add(moss9);
  const moss10 = new THREE.Mesh(jitter(new THREE.IcosahedronGeometry(0.2237, 0), 0.0268, 786), moss2Mat);
  moss10.name = 'moss';
  moss10.position.set(-1.5658, 0.1366, 1.2535);
  moss10.scale.set(1.3, 0.7, 1.1);
  root.add(moss10);

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

export default createRuins;

Bewertungen & Kommentare

—
Noch keine Bewertungen — gib die erste ab.
5
0
4
0
3
0
2
0
1
0

Melde dich an, um zu bewerten und zu kommentieren.

0 Kommentare

Noch keine Kommentare. Erzähl, wie du dieses Modell genutzt hast oder was besser sein könnte.

Ähnliche Modelle

Gleiche Kategorie oder ähnliche Tags