Codels
1.4K tris3.13 × 5.43 × 2.82 m

Use it in code

Remix in the editor
Self-contained ES module — only depends on three. Call the factory and add the group to your scene.
/**
 * Dead Tree — Codels 3D model library
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 1,372 · Size (W × H × D): 3.13 × 5.43 × 2.82 m
 *
 * Usage:
 *   import { createDeadTree } from './dead-tree.js';
 *   
 *   const model = createDeadTree();
 *   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;
}

export function createDeadTree() {
  const root = new THREE.Group();
  root.name = 'DeadTree';

  // Materials
  const barkMat = new THREE.MeshStandardMaterial({ name: 'bark', color: 0x4b4039, roughness: 0.95, flatShading: true });
  const barkDarkMat = new THREE.MeshStandardMaterial({ name: 'barkDark', color: 0x3e342f, roughness: 0.95, flatShading: true });
  const holeMat = new THREE.MeshStandardMaterial({ name: 'hole', color: 0x1b1714, roughness: 1, flatShading: true });

  // Parts
  const trunk1 = new THREE.Mesh(new THREE.CylinderGeometry(0.2648, 0.2975, 0.6708, 6, 1, true), barkMat);
  trunk1.name = 'trunk1';
  trunk1.position.set(0.0141, 0.4389, 0.0115);
  trunk1.rotation.set(deg(2.5309), deg(-0.0683), deg(-3.0927));
  root.add(trunk1);
  const trunk2 = new THREE.Mesh(new THREE.CylinderGeometry(0.2321, 0.2648, 0.6544, 6, 1, true), barkMat);
  trunk2.name = 'trunk2';
  trunk2.position.set(0.0242, 0.9542, 0.0786);
  trunk2.rotation.set(deg(12.2897), deg(0.0944), deg(0.8767));
  root.add(trunk2);
  const trunk3 = new THREE.Mesh(new THREE.CylinderGeometry(0.1993, 0.2321, 0.638, 6, 1, true), barkMat);
  trunk3.name = 'trunk3';
  trunk3.position.set(-0.0259, 1.4576, 0.1996);
  trunk3.rotation.set(deg(14.53), deg(1.2986), deg(10.1599));
  root.add(trunk3);
  const trunk4 = new THREE.Mesh(new THREE.CylinderGeometry(0.1666, 0.1993, 0.6217, 6, 1, true), barkMat);
  trunk4.name = 'trunk4';
  trunk4.position.set(-0.1612, 1.948, 0.305);
  trunk4.rotation.set(deg(8.804), deg(1.5573), deg(20.0248));
  root.add(trunk4);
  const trunk5 = new THREE.Mesh(new THREE.CylinderGeometry(0.1339, 0.1666, 0.6053, 6), barkMat);
  trunk5.name = 'trunk5';
  trunk5.position.set(-0.2877, 2.4442, 0.3907);
  trunk5.rotation.set(deg(10.0992), deg(0.7233), deg(8.1721));
  root.add(trunk5);
  const crotch = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.1606, 0), 0.0201, 3), barkMat);
  crotch.name = 'crotch';
  crotch.position.set(-0.3248, 2.6985, 0.4365);
  root.add(crotch);
  const rootFlare = new THREE.Mesh(new THREE.CylinderGeometry(0.2826, 0.4463, 0.36, 6), barkDarkMat);
  rootFlare.name = 'rootFlare';
  rootFlare.position.set(0, 0.18, 0);
  root.add(rootFlare);
  const root1 = new THREE.Mesh(new THREE.CylinderGeometry(0.0417, 0.1488, 0.7131, 5), barkDarkMat);
  root1.name = 'root1';
  root1.position.set(0.4507, 0.1398, 0.1002);
  root1.rotation.set(deg(12.5199), deg(-15.6811), deg(-102.919));
  root.add(root1);
  const root2 = new THREE.Mesh(new THREE.CylinderGeometry(0.0417, 0.1488, 0.6108, 5), barkDarkMat);
  root2.name = 'root2';
  root2.position.set(0.096, 0.1398, 0.3968);
  root2.rotation.set(deg(105.1), deg(-17.5842), deg(-13.5122));
  root.add(root2);
  const root3 = new THREE.Mesh(new THREE.CylinderGeometry(0.0417, 0.1488, 0.7267, 5), barkDarkMat);
  root3.name = 'root3';
  root3.position.set(-0.2731, 0.1398, 0.3811);
  root3.rotation.set(deg(78.3843), deg(36.9728), deg(44.5917));
  root.add(root3);
  const root4 = new THREE.Mesh(new THREE.CylinderGeometry(0.0417, 0.1488, 0.7147, 5), barkDarkMat);
  root4.name = 'root4';
  root4.position.set(-0.4227, 0.1398, -0.188);
  root4.rotation.set(deg(-26.3365), deg(-28.253), deg(94.1772));
  root.add(root4);
  const root5 = new THREE.Mesh(new THREE.CylinderGeometry(0.0417, 0.1488, 0.6437, 5), barkDarkMat);
  root5.name = 'root5';
  root5.position.set(0.0838, 0.1398, -0.4172);
  root5.rotation.set(deg(-105.2417), deg(14.5963), deg(-11.1764));
  root.add(root5);
  const knotHole = new THREE.Mesh(new THREE.SphereGeometry(0.1456, 6, 5), holeMat);
  knotHole.name = 'knotHole';
  knotHole.position.set(0.0282, 0.8036, 0.2349);
  knotHole.scale.set(0.7, 1.2, 0.4);
  root.add(knotHole);
  const branch1 = new THREE.Group();
  branch1.name = 'branch1';
  root.add(branch1);
  const limb1 = new THREE.Mesh(new THREE.CylinderGeometry(0.1039, 0.1272, 0.5776, 5, 1, true), barkMat);
  limb1.name = 'limb1';
  limb1.position.set(-0.2413, 2.9332, 0.4083);
  limb1.rotation.set(deg(-6.4468), deg(1.1068), deg(-19.4639));
  branch1.add(limb1);
  const limb2 = new THREE.Mesh(new THREE.CylinderGeometry(0.0805, 0.1039, 0.5636, 5, 1, true), barkMat);
  limb2.name = 'limb2';
  limb2.position.set(-0.0433, 3.39, 0.3993);
  limb2.rotation.set(deg(4.3764), deg(-1.0583), deg(-27.1772));
  branch1.add(limb2);
  const limb3 = new THREE.Mesh(new THREE.CylinderGeometry(0.0572, 0.0805, 0.5496, 5), barkMat);
  limb3.name = 'limb3';
  limb3.position.set(0.1578, 3.8377, 0.485);
  limb3.rotation.set(deg(15.4184), deg(-2.7669), deg(-20.231));
  branch1.add(limb3);
  const knot3 = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.0715, 0), 0.0086, 3), barkDarkMat);
  knot3.name = 'knot3';
  knot3.position.set(0.2443, 4.0634, 0.5516);
  branch1.add(knot3);
  const limb4 = new THREE.Mesh(new THREE.CylinderGeometry(0.0415, 0.0572, 0.491, 5, 1, true), barkDarkMat);
  limb4.name = 'limb4';
  limb4.position.set(0.2918, 4.2703, 0.6356);
  limb4.rotation.set(deg(21.6168), deg(-2.3005), deg(-12.0076));
  branch1.add(limb4);
  const limb5 = new THREE.Mesh(new THREE.CylinderGeometry(0.0258, 0.0415, 0.4815, 5), barkDarkMat);
  limb5.name = 'limb5';
  limb5.position.set(0.4187, 4.663, 0.8258);
  limb5.rotation.set(deg(27.8361), deg(-5.1167), deg(-20.4418));
  branch1.add(limb5);
  const knot5 = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.0322, 0), 0.0039, 5), barkDarkMat);
  knot5.name = 'knot5';
  knot5.position.set(0.4981, 4.8489, 0.932);
  branch1.add(knot5);
  const limb6 = new THREE.Mesh(new THREE.CylinderGeometry(0.0159, 0.0258, 0.2529, 5, 1, true), barkDarkMat);
  limb6.name = 'limb6';
  limb6.position.set(0.4782, 4.9474, 0.9952);
  limb6.rotation.set(deg(32.1954), deg(2.7874), deg(9.6377));
  branch1.add(limb6);
  const limb7 = new THREE.Mesh(new THREE.CylinderGeometry(0.006, 0.0159, 0.2469, 5, 1, true), barkDarkMat);
  limb7.name = 'limb7';
  limb7.position.set(0.4171, 5.1434, 1.1121);
  limb7.rotation.set(deg(27.0179), deg(4.9545), deg(20.417));
  branch1.add(limb7);
  const limb8 = new THREE.Mesh(new THREE.CylinderGeometry(0.0415, 0.0572, 0.4742, 5, 1, true), barkDarkMat);
  limb8.name = 'limb8';
  limb8.position.set(0.3206, 4.2681, 0.5262);
  limb8.rotation.set(deg(-6.6335), deg(1.188), deg(-20.2861));
  branch1.add(limb8);
  const limb9 = new THREE.Mesh(new THREE.CylinderGeometry(0.0258, 0.0415, 0.4648, 5), barkDarkMat);
  limb9.name = 'limb9';
  limb9.position.set(0.5067, 4.659, 0.4605);
  limb9.rotation.set(deg(-10.5642), deg(2.8406), deg(-30.0246));
  branch1.add(limb9);
  const knot9 = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.0322, 0), 0.0039, 9), barkDarkMat);
  knot9.name = 'knot9';
  knot9.position.set(0.6166, 4.8452, 0.4202);
  branch1.add(knot9);
  const limb10 = new THREE.Mesh(new THREE.CylinderGeometry(0.0159, 0.0258, 0.2647, 5, 1, true), barkDarkMat);
  limb10.name = 'limb10';
  limb10.position.set(0.6768, 4.9481, 0.4567);
  limb10.rotation.set(deg(17.0728), deg(-4.4378), deg(-28.9483));
  branch1.add(limb10);
  const limb11 = new THREE.Mesh(new THREE.CylinderGeometry(0.006, 0.0159, 0.2588, 5, 1, true), barkDarkMat);
  limb11.name = 'limb11';
  limb11.position.set(0.7816, 5.1649, 0.5169);
  limb11.rotation.set(deg(10.972), deg(-2.0412), deg(-21.0161));
  branch1.add(limb11);
  const limb12 = new THREE.Mesh(new THREE.CylinderGeometry(0.0159, 0.0258, 0.2548, 5, 1, true), barkDarkMat);
  limb12.name = 'limb12';
  limb12.position.set(0.6287, 4.9619, 0.3965);
  limb12.rotation.set(deg(-11.4345), deg(0.581), deg(-5.7983));
  branch1.add(limb12);
  const limb13 = new THREE.Mesh(new THREE.CylinderGeometry(0.006, 0.0159, 0.2489, 5, 1, true), barkDarkMat);
  limb13.name = 'limb13';
  limb13.position.set(0.6426, 5.1982, 0.3699);
  limb13.rotation.set(deg(-1.3626), deg(0.01), deg(-0.8374));
  branch1.add(limb13);
  const branch2 = new THREE.Group();
  branch2.name = 'branch2';
  root.add(branch2);
  const limb14 = new THREE.Mesh(new THREE.CylinderGeometry(0.1061, 0.1299, 0.6269, 5, 1, true), barkMat);
  limb14.name = 'limb14';
  limb14.position.set(-0.3321, 2.3821, 0.5232);
  limb14.rotation.set(deg(40.8165), deg(6.5124), deg(17.3877));
  branch2.add(limb14);
  const limb15 = new THREE.Mesh(new THREE.CylinderGeometry(0.0823, 0.1061, 0.6127, 5, 1, true), barkMat);
  limb15.name = 'limb15';
  limb15.position.set(-0.5124, 2.7944, 0.8324);
  limb15.rotation.set(deg(28.6305), deg(5.4683), deg(21.2003));
  branch2.add(limb15);
  const limb16 = new THREE.Mesh(new THREE.CylinderGeometry(0.0585, 0.0823, 0.5984, 5), barkMat);
  limb16.name = 'limb16';
  limb16.position.set(-0.6645, 3.2732, 1.0379);
  limb16.rotation.set(deg(15.7615), deg(1.5551), deg(11.2));
  branch2.add(limb16);
  const knot16 = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.0731, 0), 0.0088, 16), barkDarkMat);
  knot16.name = 'knot16';
  knot16.position.set(-0.7178, 3.532, 1.1124);
  branch2.add(knot16);
  const limb17 = new THREE.Mesh(new THREE.CylinderGeometry(0.0424, 0.0585, 0.4812, 5, 1, true), barkDarkMat);
  limb17.name = 'limb17';
  limb17.position.set(-0.8205, 3.7247, 1.1576);
  limb17.rotation.set(deg(11.7032), deg(2.8678), deg(27.4507));
  branch2.add(limb17);
  const limb18 = new THREE.Mesh(new THREE.CylinderGeometry(0.0263, 0.0424, 0.4715, 5), barkDarkMat);
  limb18.name = 'limb18';
  limb18.position.set(-0.9669, 4.1362, 1.2071);
  limb18.rotation.set(deg(1.1073), deg(0.1096), deg(11.3078));
  branch2.add(limb18);
  const knot18 = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.0329, 0), 0.0039, 18), barkDarkMat);
  knot18.name = 'knot18';
  knot18.position.set(-1.0106, 4.3549, 1.2114);
  branch2.add(knot18);
  const limb19 = new THREE.Mesh(new THREE.CylinderGeometry(0.0162, 0.0263, 0.2402, 5, 1, true), barkDarkMat);
  limb19.name = 'limb19';
  limb19.position.set(-1.034, 4.4644, 1.2044);
  limb19.rotation.set(deg(-3.5784), deg(-0.377), deg(12.0255));
  branch2.add(limb19);
  const limb20 = new THREE.Mesh(new THREE.CylinderGeometry(0.006, 0.0162, 0.2341, 5, 1, true), barkDarkMat);
  limb20.name = 'limb20';
  limb20.position.set(-1.0982, 4.6764, 1.2175);
  limb20.rotation.set(deg(10.3128), deg(1.9509), deg(21.3699));
  branch2.add(limb20);
  const limb21 = new THREE.Mesh(new THREE.CylinderGeometry(0.0162, 0.0263, 0.249, 5, 1, true), barkDarkMat);
  limb21.name = 'limb21';
  limb21.position.set(-1.0193, 4.4646, 1.2498);
  limb21.rotation.set(deg(19.2179), deg(0.7256), deg(4.2838));
  branch2.add(limb21);
  const limb22 = new THREE.Mesh(new THREE.CylinderGeometry(0.006, 0.0162, 0.2429, 5, 1, true), barkDarkMat);
  limb22.name = 'limb22';
  limb22.position.set(-1.056, 4.6836, 1.318);
  limb22.rotation.set(deg(14.8287), deg(1.8127), deg(13.8631));
  branch2.add(limb22);
  const limb23 = new THREE.Mesh(new THREE.CylinderGeometry(0.0424, 0.0585, 0.4985, 5, 1, true), barkDarkMat);
  limb23.name = 'limb23';
  limb23.position.set(-0.6601, 3.7453, 1.1821);
  limb23.rotation.set(deg(17.5195), deg(-2.2353), deg(-14.4317));
  branch2.add(limb23);
  const limb24 = new THREE.Mesh(new THREE.CylinderGeometry(0.0263, 0.0424, 0.4889, 5), barkDarkMat);
  limb24.name = 'limb24';
  limb24.position.set(-0.5396, 4.1756, 1.3038);
  limb24.rotation.set(deg(12.9652), deg(-1.796), deg(-15.7081));
  branch2.add(limb24);
  const knot24 = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.0329, 0), 0.0039, 24), barkDarkMat);
  knot24.name = 'knot24';
  knot24.position.set(-0.4769, 4.3925, 1.3557);
  branch2.add(knot24);
  const limb25 = new THREE.Mesh(new THREE.CylinderGeometry(0.0162, 0.0263, 0.2584, 5, 1, true), barkDarkMat);
  limb25.name = 'limb25';
  limb25.position.set(-0.4435, 4.5071, 1.3776);
  limb25.rotation.set(deg(10.3879), deg(-1.4625), deg(-15.9853));
  branch2.add(limb25);
  const limb26 = new THREE.Mesh(new THREE.CylinderGeometry(0.006, 0.0162, 0.2524, 5, 1, true), barkDarkMat);
  limb26.name = 'limb26';
  limb26.position.set(-0.3524, 4.7283, 1.3968);
  limb26.rotation.set(deg(-1.2786), deg(0.3238), deg(-28.4229));
  branch2.add(limb26);
  const limb27 = new THREE.Mesh(new THREE.CylinderGeometry(0.0162, 0.0263, 0.2616, 5, 1, true), barkDarkMat);
  limb27.name = 'limb27';
  limb27.position.set(-0.4703, 4.5133, 1.3339);
  limb27.rotation.set(deg(-10.213), deg(0.2778), deg(-3.1077));
  branch2.add(limb27);
  const limb28 = new THREE.Mesh(new THREE.CylinderGeometry(0.006, 0.0162, 0.2555, 5, 1, true), barkDarkMat);
  limb28.name = 'limb28';
  limb28.position.set(-0.4727, 4.7551, 1.2926);
  limb28.rotation.set(deg(-9.1496), deg(-0.3393), deg(4.2391));
  branch2.add(limb28);
  const branch3 = new THREE.Group();
  branch3.name = 'branch3';
  root.add(branch3);
  const limb29 = new THREE.Mesh(new THREE.CylinderGeometry(0.127, 0.1555, 0.6176, 5, 1, true), barkMat);
  limb29.name = 'limb29';
  limb29.position.set(-0.272, 1.8533, 0.1813);
  limb29.rotation.set(deg(-18.8853), deg(-8.9895), deg(50.5963));
  branch3.add(limb29);
  const limb30 = new THREE.Mesh(new THREE.CylinderGeometry(0.0985, 0.127, 0.6005, 5, 1, true), barkMat);
  limb30.name = 'limb30';
  limb30.position.set(-0.64, 2.178, 0.0024);
  limb30.rotation.set(deg(-21.4834), deg(-7.9622), deg(40.2922));
  branch3.add(limb30);
  const limb31 = new THREE.Mesh(new THREE.CylinderGeometry(0.07, 0.0985, 0.5834, 5), barkMat);
  limb31.name = 'limb31';
  limb31.position.set(-0.9249, 2.564, -0.2003);
  limb31.rotation.set(deg(-24.3464), deg(-5.8503), deg(26.6524));
  branch3.add(limb31);
  const knot31 = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.0875, 0), 0.0105, 31), barkDarkMat);
  knot31.name = 'knot31';
  knot31.position.set(-1.0419, 2.7726, -0.3078);
  branch3.add(knot31);
  const limb32 = new THREE.Mesh(new THREE.CylinderGeometry(0.0507, 0.07, 0.458, 5, 1, true), barkDarkMat);
  limb32.name = 'limb32';
  limb32.position.set(-1.0247, 2.9712, -0.3671);
  limb32.rotation.set(deg(-16.5577), deg(0.692), deg(-4.753));
  branch3.add(limb32);
  const limb33 = new THREE.Mesh(new THREE.CylinderGeometry(0.0315, 0.0507, 0.4465, 5), barkDarkMat);
  limb33.name = 'limb33';
  limb33.position.set(-1.0146, 3.3721, -0.4745);
  limb33.rotation.set(deg(-13.3947), deg(-0.231), deg(1.9667));
  branch3.add(limb33);
  const knot33 = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.0394, 0), 0.0047, 33), barkDarkMat);
  knot33.name = 'knot33';
  knot33.position.set(-1.0217, 3.5744, -0.5227);
  branch3.add(knot33);
  const limb34 = new THREE.Mesh(new THREE.CylinderGeometry(0.0187, 0.0315, 0.267, 5, 1, true), barkDarkMat);
  limb34.name = 'limb34';
  limb34.position.set(-0.9995, 3.6904, -0.5606);
  limb34.rotation.set(deg(-17.7658), deg(1.6183), deg(-10.3269));
  branch3.add(limb34);
  const limb35 = new THREE.Mesh(new THREE.CylinderGeometry(0.006, 0.0187, 0.2594, 5, 1, true), barkDarkMat);
  limb35.name = 'limb35';
  limb35.position.set(-0.944, 3.9219, -0.6294);
  limb35.rotation.set(deg(-14.4764), deg(1.9889), deg(-15.565));
  branch3.add(limb35);
  const limb36 = new THREE.Mesh(new THREE.CylinderGeometry(0.0187, 0.0315, 0.2726, 5, 1, true), barkDarkMat);
  limb36.name = 'limb36';
  limb36.position.set(-1.0144, 3.6999, -0.5061);
  limb36.rotation.set(deg(7.5068), deg(-0.2164), deg(-3.2974));
  branch3.add(limb36);
  const limb37 = new THREE.Mesh(new THREE.CylinderGeometry(0.006, 0.0187, 0.2649, 5, 1, true), barkDarkMat);
  limb37.name = 'limb37';
  limb37.position.set(-0.9787, 3.9448, -0.4576);
  limb37.rotation.set(deg(14.626), deg(-1.6696), deg(-12.9549));
  branch3.add(limb37);
  const limb38 = new THREE.Mesh(new THREE.CylinderGeometry(0.0507, 0.07, 0.5179, 5, 1, true), barkDarkMat);
  limb38.name = 'limb38';
  limb38.position.set(-1.141, 2.9878, -0.2861);
  limb38.rotation.set(deg(5.2281), deg(1.1415), deg(24.6181));
  branch3.add(limb38);
  const limb39 = new THREE.Mesh(new THREE.CylinderGeometry(0.0315, 0.0507, 0.5064, 5), barkDarkMat);
  limb39.name = 'limb39';
  limb39.position.set(-1.3207, 3.4265, -0.2795);
  limb39.rotation.set(deg(-3.6237), deg(-0.6328), deg(19.8061));
  branch3.add(limb39);
  const knot39 = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.0394, 0), 0.0047, 39), barkDarkMat);
  knot39.name = 'knot39';
  knot39.position.set(-1.4014, 3.6498, -0.2945);
  branch3.add(knot39);
  const limb40 = new THREE.Mesh(new THREE.CylinderGeometry(0.0187, 0.0315, 0.2985, 5, 1, true), barkDarkMat);
  limb40.name = 'limb40';
  limb40.position.set(-1.4211, 3.7882, -0.2969);
  limb40.rotation.set(deg(-0.9888), deg(-0.0703), deg(8.135));
  branch3.add(limb40);
  const limb41 = new THREE.Mesh(new THREE.CylinderGeometry(0.006, 0.0187, 0.2908, 5, 1, true), barkDarkMat);
  limb41.name = 'limb41';
  limb41.position.set(-1.4444, 4.063, -0.2688);
  limb41.rotation.set(deg(12.592), deg(0.1591), deg(1.4417));
  branch3.add(limb41);
  const branch4 = new THREE.Group();
  branch4.name = 'branch4';
  root.add(branch4);
  const limb42 = new THREE.Mesh(new THREE.CylinderGeometry(0.0853, 0.1044, 0.6947, 5, 1, true), barkMat);
  limb42.name = 'limb42';
  limb42.position.set(-0.1933, 2.8835, 0.2166);
  limb42.rotation.set(deg(-45.0452), deg(10.5196), deg(-25.0338));
  branch4.add(limb42);
  const limb43 = new THREE.Mesh(new THREE.CylinderGeometry(0.0661, 0.0853, 0.6832, 5, 1, true), barkMat);
  limb43.name = 'limb43';
  limb43.position.set(0.1268, 3.271, -0.156);
  limb43.rotation.set(deg(-29.3892), deg(10.1219), deg(-37.3201));
  branch4.add(limb43);
  const limb44 = new THREE.Mesh(new THREE.CylinderGeometry(0.047, 0.0661, 0.6717, 5), barkMat);
  limb44.name = 'limb44';
  limb44.position.set(0.5056, 3.6802, -0.4535);
  limb44.rotation.set(deg(-27.7134), deg(9.603), deg(-37.61));
  branch4.add(limb44);
  const knot44 = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.0587, 0), 0.007, 44), barkDarkMat);
  knot44.name = 'knot44';
  knot44.position.set(0.6958, 3.8868, -0.5984);
  branch4.add(knot44);
  const limb45 = new THREE.Mesh(new THREE.CylinderGeometry(0.0341, 0.047, 0.517, 5, 1, true), barkDarkMat);
  limb45.name = 'limb45';
  limb45.position.set(0.8951, 4.028, -0.6056);
  limb45.rotation.set(deg(-1.67), deg(0.8634), deg(-54.6747));
  branch4.add(limb45);
  const limb46 = new THREE.Mesh(new THREE.CylinderGeometry(0.0211, 0.0341, 0.5092, 5), barkDarkMat);
  limb46.name = 'limb46';
  limb46.position.set(1.2564, 4.3522, -0.6079);
  limb46.rotation.set(deg(1.123), deg(-0.4251), deg(-41.468));
  branch4.add(limb46);
  const knot46 = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.0264, 0), 0.0032, 46), barkDarkMat);
  knot46.name = 'knot46';
  knot46.position.set(1.4182, 4.5353, -0.6031);
  branch4.add(knot46);
  const limb47 = new THREE.Mesh(new THREE.CylinderGeometry(0.0136, 0.0211, 0.3065, 5, 1, true), barkDarkMat);
  limb47.name = 'limb47';
  limb47.position.set(1.4902, 4.6367, -0.5249);
  limb47.rotation.set(deg(32.5883), deg(-8.8717), deg(-29.7258));
  branch4.add(limb47);
  const limb48 = new THREE.Mesh(new THREE.CylinderGeometry(0.006, 0.0136, 0.3019, 5, 1, true), barkDarkMat);
  limb48.name = 'limb48';
  limb48.position.set(1.6091, 4.8547, -0.3707);
  limb48.rotation.set(deg(31.3551), deg(-5.3034), deg(-18.7403));
  branch4.add(limb48);
  const limb49 = new THREE.Mesh(new THREE.CylinderGeometry(0.0136, 0.0211, 0.327, 5, 1, true), barkDarkMat);
  limb49.name = 'limb49';
  limb49.position.set(1.4938, 4.6513, -0.6775);
  limb49.rotation.set(deg(-28.5166), deg(7.5283), deg(-29.0302));
  branch4.add(limb49);
  const limb50 = new THREE.Mesh(new THREE.CylinderGeometry(0.006, 0.0136, 0.3225, 5, 1, true), barkDarkMat);
  limb50.name = 'limb50';
  limb50.position.set(1.6139, 4.8776, -0.8547);
  limb50.rotation.set(deg(-41.1389), deg(6.2399), deg(-16.5288));
  branch4.add(limb50);
  const limb51 = new THREE.Mesh(new THREE.CylinderGeometry(0.0341, 0.047, 0.5599, 5, 1, true), barkDarkMat);
  limb51.name = 'limb51';
  limb51.position.set(0.679, 4.1033, -0.7519);
  limb51.rotation.set(deg(-35.2609), deg(-1.1511), deg(3.6211));
  branch4.add(limb51);
  const limb52 = new THREE.Mesh(new THREE.CylinderGeometry(0.0211, 0.0341, 0.5521, 5), barkDarkMat);
  limb52.name = 'limb52';
  limb52.position.set(0.6305, 4.5487, -1.0366);
  limb52.rotation.set(deg(-29.6107), deg(-1.8129), deg(6.8514));
  branch4.add(limb52);
  const knot52 = new THREE.Mesh(jitter(new THREE.DodecahedronGeometry(0.0264, 0), 0.0032, 52), barkDarkMat);
  knot52.name = 'knot52';
  knot52.position.set(0.5988, 4.7777, -1.1679);
  branch4.add(knot52);
  const limb53 = new THREE.Mesh(new THREE.CylinderGeometry(0.0136, 0.0211, 0.3573, 5, 1, true), barkDarkMat);
  limb53.name = 'limb53';
  limb53.position.set(0.6214, 4.9426, -1.2122);
  limb53.rotation.set(deg(-14.908), deg(0.9894), deg(-7.5516));
  branch4.add(limb53);
  const limb54 = new THREE.Mesh(new THREE.CylinderGeometry(0.006, 0.0136, 0.3527, 5, 1, true), barkDarkMat);
  limb54.name = 'limb54';
  limb54.position.set(0.6372, 5.2645, -1.3274);
  limb54.rotation.set(deg(-24.2862), deg(-0.4891), deg(2.2728));
  branch4.add(limb54);

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

export default createDeadTree;

Ratings & comments

—
No ratings yet — be the first.
5
0
4
0
3
0
2
0
1
0

Sign in to rate and comment.

0 comments

No comments yet. Share how you used this model or what could be better.

Related models

Same category or similar tags