Codels
4,6 B üçgen3,48 × 3,70 × 10,4 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.
/**
 * Battle Tank — Codels 3D model library
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 4,636 · Size (W × H × D): 3.48 × 3.70 × 10.39 m
 *
 * Usage:
 *   import { createTank } from './tank.js';
 *   
 *   const model = createTank();
 *   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 createTank() {
  const root = new THREE.Group();
  root.name = 'Tank';

  // Materials
  const camoMat = new THREE.MeshStandardMaterial({ name: 'camo', color: 0x4e5a33, roughness: 0.75, metalness: 0.15, flatShading: true });
  const camoDarkMat = new THREE.MeshStandardMaterial({ name: 'camoDark', color: 0x303820, roughness: 0.8, metalness: 0.1, flatShading: true });
  const camoLightMat = new THREE.MeshStandardMaterial({ name: 'camoLight', color: 0x8c8a5f, roughness: 0.8, metalness: 0.1, flatShading: true });
  const trackMat = new THREE.MeshStandardMaterial({ name: 'track', color: 0x2b2b2d, roughness: 0.85, metalness: 0.3, flatShading: true });
  const wheelMat = new THREE.MeshStandardMaterial({ name: 'wheel', color: 0x454f2d, roughness: 0.7, metalness: 0.2, flatShading: true });
  const metalMat = new THREE.MeshStandardMaterial({ name: 'metal', color: 0x55585c, roughness: 0.5, metalness: 0.6, flatShading: true });
  const blackMat = new THREE.MeshStandardMaterial({ name: 'black', color: 0x1e1f22, roughness: 0.8, flatShading: true });
  const glassMat = new THREE.MeshStandardMaterial({ name: 'glass', color: 0x2a3644, roughness: 0.2, metalness: 0.3, flatShading: true });
  const headlightMat = new THREE.MeshStandardMaterial({ name: 'headlight', color: 0xfff4d6, roughness: 0.3, emissive: 0xffe2a0, emissiveIntensity: 0.8, flatShading: true });

  // Shared geometries
  const extrudeGeo = extrude([[-2.55, 0.04], [2.55, 0.04], [3.3294, 0.2923], [3.4305, 0.3947], [3.4888, 0.5261], [3.4969, 0.6697], [3.4536, 0.8069], [3.3647, 0.9199], [3.2415, 0.9941], [3.1, 1.02], [-3.05, 1.02], [-3.1915, 0.9941], [-3.3147, 0.9199], [-3.4036, 0.8069], [-3.4469, 0.6697], [-3.4388, 0.5261], [-3.3805, 0.3947], [-3.2794, 0.2923]], 0.62, [[[-2.5, 0.12], [2.5, 0.12], [3.2835, 0.3579], [3.3644, 0.4397], [3.4111, 0.5449], [3.4175, 0.6598], [3.3829, 0.7695], [3.3117, 0.8599], [3.2132, 0.9193], [3.1, 0.94], [-3.05, 0.94], [-3.1632, 0.9193], [-3.2617, 0.8599], [-3.3329, 0.7695], [-3.3675, 0.6598], [-3.3611, 0.5449], [-3.3144, 0.4397], [-3.2335, 0.3579]]]);
  const boxGeo = new THREE.BoxGeometry(0.64, 0.05, 0.09);
  const cylinderGeo = new THREE.CylinderGeometry(0.34, 0.34, 0.42, 12);
  const cylinderGeo2 = new THREE.CylinderGeometry(0.27, 0.27, 0.44, 10);
  const cylinderGeo3 = new THREE.CylinderGeometry(0.1, 0.12, 0.06, 6);
  const cylinderGeo4 = new THREE.CylinderGeometry(0.3, 0.3, 0.4, 12);
  const cylinderGeo5 = new THREE.CylinderGeometry(0.3, 0.3, 0.36, 10);
  const boxGeo2 = new THREE.BoxGeometry(0.38, 0.08, 0.08);
  const cylinderGeo6 = new THREE.CylinderGeometry(0.12, 0.14, 0.08, 6);
  const extrudeGeo2 = extrude([[-3.4, 0.66], [-3.45, 1.02], [3.45, 1.02], [3.62, 0.72], [3.38, 0.66]], 0.06);
  const boxGeo3 = new THREE.BoxGeometry(0.012, 0.34, 0.02);
  const boxGeo4 = new THREE.BoxGeometry(0.22, 0.12, 0.1);
  const boxGeo5 = new THREE.BoxGeometry(0.16, 0.08, 0.02);
  const torusGeo = new THREE.TorusGeometry(0.08, 0.025, 4, 8);
  const boxGeo6 = new THREE.BoxGeometry(0.12, 0.08, 0.04);
  const boxGeo7 = new THREE.BoxGeometry(0.3, 0.22, 1.2);
  const boxGeo8 = new THREE.BoxGeometry(0.12, 0.06, 0.04);
  const boxGeo9 = new THREE.BoxGeometry(2, 0.03, 0.22);
  const boxGeo10 = new THREE.BoxGeometry(0.08, 0.06, 0.04);
  const cylinderGeo7 = new THREE.CylinderGeometry(0.05, 0.05, 0.22, 6);
  const cylinderGeo8 = new THREE.CylinderGeometry(0.006, 0.012, 1.3065, 4);
  const boxGeo11 = new THREE.BoxGeometry(2.2, 0.04, 0.04);
  const boxGeo12 = new THREE.BoxGeometry(0.04, 0.32, 0.55);

  // Parts
  const tracks = new THREE.Group();
  tracks.name = 'tracks';
  root.add(tracks);
  const trackL = new THREE.Group();
  trackL.name = 'trackL';
  trackL.position.set(1.35, 0, 0);
  tracks.add(trackL);
  const trackBand = new THREE.Mesh(extrudeGeo, trackMat);
  trackBand.name = 'trackBand';
  trackBand.rotation.set(0, deg(-90), 0);
  trackL.add(trackBand);
  const box4 = new THREE.Mesh(boxGeo, trackMat);
  box4.position.set(0, 0.025, -2.5);
  trackL.add(box4);
  const box5 = new THREE.Mesh(boxGeo, trackMat);
  box5.position.set(0, 0.025, -2.3);
  trackL.add(box5);
  const box6 = new THREE.Mesh(boxGeo, trackMat);
  box6.position.set(0, 0.025, -2.1);
  trackL.add(box6);
  const box7 = new THREE.Mesh(boxGeo, trackMat);
  box7.position.set(0, 0.025, -1.9);
  trackL.add(box7);
  const box8 = new THREE.Mesh(boxGeo, trackMat);
  box8.position.set(0, 0.025, -1.7);
  trackL.add(box8);
  const box9 = new THREE.Mesh(boxGeo, trackMat);
  box9.position.set(0, 0.025, -1.5);
  trackL.add(box9);
  const box10 = new THREE.Mesh(boxGeo, trackMat);
  box10.position.set(0, 0.025, -1.3);
  trackL.add(box10);
  const box11 = new THREE.Mesh(boxGeo, trackMat);
  box11.position.set(0, 0.025, -1.1);
  trackL.add(box11);
  const box12 = new THREE.Mesh(boxGeo, trackMat);
  box12.position.set(0, 0.025, -0.9);
  trackL.add(box12);
  const box13 = new THREE.Mesh(boxGeo, trackMat);
  box13.position.set(0, 0.025, -0.7);
  trackL.add(box13);
  const box14 = new THREE.Mesh(boxGeo, trackMat);
  box14.position.set(0, 0.025, -0.5);
  trackL.add(box14);
  const box15 = new THREE.Mesh(boxGeo, trackMat);
  box15.position.set(0, 0.025, -0.3);
  trackL.add(box15);
  const box16 = new THREE.Mesh(boxGeo, trackMat);
  box16.position.set(0, 0.025, -0.1);
  trackL.add(box16);
  const box17 = new THREE.Mesh(boxGeo, trackMat);
  box17.position.set(0, 0.025, 0.1);
  trackL.add(box17);
  const box18 = new THREE.Mesh(boxGeo, trackMat);
  box18.position.set(0, 0.025, 0.3);
  trackL.add(box18);
  const box19 = new THREE.Mesh(boxGeo, trackMat);
  box19.position.set(0, 0.025, 0.5);
  trackL.add(box19);
  const box20 = new THREE.Mesh(boxGeo, trackMat);
  box20.position.set(0, 0.025, 0.7);
  trackL.add(box20);
  const box21 = new THREE.Mesh(boxGeo, trackMat);
  box21.position.set(0, 0.025, 0.9);
  trackL.add(box21);
  const box22 = new THREE.Mesh(boxGeo, trackMat);
  box22.position.set(0, 0.025, 1.1);
  trackL.add(box22);
  const box23 = new THREE.Mesh(boxGeo, trackMat);
  box23.position.set(0, 0.025, 1.3);
  trackL.add(box23);
  const box24 = new THREE.Mesh(boxGeo, trackMat);
  box24.position.set(0, 0.025, 1.5);
  trackL.add(box24);
  const box25 = new THREE.Mesh(boxGeo, trackMat);
  box25.position.set(0, 0.025, 1.7);
  trackL.add(box25);
  const box26 = new THREE.Mesh(boxGeo, trackMat);
  box26.position.set(0, 0.025, 1.9);
  trackL.add(box26);
  const box27 = new THREE.Mesh(boxGeo, trackMat);
  box27.position.set(0, 0.025, 2.1);
  trackL.add(box27);
  const box28 = new THREE.Mesh(boxGeo, trackMat);
  box28.position.set(0, 0.025, 2.3);
  trackL.add(box28);
  const box29 = new THREE.Mesh(boxGeo, trackMat);
  box29.position.set(0, 0.025, 2.5);
  trackL.add(box29);
  const box30 = new THREE.Mesh(boxGeo, trackMat);
  box30.position.set(0, 0.35, 3.4217);
  box30.rotation.set(deg(130), 0, 0);
  trackL.add(box30);
  const box31 = new THREE.Mesh(boxGeo, trackMat);
  box31.position.set(0, 0.5291, 3.51);
  box31.rotation.set(deg(102.5), 0, 0);
  trackL.add(box31);
  const box32 = new THREE.Mesh(boxGeo, trackMat);
  box32.position.set(0, 0.7287, 3.5057);
  box32.rotation.set(deg(75), 0, 0);
  trackL.add(box32);
  const box33 = new THREE.Mesh(boxGeo, trackMat);
  box33.position.set(0, 0.9037, 3.4097);
  box33.rotation.set(deg(47.5), 0, 0);
  trackL.add(box33);
  const box34 = new THREE.Mesh(boxGeo, trackMat);
  box34.position.set(0, 1.0147, 3.2436);
  box34.rotation.set(deg(20), 0, 0);
  trackL.add(box34);
  const box35 = new THREE.Mesh(boxGeo, trackMat);
  box35.position.set(0, 1.0147, -3.1936);
  box35.rotation.set(deg(-20), 0, 0);
  trackL.add(box35);
  const box36 = new THREE.Mesh(boxGeo, trackMat);
  box36.position.set(0, 0.9037, -3.3597);
  box36.rotation.set(deg(-47.5), 0, 0);
  trackL.add(box36);
  const box37 = new THREE.Mesh(boxGeo, trackMat);
  box37.position.set(0, 0.7287, -3.4557);
  box37.rotation.set(deg(-75), 0, 0);
  trackL.add(box37);
  const box38 = new THREE.Mesh(boxGeo, trackMat);
  box38.position.set(0, 0.5291, -3.46);
  box38.rotation.set(deg(-102.5), 0, 0);
  trackL.add(box38);
  const box39 = new THREE.Mesh(boxGeo, trackMat);
  box39.position.set(0, 0.35, -3.3717);
  box39.rotation.set(deg(-130), 0, 0);
  trackL.add(box39);
  const trackR = new THREE.Group();
  trackR.name = 'trackR';
  trackR.position.set(-1.35, 0, 0);
  tracks.add(trackR);
  const trackBand2 = new THREE.Mesh(extrudeGeo, trackMat);
  trackBand2.name = 'trackBand';
  trackBand2.rotation.set(0, deg(-90), 0);
  trackR.add(trackBand2);
  const box42 = new THREE.Mesh(boxGeo, trackMat);
  box42.position.set(0, 0.025, -2.5);
  trackR.add(box42);
  const box43 = new THREE.Mesh(boxGeo, trackMat);
  box43.position.set(0, 0.025, -2.3);
  trackR.add(box43);
  const box44 = new THREE.Mesh(boxGeo, trackMat);
  box44.position.set(0, 0.025, -2.1);
  trackR.add(box44);
  const box45 = new THREE.Mesh(boxGeo, trackMat);
  box45.position.set(0, 0.025, -1.9);
  trackR.add(box45);
  const box46 = new THREE.Mesh(boxGeo, trackMat);
  box46.position.set(0, 0.025, -1.7);
  trackR.add(box46);
  const box47 = new THREE.Mesh(boxGeo, trackMat);
  box47.position.set(0, 0.025, -1.5);
  trackR.add(box47);
  const box48 = new THREE.Mesh(boxGeo, trackMat);
  box48.position.set(0, 0.025, -1.3);
  trackR.add(box48);
  const box49 = new THREE.Mesh(boxGeo, trackMat);
  box49.position.set(0, 0.025, -1.1);
  trackR.add(box49);
  const box50 = new THREE.Mesh(boxGeo, trackMat);
  box50.position.set(0, 0.025, -0.9);
  trackR.add(box50);
  const box51 = new THREE.Mesh(boxGeo, trackMat);
  box51.position.set(0, 0.025, -0.7);
  trackR.add(box51);
  const box52 = new THREE.Mesh(boxGeo, trackMat);
  box52.position.set(0, 0.025, -0.5);
  trackR.add(box52);
  const box53 = new THREE.Mesh(boxGeo, trackMat);
  box53.position.set(0, 0.025, -0.3);
  trackR.add(box53);
  const box54 = new THREE.Mesh(boxGeo, trackMat);
  box54.position.set(0, 0.025, -0.1);
  trackR.add(box54);
  const box55 = new THREE.Mesh(boxGeo, trackMat);
  box55.position.set(0, 0.025, 0.1);
  trackR.add(box55);
  const box56 = new THREE.Mesh(boxGeo, trackMat);
  box56.position.set(0, 0.025, 0.3);
  trackR.add(box56);
  const box57 = new THREE.Mesh(boxGeo, trackMat);
  box57.position.set(0, 0.025, 0.5);
  trackR.add(box57);
  const box58 = new THREE.Mesh(boxGeo, trackMat);
  box58.position.set(0, 0.025, 0.7);
  trackR.add(box58);
  const box59 = new THREE.Mesh(boxGeo, trackMat);
  box59.position.set(0, 0.025, 0.9);
  trackR.add(box59);
  const box60 = new THREE.Mesh(boxGeo, trackMat);
  box60.position.set(0, 0.025, 1.1);
  trackR.add(box60);
  const box61 = new THREE.Mesh(boxGeo, trackMat);
  box61.position.set(0, 0.025, 1.3);
  trackR.add(box61);
  const box62 = new THREE.Mesh(boxGeo, trackMat);
  box62.position.set(0, 0.025, 1.5);
  trackR.add(box62);
  const box63 = new THREE.Mesh(boxGeo, trackMat);
  box63.position.set(0, 0.025, 1.7);
  trackR.add(box63);
  const box64 = new THREE.Mesh(boxGeo, trackMat);
  box64.position.set(0, 0.025, 1.9);
  trackR.add(box64);
  const box65 = new THREE.Mesh(boxGeo, trackMat);
  box65.position.set(0, 0.025, 2.1);
  trackR.add(box65);
  const box66 = new THREE.Mesh(boxGeo, trackMat);
  box66.position.set(0, 0.025, 2.3);
  trackR.add(box66);
  const box67 = new THREE.Mesh(boxGeo, trackMat);
  box67.position.set(0, 0.025, 2.5);
  trackR.add(box67);
  const box68 = new THREE.Mesh(boxGeo, trackMat);
  box68.position.set(0, 0.35, 3.4217);
  box68.rotation.set(deg(130), 0, 0);
  trackR.add(box68);
  const box69 = new THREE.Mesh(boxGeo, trackMat);
  box69.position.set(0, 0.5291, 3.51);
  box69.rotation.set(deg(102.5), 0, 0);
  trackR.add(box69);
  const box70 = new THREE.Mesh(boxGeo, trackMat);
  box70.position.set(0, 0.7287, 3.5057);
  box70.rotation.set(deg(75), 0, 0);
  trackR.add(box70);
  const box71 = new THREE.Mesh(boxGeo, trackMat);
  box71.position.set(0, 0.9037, 3.4097);
  box71.rotation.set(deg(47.5), 0, 0);
  trackR.add(box71);
  const box72 = new THREE.Mesh(boxGeo, trackMat);
  box72.position.set(0, 1.0147, 3.2436);
  box72.rotation.set(deg(20), 0, 0);
  trackR.add(box72);
  const box73 = new THREE.Mesh(boxGeo, trackMat);
  box73.position.set(0, 1.0147, -3.1936);
  box73.rotation.set(deg(-20), 0, 0);
  trackR.add(box73);
  const box74 = new THREE.Mesh(boxGeo, trackMat);
  box74.position.set(0, 0.9037, -3.3597);
  box74.rotation.set(deg(-47.5), 0, 0);
  trackR.add(box74);
  const box75 = new THREE.Mesh(boxGeo, trackMat);
  box75.position.set(0, 0.7287, -3.4557);
  box75.rotation.set(deg(-75), 0, 0);
  trackR.add(box75);
  const box76 = new THREE.Mesh(boxGeo, trackMat);
  box76.position.set(0, 0.5291, -3.46);
  box76.rotation.set(deg(-102.5), 0, 0);
  trackR.add(box76);
  const box77 = new THREE.Mesh(boxGeo, trackMat);
  box77.position.set(0, 0.35, -3.3717);
  box77.rotation.set(deg(-130), 0, 0);
  trackR.add(box77);
  const wheels = new THREE.Group();
  wheels.name = 'wheels';
  root.add(wheels);
  const roadWheelL1 = new THREE.Group();
  roadWheelL1.name = 'roadWheelL1';
  roadWheelL1.position.set(1.35, 0.46, 2.15);
  wheels.add(roadWheelL1);
  const rubber = new THREE.Mesh(cylinderGeo, trackMat);
  rubber.name = 'rubber';
  rubber.rotation.set(0, 0, deg(90));
  roadWheelL1.add(rubber);
  const disc = new THREE.Mesh(cylinderGeo2, wheelMat);
  disc.name = 'disc';
  disc.rotation.set(0, 0, deg(90));
  roadWheelL1.add(disc);
  const hub = new THREE.Mesh(cylinderGeo3, metalMat);
  hub.name = 'hub';
  hub.position.set(0.24, 0, 0);
  hub.rotation.set(0, 0, deg(-90));
  roadWheelL1.add(hub);
  const roadWheelL2 = new THREE.Group();
  roadWheelL2.name = 'roadWheelL2';
  roadWheelL2.position.set(1.35, 0.46, 1.25);
  wheels.add(roadWheelL2);
  const rubber2 = new THREE.Mesh(cylinderGeo, trackMat);
  rubber2.name = 'rubber';
  rubber2.rotation.set(0, 0, deg(90));
  roadWheelL2.add(rubber2);
  const disc2 = new THREE.Mesh(cylinderGeo2, wheelMat);
  disc2.name = 'disc';
  disc2.rotation.set(0, 0, deg(90));
  roadWheelL2.add(disc2);
  const hub2 = new THREE.Mesh(cylinderGeo3, metalMat);
  hub2.name = 'hub';
  hub2.position.set(0.24, 0, 0);
  hub2.rotation.set(0, 0, deg(-90));
  roadWheelL2.add(hub2);
  const roadWheelL3 = new THREE.Group();
  roadWheelL3.name = 'roadWheelL3';
  roadWheelL3.position.set(1.35, 0.46, 0.35);
  wheels.add(roadWheelL3);
  const rubber3 = new THREE.Mesh(cylinderGeo, trackMat);
  rubber3.name = 'rubber';
  rubber3.rotation.set(0, 0, deg(90));
  roadWheelL3.add(rubber3);
  const disc3 = new THREE.Mesh(cylinderGeo2, wheelMat);
  disc3.name = 'disc';
  disc3.rotation.set(0, 0, deg(90));
  roadWheelL3.add(disc3);
  const hub3 = new THREE.Mesh(cylinderGeo3, metalMat);
  hub3.name = 'hub';
  hub3.position.set(0.24, 0, 0);
  hub3.rotation.set(0, 0, deg(-90));
  roadWheelL3.add(hub3);
  const roadWheelL4 = new THREE.Group();
  roadWheelL4.name = 'roadWheelL4';
  roadWheelL4.position.set(1.35, 0.46, -0.55);
  wheels.add(roadWheelL4);
  const rubber4 = new THREE.Mesh(cylinderGeo, trackMat);
  rubber4.name = 'rubber';
  rubber4.rotation.set(0, 0, deg(90));
  roadWheelL4.add(rubber4);
  const disc4 = new THREE.Mesh(cylinderGeo2, wheelMat);
  disc4.name = 'disc';
  disc4.rotation.set(0, 0, deg(90));
  roadWheelL4.add(disc4);
  const hub4 = new THREE.Mesh(cylinderGeo3, metalMat);
  hub4.name = 'hub';
  hub4.position.set(0.24, 0, 0);
  hub4.rotation.set(0, 0, deg(-90));
  roadWheelL4.add(hub4);
  const roadWheelL5 = new THREE.Group();
  roadWheelL5.name = 'roadWheelL5';
  roadWheelL5.position.set(1.35, 0.46, -1.45);
  wheels.add(roadWheelL5);
  const rubber5 = new THREE.Mesh(cylinderGeo, trackMat);
  rubber5.name = 'rubber';
  rubber5.rotation.set(0, 0, deg(90));
  roadWheelL5.add(rubber5);
  const disc5 = new THREE.Mesh(cylinderGeo2, wheelMat);
  disc5.name = 'disc';
  disc5.rotation.set(0, 0, deg(90));
  roadWheelL5.add(disc5);
  const hub5 = new THREE.Mesh(cylinderGeo3, metalMat);
  hub5.name = 'hub';
  hub5.position.set(0.24, 0, 0);
  hub5.rotation.set(0, 0, deg(-90));
  roadWheelL5.add(hub5);
  const roadWheelL6 = new THREE.Group();
  roadWheelL6.name = 'roadWheelL6';
  roadWheelL6.position.set(1.35, 0.46, -2.35);
  wheels.add(roadWheelL6);
  const rubber6 = new THREE.Mesh(cylinderGeo, trackMat);
  rubber6.name = 'rubber';
  rubber6.rotation.set(0, 0, deg(90));
  roadWheelL6.add(rubber6);
  const disc6 = new THREE.Mesh(cylinderGeo2, wheelMat);
  disc6.name = 'disc';
  disc6.rotation.set(0, 0, deg(90));
  roadWheelL6.add(disc6);
  const hub6 = new THREE.Mesh(cylinderGeo3, metalMat);
  hub6.name = 'hub';
  hub6.position.set(0.24, 0, 0);
  hub6.rotation.set(0, 0, deg(-90));
  roadWheelL6.add(hub6);
  const idlerL = new THREE.Group();
  idlerL.name = 'idlerL';
  idlerL.position.set(1.35, 0.62, 3.1);
  wheels.add(idlerL);
  const cylinder104 = new THREE.Mesh(cylinderGeo4, wheelMat);
  cylinder104.rotation.set(0, 0, deg(90));
  idlerL.add(cylinder104);
  const cylinder105 = new THREE.Mesh(cylinderGeo3, metalMat);
  cylinder105.position.set(0.21, 0, 0);
  cylinder105.rotation.set(0, 0, deg(-90));
  idlerL.add(cylinder105);
  const sprocketL = new THREE.Group();
  sprocketL.name = 'sprocketL';
  sprocketL.position.set(1.35, 0.62, -3.05);
  wheels.add(sprocketL);
  const cylinder107 = new THREE.Mesh(cylinderGeo5, metalMat);
  cylinder107.rotation.set(0, 0, deg(90));
  sprocketL.add(cylinder107);
  const box108 = new THREE.Mesh(boxGeo2, metalMat);
  box108.position.set(0, 0, 0.32);
  sprocketL.add(box108);
  const box109 = new THREE.Mesh(boxGeo2, metalMat);
  box109.position.set(0, 0.2263, 0.2263);
  box109.rotation.set(deg(-45), 0, 0);
  sprocketL.add(box109);
  const box110 = new THREE.Mesh(boxGeo2, metalMat);
  box110.position.set(0, 0.32, 0);
  box110.rotation.set(deg(-90), 0, 0);
  sprocketL.add(box110);
  const box111 = new THREE.Mesh(boxGeo2, metalMat);
  box111.position.set(0, 0.2263, -0.2263);
  box111.rotation.set(deg(-135), 0, 0);
  sprocketL.add(box111);
  const box112 = new THREE.Mesh(boxGeo2, metalMat);
  box112.position.set(0, 0, -0.32);
  box112.rotation.set(deg(-180), 0, 0);
  sprocketL.add(box112);
  const box113 = new THREE.Mesh(boxGeo2, metalMat);
  box113.position.set(0, -0.2263, -0.2263);
  box113.rotation.set(deg(-225), 0, 0);
  sprocketL.add(box113);
  const box114 = new THREE.Mesh(boxGeo2, metalMat);
  box114.position.set(0, -0.32, 0);
  box114.rotation.set(deg(-270), 0, 0);
  sprocketL.add(box114);
  const box115 = new THREE.Mesh(boxGeo2, metalMat);
  box115.position.set(0, -0.2263, 0.2263);
  box115.rotation.set(deg(-315), 0, 0);
  sprocketL.add(box115);
  const cylinder116 = new THREE.Mesh(cylinderGeo6, blackMat);
  cylinder116.position.set(0.2, 0, 0);
  cylinder116.rotation.set(0, 0, deg(-90));
  sprocketL.add(cylinder116);
  const roadWheelR1 = new THREE.Group();
  roadWheelR1.name = 'roadWheelR1';
  roadWheelR1.position.set(-1.35, 0.46, 2.15);
  wheels.add(roadWheelR1);
  const rubber7 = new THREE.Mesh(cylinderGeo, trackMat);
  rubber7.name = 'rubber';
  rubber7.rotation.set(0, 0, deg(90));
  roadWheelR1.add(rubber7);
  const disc7 = new THREE.Mesh(cylinderGeo2, wheelMat);
  disc7.name = 'disc';
  disc7.rotation.set(0, 0, deg(90));
  roadWheelR1.add(disc7);
  const hub7 = new THREE.Mesh(cylinderGeo3, metalMat);
  hub7.name = 'hub';
  hub7.position.set(-0.24, 0, 0);
  hub7.rotation.set(0, 0, deg(90));
  roadWheelR1.add(hub7);
  const roadWheelR2 = new THREE.Group();
  roadWheelR2.name = 'roadWheelR2';
  roadWheelR2.position.set(-1.35, 0.46, 1.25);
  wheels.add(roadWheelR2);
  const rubber8 = new THREE.Mesh(cylinderGeo, trackMat);
  rubber8.name = 'rubber';
  rubber8.rotation.set(0, 0, deg(90));
  roadWheelR2.add(rubber8);
  const disc8 = new THREE.Mesh(cylinderGeo2, wheelMat);
  disc8.name = 'disc';
  disc8.rotation.set(0, 0, deg(90));
  roadWheelR2.add(disc8);
  const hub8 = new THREE.Mesh(cylinderGeo3, metalMat);
  hub8.name = 'hub';
  hub8.position.set(-0.24, 0, 0);
  hub8.rotation.set(0, 0, deg(90));
  roadWheelR2.add(hub8);
  const roadWheelR3 = new THREE.Group();
  roadWheelR3.name = 'roadWheelR3';
  roadWheelR3.position.set(-1.35, 0.46, 0.35);
  wheels.add(roadWheelR3);
  const rubber9 = new THREE.Mesh(cylinderGeo, trackMat);
  rubber9.name = 'rubber';
  rubber9.rotation.set(0, 0, deg(90));
  roadWheelR3.add(rubber9);
  const disc9 = new THREE.Mesh(cylinderGeo2, wheelMat);
  disc9.name = 'disc';
  disc9.rotation.set(0, 0, deg(90));
  roadWheelR3.add(disc9);
  const hub9 = new THREE.Mesh(cylinderGeo3, metalMat);
  hub9.name = 'hub';
  hub9.position.set(-0.24, 0, 0);
  hub9.rotation.set(0, 0, deg(90));
  roadWheelR3.add(hub9);
  const roadWheelR4 = new THREE.Group();
  roadWheelR4.name = 'roadWheelR4';
  roadWheelR4.position.set(-1.35, 0.46, -0.55);
  wheels.add(roadWheelR4);
  const rubber10 = new THREE.Mesh(cylinderGeo, trackMat);
  rubber10.name = 'rubber';
  rubber10.rotation.set(0, 0, deg(90));
  roadWheelR4.add(rubber10);
  const disc10 = new THREE.Mesh(cylinderGeo2, wheelMat);
  disc10.name = 'disc';
  disc10.rotation.set(0, 0, deg(90));
  roadWheelR4.add(disc10);
  const hub10 = new THREE.Mesh(cylinderGeo3, metalMat);
  hub10.name = 'hub';
  hub10.position.set(-0.24, 0, 0);
  hub10.rotation.set(0, 0, deg(90));
  roadWheelR4.add(hub10);
  const roadWheelR5 = new THREE.Group();
  roadWheelR5.name = 'roadWheelR5';
  roadWheelR5.position.set(-1.35, 0.46, -1.45);
  wheels.add(roadWheelR5);
  const rubber11 = new THREE.Mesh(cylinderGeo, trackMat);
  rubber11.name = 'rubber';
  rubber11.rotation.set(0, 0, deg(90));
  roadWheelR5.add(rubber11);
  const disc11 = new THREE.Mesh(cylinderGeo2, wheelMat);
  disc11.name = 'disc';
  disc11.rotation.set(0, 0, deg(90));
  roadWheelR5.add(disc11);
  const hub11 = new THREE.Mesh(cylinderGeo3, metalMat);
  hub11.name = 'hub';
  hub11.position.set(-0.24, 0, 0);
  hub11.rotation.set(0, 0, deg(90));
  roadWheelR5.add(hub11);
  const roadWheelR6 = new THREE.Group();
  roadWheelR6.name = 'roadWheelR6';
  roadWheelR6.position.set(-1.35, 0.46, -2.35);
  wheels.add(roadWheelR6);
  const rubber12 = new THREE.Mesh(cylinderGeo, trackMat);
  rubber12.name = 'rubber';
  rubber12.rotation.set(0, 0, deg(90));
  roadWheelR6.add(rubber12);
  const disc12 = new THREE.Mesh(cylinderGeo2, wheelMat);
  disc12.name = 'disc';
  disc12.rotation.set(0, 0, deg(90));
  roadWheelR6.add(disc12);
  const hub12 = new THREE.Mesh(cylinderGeo3, metalMat);
  hub12.name = 'hub';
  hub12.position.set(-0.24, 0, 0);
  hub12.rotation.set(0, 0, deg(90));
  roadWheelR6.add(hub12);
  const idlerR = new THREE.Group();
  idlerR.name = 'idlerR';
  idlerR.position.set(-1.35, 0.62, 3.1);
  wheels.add(idlerR);
  const cylinder142 = new THREE.Mesh(cylinderGeo4, wheelMat);
  cylinder142.rotation.set(0, 0, deg(90));
  idlerR.add(cylinder142);
  const cylinder143 = new THREE.Mesh(cylinderGeo3, metalMat);
  cylinder143.position.set(-0.21, 0, 0);
  cylinder143.rotation.set(0, 0, deg(90));
  idlerR.add(cylinder143);
  const sprocketR = new THREE.Group();
  sprocketR.name = 'sprocketR';
  sprocketR.position.set(-1.35, 0.62, -3.05);
  wheels.add(sprocketR);
  const cylinder145 = new THREE.Mesh(cylinderGeo5, metalMat);
  cylinder145.rotation.set(0, 0, deg(90));
  sprocketR.add(cylinder145);
  const box146 = new THREE.Mesh(boxGeo2, metalMat);
  box146.position.set(0, 0, 0.32);
  sprocketR.add(box146);
  const box147 = new THREE.Mesh(boxGeo2, metalMat);
  box147.position.set(0, 0.2263, 0.2263);
  box147.rotation.set(deg(-45), 0, 0);
  sprocketR.add(box147);
  const box148 = new THREE.Mesh(boxGeo2, metalMat);
  box148.position.set(0, 0.32, 0);
  box148.rotation.set(deg(-90), 0, 0);
  sprocketR.add(box148);
  const box149 = new THREE.Mesh(boxGeo2, metalMat);
  box149.position.set(0, 0.2263, -0.2263);
  box149.rotation.set(deg(-135), 0, 0);
  sprocketR.add(box149);
  const box150 = new THREE.Mesh(boxGeo2, metalMat);
  box150.position.set(0, 0, -0.32);
  box150.rotation.set(deg(-180), 0, 0);
  sprocketR.add(box150);
  const box151 = new THREE.Mesh(boxGeo2, metalMat);
  box151.position.set(0, -0.2263, -0.2263);
  box151.rotation.set(deg(-225), 0, 0);
  sprocketR.add(box151);
  const box152 = new THREE.Mesh(boxGeo2, metalMat);
  box152.position.set(0, -0.32, 0);
  box152.rotation.set(deg(-270), 0, 0);
  sprocketR.add(box152);
  const box153 = new THREE.Mesh(boxGeo2, metalMat);
  box153.position.set(0, -0.2263, 0.2263);
  box153.rotation.set(deg(-315), 0, 0);
  sprocketR.add(box153);
  const cylinder154 = new THREE.Mesh(cylinderGeo6, blackMat);
  cylinder154.position.set(-0.2, 0, 0);
  cylinder154.rotation.set(0, 0, deg(90));
  sprocketR.add(cylinder154);
  const hull = new THREE.Group();
  hull.name = 'hull';
  root.add(hull);
  const lowerHull = new THREE.Mesh(extrude([[-3.3, 0.45], [-3.42, 1.04], [3.62, 1.04], [3.12, 0.42]], 2), camoMat);
  lowerHull.name = 'lowerHull';
  lowerHull.rotation.set(0, deg(-90), 0);
  hull.add(lowerHull);
  const upperHull = new THREE.Mesh(extrude([[-3.42, 1], [-3.5, 1.62], [-3.3, 1.7], [2.25, 1.7], [3.58, 1.26], [3.64, 1]], 3.3, [], [0.03, 0.03, 1]), camoMat);
  upperHull.name = 'upperHull';
  upperHull.rotation.set(0, deg(-90), 0);
  hull.add(upperHull);
  const skirtL = new THREE.Mesh(extrudeGeo2, camoMat);
  skirtL.name = 'skirtL';
  skirtL.position.set(1.7, 0, 0);
  skirtL.rotation.set(0, deg(-90), 0);
  hull.add(skirtL);
  const box159 = new THREE.Mesh(boxGeo3, camoDarkMat);
  box159.position.set(1.735, 0.84, -2.6);
  hull.add(box159);
  const box160 = new THREE.Mesh(boxGeo3, camoDarkMat);
  box160.position.set(1.735, 0.84, -1.3);
  hull.add(box160);
  const box161 = new THREE.Mesh(boxGeo3, camoDarkMat);
  box161.position.set(1.735, 0.84, 0);
  hull.add(box161);
  const box162 = new THREE.Mesh(boxGeo3, camoDarkMat);
  box162.position.set(1.735, 0.84, 1.3);
  hull.add(box162);
  const box163 = new THREE.Mesh(boxGeo3, camoDarkMat);
  box163.position.set(1.735, 0.84, 2.6);
  hull.add(box163);
  const box164 = new THREE.Mesh(boxGeo4, blackMat);
  box164.position.set(1.25, 1.38, 3.45);
  box164.rotation.set(deg(-18), 0, 0);
  hull.add(box164);
  const headlightL = new THREE.Mesh(boxGeo5, headlightMat);
  headlightL.name = 'headlightL';
  headlightL.position.set(1.25, 1.38, 3.51);
  headlightL.rotation.set(deg(-18), 0, 0);
  hull.add(headlightL);
  const torus166 = new THREE.Mesh(torusGeo, metalMat);
  torus166.position.set(0.7, 0.75, 3.38);
  torus166.rotation.set(0, deg(90), 0);
  hull.add(torus166);
  const box167 = new THREE.Mesh(boxGeo6, blackMat);
  box167.position.set(1.3, 1.45, -3.5);
  hull.add(box167);
  const box168 = new THREE.Mesh(boxGeo7, camoMat);
  box168.position.set(1.45, 1.81, -1.8);
  hull.add(box168);
  const skirtR = new THREE.Mesh(extrudeGeo2, camoMat);
  skirtR.name = 'skirtR';
  skirtR.position.set(-1.7, 0, 0);
  skirtR.rotation.set(0, deg(-90), 0);
  hull.add(skirtR);
  const box170 = new THREE.Mesh(boxGeo3, camoDarkMat);
  box170.position.set(-1.735, 0.84, -2.6);
  hull.add(box170);
  const box171 = new THREE.Mesh(boxGeo3, camoDarkMat);
  box171.position.set(-1.735, 0.84, -1.3);
  hull.add(box171);
  const box172 = new THREE.Mesh(boxGeo3, camoDarkMat);
  box172.position.set(-1.735, 0.84, 0);
  hull.add(box172);
  const box173 = new THREE.Mesh(boxGeo3, camoDarkMat);
  box173.position.set(-1.735, 0.84, 1.3);
  hull.add(box173);
  const box174 = new THREE.Mesh(boxGeo3, camoDarkMat);
  box174.position.set(-1.735, 0.84, 2.6);
  hull.add(box174);
  const box175 = new THREE.Mesh(boxGeo4, blackMat);
  box175.position.set(-1.25, 1.38, 3.45);
  box175.rotation.set(deg(-18), 0, 0);
  hull.add(box175);
  const headlightR = new THREE.Mesh(boxGeo5, headlightMat);
  headlightR.name = 'headlightR';
  headlightR.position.set(-1.25, 1.38, 3.51);
  headlightR.rotation.set(deg(-18), 0, 0);
  hull.add(headlightR);
  const torus177 = new THREE.Mesh(torusGeo, metalMat);
  torus177.position.set(-0.7, 0.75, 3.38);
  torus177.rotation.set(0, deg(90), 0);
  hull.add(torus177);
  const box178 = new THREE.Mesh(boxGeo6, blackMat);
  box178.position.set(-1.3, 1.45, -3.5);
  hull.add(box178);
  const box179 = new THREE.Mesh(boxGeo7, camoMat);
  box179.position.set(-1.45, 1.81, -1.8);
  hull.add(box179);
  const driverHatch = new THREE.Mesh(new THREE.CylinderGeometry(0.28, 0.3, 0.06, 10), camoDarkMat);
  driverHatch.name = 'driverHatch';
  driverHatch.position.set(0, 1.72, 2.05);
  hull.add(driverHatch);
  const box181 = new THREE.Mesh(boxGeo8, glassMat);
  box181.position.set(-0.18, 1.75, 2.3);
  hull.add(box181);
  const box182 = new THREE.Mesh(boxGeo8, glassMat);
  box182.position.set(0, 1.75, 2.3);
  hull.add(box182);
  const box183 = new THREE.Mesh(boxGeo8, glassMat);
  box183.position.set(0.18, 1.75, 2.3);
  hull.add(box183);
  const box184 = new THREE.Mesh(boxGeo9, blackMat);
  box184.position.set(0, 1.715, -1.7);
  hull.add(box184);
  const box185 = new THREE.Mesh(boxGeo9, blackMat);
  box185.position.set(0, 1.715, -2.08);
  hull.add(box185);
  const box186 = new THREE.Mesh(boxGeo9, blackMat);
  box186.position.set(0, 1.715, -2.46);
  hull.add(box186);
  const box187 = new THREE.Mesh(boxGeo9, blackMat);
  box187.position.set(0, 1.715, -2.84);
  hull.add(box187);
  const exhaustGrille = new THREE.Mesh(new THREE.BoxGeometry(1.8, 0.4, 0.06), blackMat);
  exhaustGrille.name = 'exhaustGrille';
  exhaustGrille.position.set(0, 1.3, -3.47);
  hull.add(exhaustGrille);
  const turret = new THREE.Group();
  turret.name = 'turret';
  turret.position.set(0, 1.7, 0.25);
  root.add(turret);
  const turretBody = new THREE.Mesh(extrude([[-0.85, 1.55], [0.85, 1.55], [1.25, 0.8], [1.3, -1.25], [1.05, -1.65], [-1.05, -1.65], [-1.3, -1.25], [-1.25, 0.8]], 0.5, [], [0.1, 0.1, 1]), camoMat);
  turretBody.name = 'turretBody';
  turretBody.position.set(0, 0.35, 0);
  turretBody.rotation.set(deg(90), 0, 0);
  turret.add(turretBody);
  const turretRing = new THREE.Mesh(new THREE.CylinderGeometry(1, 1.05, 0.12, 14), camoDarkMat);
  turretRing.name = 'turretRing';
  turretRing.position.set(0, 0.04, 0);
  turret.add(turretRing);
  const cupola = new THREE.Mesh(new THREE.CylinderGeometry(0.32, 0.35, 0.24, 10), camoMat);
  cupola.name = 'cupola';
  cupola.position.set(0.55, 0.82, -0.45);
  turret.add(cupola);
  const commanderHatch = new THREE.Mesh(new THREE.CylinderGeometry(0.3, 0.3, 0.05, 10), camoDarkMat);
  commanderHatch.name = 'commanderHatch';
  commanderHatch.position.set(0.55, 0.965, -0.45);
  turret.add(commanderHatch);
  const box194 = new THREE.Mesh(boxGeo10, glassMat);
  box194.position.set(0.4844, 0.85, -0.1266);
  box194.rotation.set(0, deg(-11.4592), 0);
  turret.add(box194);
  const box195 = new THREE.Mesh(boxGeo10, glassMat);
  box195.position.set(0.7574, 0.85, -0.1933);
  box195.rotation.set(0, deg(38.9408), 0);
  turret.add(box195);
  const box196 = new THREE.Mesh(boxGeo10, glassMat);
  box196.position.set(0.88, 0.85, -0.4462);
  box196.rotation.set(0, deg(89.3408), 0);
  turret.add(box196);
  const box197 = new THREE.Mesh(boxGeo10, glassMat);
  box197.position.set(0.7633, 0.85, -0.7018);
  box197.rotation.set(0, deg(139.7408), 0);
  turret.add(box197);
  const box198 = new THREE.Mesh(boxGeo10, glassMat);
  box198.position.set(0.4919, 0.85, -0.7748);
  box198.rotation.set(0, deg(190.1408), 0);
  turret.add(box198);
  const mgMount = new THREE.Mesh(new THREE.BoxGeometry(0.1, 0.12, 0.3), metalMat);
  mgMount.name = 'mgMount';
  mgMount.position.set(0.55, 1.05, -0.3);
  turret.add(mgMount);
  const machineGun = new THREE.Mesh(new THREE.CylinderGeometry(0.018, 0.022, 0.75, 6), blackMat);
  machineGun.name = 'machineGun';
  machineGun.position.set(0.55, 1.08, 0.175);
  machineGun.rotation.set(deg(90), 0, 0);
  turret.add(machineGun);
  const loaderHatch = new THREE.Mesh(new THREE.CylinderGeometry(0.26, 0.28, 0.05, 10), camoDarkMat);
  loaderHatch.name = 'loaderHatch';
  loaderHatch.position.set(-0.55, 0.725, -0.6);
  turret.add(loaderHatch);
  const cylinder202 = new THREE.Mesh(cylinderGeo7, metalMat);
  cylinder202.position.set(1.12, 0.62, 0.95);
  cylinder202.rotation.set(deg(57.3424), deg(-10.8362), deg(-19.6799));
  turret.add(cylinder202);
  const cylinder203 = new THREE.Mesh(cylinderGeo7, metalMat);
  cylinder203.position.set(1.15, 0.62, 0.83);
  cylinder203.rotation.set(deg(57.3424), deg(-10.8362), deg(-19.6799));
  turret.add(cylinder203);
  const cylinder204 = new THREE.Mesh(cylinderGeo7, metalMat);
  cylinder204.position.set(1.18, 0.62, 0.71);
  cylinder204.rotation.set(deg(57.3424), deg(-10.8362), deg(-19.6799));
  turret.add(cylinder204);
  const cylinder205 = new THREE.Mesh(cylinderGeo8, blackMat);
  cylinder205.position.set(0.85, 1.35, -1.515);
  cylinder205.rotation.set(deg(-5.7106), 0, 0);
  turret.add(cylinder205);
  const cylinder206 = new THREE.Mesh(cylinderGeo7, metalMat);
  cylinder206.position.set(-1.12, 0.62, 0.95);
  cylinder206.rotation.set(deg(57.3424), deg(10.8362), deg(19.6799));
  turret.add(cylinder206);
  const cylinder207 = new THREE.Mesh(cylinderGeo7, metalMat);
  cylinder207.position.set(-1.15, 0.62, 0.83);
  cylinder207.rotation.set(deg(57.3424), deg(10.8362), deg(19.6799));
  turret.add(cylinder207);
  const cylinder208 = new THREE.Mesh(cylinderGeo7, metalMat);
  cylinder208.position.set(-1.18, 0.62, 0.71);
  cylinder208.rotation.set(deg(57.3424), deg(10.8362), deg(19.6799));
  turret.add(cylinder208);
  const cylinder209 = new THREE.Mesh(cylinderGeo8, blackMat);
  cylinder209.position.set(-0.85, 1.35, -1.515);
  cylinder209.rotation.set(deg(-5.7106), 0, 0);
  turret.add(cylinder209);
  const bustleFloor = new THREE.Mesh(new THREE.BoxGeometry(2.2, 0.05, 0.55), metalMat);
  bustleFloor.name = 'bustleFloor';
  bustleFloor.position.set(0, 0.18, -1.98);
  turret.add(bustleFloor);
  const box211 = new THREE.Mesh(boxGeo11, metalMat);
  box211.position.set(0, 0.48, -1.72);
  turret.add(box211);
  const box212 = new THREE.Mesh(boxGeo11, metalMat);
  box212.position.set(0, 0.48, -2.24);
  turret.add(box212);
  const box213 = new THREE.Mesh(boxGeo12, metalMat);
  box213.position.set(-1.08, 0.33, -1.98);
  turret.add(box213);
  const box214 = new THREE.Mesh(boxGeo12, metalMat);
  box214.position.set(-0.36, 0.33, -1.98);
  turret.add(box214);
  const box215 = new THREE.Mesh(boxGeo12, metalMat);
  box215.position.set(0.36, 0.33, -1.98);
  turret.add(box215);
  const box216 = new THREE.Mesh(boxGeo12, metalMat);
  box216.position.set(1.08, 0.33, -1.98);
  turret.add(box216);
  const box217 = new THREE.Mesh(new THREE.BoxGeometry(0.9, 0.24, 0.4), camoDarkMat);
  box217.position.set(-0.45, 0.32, -1.98);
  box217.rotation.set(0, deg(4), 0);
  turret.add(box217);
  const barrel = new THREE.Group();
  barrel.name = 'barrel';
  barrel.position.set(0, 0.32, 1.62);
  turret.add(barrel);
  const mantlet = new THREE.Mesh(new THREE.BoxGeometry(0.8, 0.5, 0.36), camoMat);
  mantlet.name = 'mantlet';
  mantlet.position.set(0, 0, 0.12);
  barrel.add(mantlet);
  const gunTube = new THREE.Mesh(new THREE.CylinderGeometry(0.075, 0.09, 4.7, 10), camoMat);
  gunTube.name = 'gunTube';
  gunTube.position.set(0, 0, 2.6);
  gunTube.rotation.set(deg(90), 0, 0);
  barrel.add(gunTube);
  const fumeExtractor = new THREE.Mesh(new THREE.CylinderGeometry(0.13, 0.13, 0.6, 10), camoMat);
  fumeExtractor.name = 'fumeExtractor';
  fumeExtractor.position.set(0, 0, 2.2);
  fumeExtractor.rotation.set(deg(90), 0, 0);
  barrel.add(fumeExtractor);
  const muzzle = new THREE.Mesh(new THREE.CylinderGeometry(0.1, 0.1, 0.22, 10), camoDarkMat);
  muzzle.name = 'muzzle';
  muzzle.position.set(0, 0, 4.88);
  muzzle.rotation.set(deg(90), 0, 0);
  barrel.add(muzzle);
  const gunSight = new THREE.Mesh(new THREE.BoxGeometry(0.18, 0.14, 0.24), metalMat);
  gunSight.name = 'gunSight';
  gunSight.position.set(0.5, 0.18, 0.15);
  barrel.add(gunSight);
  const extrude224 = new THREE.Mesh(extrude([[0.2568, 0.0163], [0.1233, 0.1583], [-0.1084, 0.2357], [-0.3117, 0.0244], [-0.2015, -0.1913], [0.1715, -0.154]], 0.01), camoLightMat);
  extrude224.position.set(-0.4225, 0.71, -0.8433);
  extrude224.rotation.set(deg(90), 0, 0);
  turret.add(extrude224);
  const extrude225 = new THREE.Mesh(extrude([[0.3431, 0.016], [0.1781, 0.1757], [-0.1933, 0.1937], [-0.3232, -0.0065], [-0.1374, -0.1836], [0.0715, -0.1618]], 0.01), camoDarkMat);
  extrude225.position.set(0.6025, 0.71, -0.5623);
  extrude225.rotation.set(deg(90), 0, 0);
  turret.add(extrude225);
  const extrude226 = new THREE.Mesh(extrude([[0.3273, -0.0088], [0.1065, 0.1494], [-0.1341, 0.234], [-0.3709, 0.053], [-0.1409, -0.1429], [0.1529, -0.1489]], 0.01), camoLightMat);
  extrude226.position.set(-0.1747, 0.71, 0.372);
  extrude226.rotation.set(deg(90), 0, 0);
  turret.add(extrude226);
  const extrude227 = new THREE.Mesh(extrude([[0.3404, -0.0509], [0.215, 0.2021], [-0.1902, 0.1504], [-0.2599, 0.0293], [-0.1147, -0.2102], [0.1446, -0.1433]], 0.01), camoDarkMat);
  extrude227.position.set(-0.0379, 0.71, 0.8197);
  extrude227.rotation.set(deg(90), 0, 0);
  turret.add(extrude227);
  const extrude228 = new THREE.Mesh(extrude([[0.359, 0.0072], [0.2338, 0.1189], [-0.1838, 0.0904], [-0.3272, 0.0323], [-0.1821, -0.0985], [0.2013, -0.1204]], 0.01), camoDarkMat);
  extrude228.position.set(1.41, 0.35, -0.2352);
  extrude228.rotation.set(0, deg(90), 0);
  turret.add(extrude228);
  const extrude229 = new THREE.Mesh(extrude([[0.3546, 0.0136], [0.116, 0.1245], [-0.099, 0.1446], [-0.3266, -0.001], [-0.2577, -0.1254], [0.0928, -0.1373]], 0.01), camoLightMat);
  extrude229.position.set(-1.41, 0.35, -0.7639);
  extrude229.rotation.set(0, deg(-90), 0);
  turret.add(extrude229);
  const camoPatches = new THREE.Group();
  camoPatches.name = 'camoPatches';
  root.add(camoPatches);
  const extrude231 = new THREE.Mesh(extrude([[0.4052, -0.0026], [0.2509, 0.1978], [-0.1843, 0.1555], [-0.4763, -0.0428], [-0.2563, -0.2673], [0.1458, -0.2128]], 0.01), camoDarkMat);
  extrude231.position.set(0.1225, 1.735, -2.908);
  extrude231.rotation.set(deg(90), 0, 0);
  camoPatches.add(extrude231);
  const extrude232 = new THREE.Mesh(extrude([[0.4069, -0.0526], [0.1356, 0.2281], [-0.2103, 0.2327], [-0.3425, -0.014], [-0.1158, -0.2405], [0.2757, -0.2021]], 0.01), camoLightMat);
  extrude232.position.set(0.117, 1.735, -2.9113);
  extrude232.rotation.set(deg(90), 0, 0);
  camoPatches.add(extrude232);
  const extrude233 = new THREE.Mesh(extrude([[0.4536, -0.0321], [0.2036, 0.2084], [-0.1432, 0.1868], [-0.3548, 0.0451], [-0.1279, -0.183], [0.1656, -0.1717]], 0.01), camoDarkMat);
  extrude233.position.set(-0.6074, 1.735, 1.8967);
  extrude233.rotation.set(deg(90), 0, 0);
  camoPatches.add(extrude233);
  const extrude234 = new THREE.Mesh(extrude([[0.4088, 0.004], [0.1373, 0.1962], [-0.1192, 0.274], [-0.2896, -0.0417], [-0.1356, -0.2473], [0.1675, -0.1652]], 0.01), camoLightMat);
  extrude234.position.set(0.9199, 1.735, 1.5914);
  extrude234.rotation.set(deg(90), 0, 0);
  camoPatches.add(extrude234);
  const extrude235 = new THREE.Mesh(extrude([[0.3595, -0.0429], [0.176, 0.2065], [-0.1629, 0.1675], [-0.4639, -0.0734], [-0.1649, -0.2037], [0.1466, -0.2134]], 0.01), camoLightMat);
  extrude235.position.set(-0.7, 1.5678, 2.761);
  extrude235.rotation.set(deg(-71.6944), 0, 0);
  camoPatches.add(extrude235);
  const extrude236 = new THREE.Mesh(extrude([[0.2983, -0.0122], [0.1522, 0.1605], [-0.1106, 0.186], [-0.3566, -0.0069], [-0.23, -0.2462], [0.265, -0.1901]], 0.01), camoDarkMat);
  extrude236.position.set(0.75, 1.4686, 3.061);
  extrude236.rotation.set(deg(-71.6944), 0, 0);
  camoPatches.add(extrude236);
  const extrude237 = new THREE.Mesh(extrude([[0.3684, 0.0167], [0.2016, 0.0969], [-0.2518, 0.072], [-0.4806, -0.0106], [-0.2505, -0.0836], [0.1835, -0.0862]], 0.01), camoDarkMat);
  extrude237.position.set(1.735, 0.85, -2.6692);
  extrude237.rotation.set(0, deg(90), 0);
  camoPatches.add(extrude237);
  const extrude238 = new THREE.Mesh(extrude([[0.4106, -0.0149], [0.2661, 0.1303], [-0.1567, 0.0939], [-0.5946, 0.0117], [-0.2105, -0.0861], [0.1529, -0.0869]], 0.01), camoLightMat);
  extrude238.position.set(1.735, 0.85, 0.0686);
  extrude238.rotation.set(0, deg(90), 0);
  camoPatches.add(extrude238);
  const extrude239 = new THREE.Mesh(extrude([[0.379, 0.0226], [0.3513, 0.0988], [-0.2397, 0.1039], [-0.5198, -0.0186], [-0.2454, -0.0732], [0.2782, -0.0804]], 0.01), camoDarkMat);
  extrude239.position.set(1.735, 0.85, 2.4799);
  extrude239.rotation.set(0, deg(90), 0);
  camoPatches.add(extrude239);
  const extrude240 = new THREE.Mesh(extrude([[0.5529, -0.0216], [0.3087, 0.1204], [-0.278, 0.1204], [-0.3592, 0.0103], [-0.2476, -0.0987], [0.1594, -0.128]], 0.01), camoDarkMat);
  extrude240.position.set(-1.735, 0.85, -2.515);
  extrude240.rotation.set(0, deg(-90), 0);
  camoPatches.add(extrude240);
  const extrude241 = new THREE.Mesh(extrude([[0.5858, 0.0031], [0.1939, 0.0849], [-0.163, 0.1076], [-0.4007, -0.0154], [-0.1573, -0.0921], [0.2103, -0.0938]], 0.01), camoLightMat);
  extrude241.position.set(-1.735, 0.85, -0.1201);
  extrude241.rotation.set(0, deg(-90), 0);
  camoPatches.add(extrude241);
  const extrude242 = new THREE.Mesh(extrude([[0.5521, -0.0156], [0.3574, 0.094], [-0.2871, 0.0955], [-0.4727, -0.0148], [-0.1313, -0.0864], [0.3393, -0.1075]], 0.01), camoDarkMat);
  extrude242.position.set(-1.735, 0.85, 2.2619);
  extrude242.rotation.set(0, deg(-90), 0);
  camoPatches.add(extrude242);

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

export default createTank;

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