Codels
2,7 тыс. треуг.4,58 × 8,63 × 5,22 m

Использовать в коде

Ремикс в редакторе
Самодостаточный ES-модуль — зависит только от three. Вызовите фабрику и добавьте группу в сцену.
/**
 * Battle Mech — Codels 3D model library
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 2,740 · Size (W × H × D): 4.58 × 8.63 × 5.22 m
 *
 * Usage:
 *   import { createMech } from './mech.js';
 *   
 *   const model = createMech();
 *   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 createMech() {
  const root = new THREE.Group();
  root.name = 'Mech';

  // Materials
  const bodyMat = new THREE.MeshStandardMaterial({ name: 'body', color: 0xc9cdc4, roughness: 0.5, metalness: 0.3, flatShading: true });
  const accentMat = new THREE.MeshStandardMaterial({ name: 'accent', color: 0xe0782e, roughness: 0.45, metalness: 0.2, flatShading: true });
  const frameMat = new THREE.MeshStandardMaterial({ name: 'frame', color: 0x383b42, roughness: 0.55, metalness: 0.5, flatShading: true });
  const metalMat = new THREE.MeshStandardMaterial({ name: 'metal', color: 0x8e959e, roughness: 0.35, metalness: 0.75, flatShading: true });
  const glassMat = new THREE.MeshStandardMaterial({ name: 'glass', color: 0x25313e, roughness: 0.2, metalness: 0.35 });
  const glowMat = new THREE.MeshStandardMaterial({ name: 'glow', color: 0x45d8ff, roughness: 0.4, emissive: 0x45d8ff, emissiveIntensity: 1.5, flatShading: true });
  const warnMat = new THREE.MeshStandardMaterial({ name: 'warn', color: 0xe9c23a, roughness: 0.5, flatShading: true });

  // Shared geometries
  const sphereGeo = new THREE.SphereGeometry(0.42, 8, 6);
  const cylinderGeo = new THREE.CylinderGeometry(0.22, 0.26, 2.0374, 8);
  const boxGeo = new THREE.BoxGeometry(0.82, 1.4283, 0.86);
  const boxGeo2 = new THREE.BoxGeometry(0.12, 1.1182, 0.62);
  const sphereGeo2 = new THREE.SphereGeometry(0.36, 8, 6);
  const boxGeo3 = new THREE.BoxGeometry(0.72, 0.62, 0.5);
  const cylinderGeo2 = new THREE.CylinderGeometry(0.2, 0.22, 2.1833, 8);
  const boxGeo4 = new THREE.BoxGeometry(0.78, 1.4318, 0.82);
  const boxGeo5 = new THREE.BoxGeometry(0.5, 1.1769, 0.08);
  const boxGeo6 = new THREE.BoxGeometry(0.5, 0.6, 0.3);
  const sphereGeo3 = new THREE.SphereGeometry(0.3, 8, 5);
  const boxGeo7 = new THREE.BoxGeometry(1.05, 0.42, 1.25);
  const boxGeo8 = new THREE.BoxGeometry(1.1, 0.3, 0.75);
  const boxGeo9 = new THREE.BoxGeometry(0.95, 0.3, 0.55);
  const boxGeo10 = new THREE.BoxGeometry(1.12, 0.1, 2.5);
  const boxGeo11 = new THREE.BoxGeometry(0.06, 0.3, 0.5);
  const boxGeo12 = new THREE.BoxGeometry(0.06, 0.08, 0.9);
  const cylinderGeo3 = new THREE.CylinderGeometry(0.3, 0.38, 0.6, 10);
  const cylinderGeo4 = new THREE.CylinderGeometry(0.28, 0.28, 0.03, 10);
  const sphereGeo4 = new THREE.SphereGeometry(0.4, 8, 6);
  const boxGeo13 = new THREE.BoxGeometry(0.95, 0.85, 1.2);
  const boxGeo14 = new THREE.BoxGeometry(0.98, 0.1, 1.22);
  const cylinderGeo5 = new THREE.CylinderGeometry(0.2, 0.22, 1.26, 8);
  const boxGeo15 = new THREE.BoxGeometry(0.62, 0.6531, 0.66);
  const boxGeo16 = new THREE.BoxGeometry(0.72, 0.72, 1.55);
  const boxGeo17 = new THREE.BoxGeometry(0.74, 0.18, 1);
  const cylinderGeo6 = new THREE.CylinderGeometry(0.06, 0.06, 1.5, 6);
  const torusGeo = new THREE.TorusGeometry(0.22, 0.05, 4, 10);
  const boxGeo18 = new THREE.BoxGeometry(0.9, 0.7, 1.1);
  const boxGeo19 = new THREE.BoxGeometry(0.92, 0.72, 0.1);
  const cylinderGeo7 = new THREE.CylinderGeometry(0.1, 0.1, 0.06, 6);
  const coneGeo = new THREE.ConeGeometry(0.07, 0.12, 6);

  // Parts
  const mech = new THREE.Group();
  mech.name = 'mech';
  mech.position.set(0, -0.05, 0);
  root.add(mech);
  const pelvis = new THREE.Group();
  pelvis.name = 'pelvis';
  mech.add(pelvis);
  const hipBlock = new THREE.Mesh(new THREE.BoxGeometry(1.7, 0.7, 1.3), frameMat);
  hipBlock.name = 'hipBlock';
  hipBlock.position.set(0, 4.8, 0);
  pelvis.add(hipBlock);
  const crotchPlate = new THREE.Mesh(new THREE.BoxGeometry(1.2, 0.55, 0.5), accentMat);
  crotchPlate.name = 'crotchPlate';
  crotchPlate.position.set(0, 4.65, 0.7);
  crotchPlate.rotation.set(deg(-12), 0, 0);
  pelvis.add(crotchPlate);
  const waistRing = new THREE.Mesh(new THREE.CylinderGeometry(0.55, 0.65, 0.4, 10), metalMat);
  waistRing.name = 'waistRing';
  waistRing.position.set(0, 5.33, 0);
  pelvis.add(waistRing);
  const legL = new THREE.Group();
  legL.name = 'legL';
  legL.position.set(0.98, 4.75, 0);
  mech.add(legL);
  const hipJoint = new THREE.Mesh(sphereGeo, frameMat);
  hipJoint.name = 'hipJoint';
  legL.add(hipJoint);
  const thighFrame = new THREE.Mesh(cylinderGeo, frameMat);
  thighFrame.name = 'thighFrame';
  thighFrame.position.set(0.04, -1, 0.19);
  thighFrame.rotation.set(deg(168.2608), deg(-23.5461), deg(-2.4549));
  legL.add(thighFrame);
  const thighArmor = new THREE.Mesh(boxGeo, bodyMat);
  thighArmor.name = 'thighArmor';
  thighArmor.position.set(0.06, -0.95, 0.24);
  thighArmor.rotation.set(deg(-11.3009), deg(-0.3208), deg(-178.3952));
  legL.add(thighArmor);
  const thighStripe = new THREE.Mesh(boxGeo2, accentMat);
  thighStripe.name = 'thighStripe';
  thighStripe.position.set(0.49, -0.9, 0.24);
  thighStripe.rotation.set(deg(-10.3015), deg(-0.1863), deg(-178.9752));
  legL.add(thighStripe);
  const kneeL = new THREE.Group();
  kneeL.name = 'kneeL';
  kneeL.position.set(0.08, -2, 0.38);
  legL.add(kneeL);
  const kneeJoint = new THREE.Mesh(sphereGeo2, frameMat);
  kneeJoint.name = 'kneeJoint';
  kneeL.add(kneeJoint);
  const kneePad = new THREE.Mesh(boxGeo3, accentMat);
  kneePad.name = 'kneePad';
  kneePad.position.set(0, 0.05, 0.36);
  kneePad.rotation.set(deg(-15), 0, 0);
  kneeL.add(kneePad);
  const shinFrame = new THREE.Mesh(cylinderGeo2, frameMat);
  shinFrame.name = 'shinFrame';
  shinFrame.position.set(0, -1.075, -0.19);
  shinFrame.rotation.set(deg(-169.9768), 0, 0);
  kneeL.add(shinFrame);
  const shinArmor = new THREE.Mesh(boxGeo4, bodyMat);
  shinArmor.name = 'shinArmor';
  shinArmor.position.set(0, -1.05, -0.13);
  shinArmor.rotation.set(deg(-167.9052), 0, 0);
  kneeL.add(shinArmor);
  const shinPlate = new THREE.Mesh(boxGeo5, accentMat);
  shinPlate.name = 'shinPlate';
  shinPlate.position.set(0, -1.025, 0.295);
  shinPlate.rotation.set(deg(-167.7352), 0, 0);
  kneeL.add(shinPlate);
  const calfPiston = new THREE.Mesh(boxGeo6, frameMat);
  calfPiston.name = 'calfPiston';
  calfPiston.position.set(0, -1.1, -0.55);
  calfPiston.rotation.set(deg(10), 0, 0);
  kneeL.add(calfPiston);
  const footL = new THREE.Group();
  footL.name = 'footL';
  footL.position.set(0, -2.15, -0.38);
  kneeL.add(footL);
  const ankleJoint = new THREE.Mesh(sphereGeo3, frameMat);
  ankleJoint.name = 'ankleJoint';
  footL.add(ankleJoint);
  const footBody = new THREE.Mesh(boxGeo7, bodyMat);
  footBody.name = 'footBody';
  footBody.position.set(0, -0.34, 0.2);
  footL.add(footBody);
  const toe = new THREE.Mesh(boxGeo8, accentMat);
  toe.name = 'toe';
  toe.position.set(0, -0.4, 1.12);
  footL.add(toe);
  const heel = new THREE.Mesh(boxGeo9, bodyMat);
  heel.name = 'heel';
  heel.position.set(0, -0.4, -0.62);
  footL.add(heel);
  const sole = new THREE.Mesh(boxGeo10, frameMat);
  sole.name = 'sole';
  sole.position.set(0, -0.5, 0.3);
  footL.add(sole);
  const footStripe = new THREE.Mesh(boxGeo11, warnMat);
  footStripe.name = 'footStripe';
  footStripe.position.set(0.56, -0.35, 0.3);
  footL.add(footStripe);
  const legR = new THREE.Group();
  legR.name = 'legR';
  legR.position.set(-0.98, 4.75, 0);
  mech.add(legR);
  const hipJoint2 = new THREE.Mesh(sphereGeo, frameMat);
  hipJoint2.name = 'hipJoint';
  legR.add(hipJoint2);
  const thighFrame2 = new THREE.Mesh(cylinderGeo, frameMat);
  thighFrame2.name = 'thighFrame';
  thighFrame2.position.set(-0.04, -1, 0.19);
  thighFrame2.rotation.set(deg(168.2608), deg(23.5461), deg(2.4549));
  legR.add(thighFrame2);
  const thighArmor2 = new THREE.Mesh(boxGeo, bodyMat);
  thighArmor2.name = 'thighArmor';
  thighArmor2.position.set(-0.06, -0.95, 0.24);
  thighArmor2.rotation.set(deg(-11.3009), deg(0.3208), deg(178.3952));
  legR.add(thighArmor2);
  const thighStripe2 = new THREE.Mesh(boxGeo2, accentMat);
  thighStripe2.name = 'thighStripe';
  thighStripe2.position.set(-0.49, -0.9, 0.24);
  thighStripe2.rotation.set(deg(-10.3015), deg(0.1863), deg(178.9752));
  legR.add(thighStripe2);
  const kneeR = new THREE.Group();
  kneeR.name = 'kneeR';
  kneeR.position.set(-0.08, -2, 0.38);
  legR.add(kneeR);
  const kneeJoint2 = new THREE.Mesh(sphereGeo2, frameMat);
  kneeJoint2.name = 'kneeJoint';
  kneeR.add(kneeJoint2);
  const kneePad2 = new THREE.Mesh(boxGeo3, accentMat);
  kneePad2.name = 'kneePad';
  kneePad2.position.set(0, 0.05, 0.36);
  kneePad2.rotation.set(deg(-15), 0, 0);
  kneeR.add(kneePad2);
  const shinFrame2 = new THREE.Mesh(cylinderGeo2, frameMat);
  shinFrame2.name = 'shinFrame';
  shinFrame2.position.set(0, -1.075, -0.19);
  shinFrame2.rotation.set(deg(-169.9768), 0, 0);
  kneeR.add(shinFrame2);
  const shinArmor2 = new THREE.Mesh(boxGeo4, bodyMat);
  shinArmor2.name = 'shinArmor';
  shinArmor2.position.set(0, -1.05, -0.13);
  shinArmor2.rotation.set(deg(-167.9052), 0, 0);
  kneeR.add(shinArmor2);
  const shinPlate2 = new THREE.Mesh(boxGeo5, accentMat);
  shinPlate2.name = 'shinPlate';
  shinPlate2.position.set(0, -1.025, 0.295);
  shinPlate2.rotation.set(deg(-167.7352), 0, 0);
  kneeR.add(shinPlate2);
  const calfPiston2 = new THREE.Mesh(boxGeo6, frameMat);
  calfPiston2.name = 'calfPiston';
  calfPiston2.position.set(0, -1.1, -0.55);
  calfPiston2.rotation.set(deg(10), 0, 0);
  kneeR.add(calfPiston2);
  const footR = new THREE.Group();
  footR.name = 'footR';
  footR.position.set(0, -2.15, -0.38);
  kneeR.add(footR);
  const ankleJoint2 = new THREE.Mesh(sphereGeo3, frameMat);
  ankleJoint2.name = 'ankleJoint';
  footR.add(ankleJoint2);
  const footBody2 = new THREE.Mesh(boxGeo7, bodyMat);
  footBody2.name = 'footBody';
  footBody2.position.set(0, -0.34, 0.2);
  footR.add(footBody2);
  const toe2 = new THREE.Mesh(boxGeo8, accentMat);
  toe2.name = 'toe';
  toe2.position.set(0, -0.4, 1.12);
  footR.add(toe2);
  const heel2 = new THREE.Mesh(boxGeo9, bodyMat);
  heel2.name = 'heel';
  heel2.position.set(0, -0.4, -0.62);
  footR.add(heel2);
  const sole2 = new THREE.Mesh(boxGeo10, frameMat);
  sole2.name = 'sole';
  sole2.position.set(0, -0.5, 0.3);
  footR.add(sole2);
  const footStripe2 = new THREE.Mesh(boxGeo11, warnMat);
  footStripe2.name = 'footStripe';
  footStripe2.position.set(-0.56, -0.35, 0.3);
  footR.add(footStripe2);
  const torso = new THREE.Group();
  torso.name = 'torso';
  torso.position.set(0, 5.53, 0);
  mech.add(torso);
  const chest = new THREE.Mesh(extrude([[1.25, 0.15], [1.55, 0.95], [1.15, 1.85], [-0.85, 1.95], [-1.25, 1.2], [-1, 0.1]], 2.3, [], [0.08, 0.08, 1]), bodyMat);
  chest.name = 'chest';
  chest.rotation.set(0, deg(-90), 0);
  torso.add(chest);
  const canopy = new THREE.Mesh(new THREE.BoxGeometry(1.8, 0.06, 0.86), glassMat);
  canopy.name = 'canopy';
  canopy.position.set(0, 1.445, 1.45);
  canopy.rotation.set(deg(66), 0, 0);
  torso.add(canopy);
  const visor = new THREE.Mesh(new THREE.BoxGeometry(1.6, 0.13, 0.06), glowMat);
  visor.name = 'visor';
  visor.position.set(0, 0.8, 1.61);
  visor.rotation.set(deg(20.6), 0, 0);
  torso.add(visor);
  const chinPlate = new THREE.Mesh(new THREE.BoxGeometry(1.9, 0.26, 0.06), accentMat);
  chinPlate.name = 'chinPlate';
  chinPlate.position.set(0, 0.45, 1.5);
  chinPlate.rotation.set(deg(20.6), 0, 0);
  torso.add(chinPlate);
  const roofStripe = new THREE.Mesh(new THREE.BoxGeometry(2.5, 0.12, 0.3), accentMat);
  roofStripe.name = 'roofStripe';
  roofStripe.position.set(0, 1.98, 0.2);
  torso.add(roofStripe);
  const sensorHead = new THREE.Mesh(new THREE.BoxGeometry(0.7, 0.32, 0.55), frameMat);
  sensorHead.name = 'sensorHead';
  sensorHead.position.set(0.55, 2.16, -0.2);
  torso.add(sensorHead);
  const sensorEye = new THREE.Mesh(new THREE.BoxGeometry(0.32, 0.12, 0.05), glowMat);
  sensorEye.name = 'sensorEye';
  sensorEye.position.set(0.55, 2.17, 0.09);
  torso.add(sensorEye);
  const antenna = new THREE.Mesh(new THREE.CylinderGeometry(0.025, 0.035, 1.2, 5), metalMat);
  antenna.name = 'antenna';
  antenna.position.set(-0.75, 2.55, -0.6);
  torso.add(antenna);
  const vent = new THREE.Mesh(boxGeo12, frameMat);
  vent.name = 'vent';
  vent.position.set(1.24, 0.65, -0.2);
  torso.add(vent);
  const vent2 = new THREE.Mesh(boxGeo12, frameMat);
  vent2.name = 'vent';
  vent2.position.set(1.24, 0.85, -0.2);
  torso.add(vent2);
  const vent3 = new THREE.Mesh(boxGeo12, frameMat);
  vent3.name = 'vent';
  vent3.position.set(1.24, 1.05, -0.2);
  torso.add(vent3);
  const vent4 = new THREE.Mesh(boxGeo12, frameMat);
  vent4.name = 'vent';
  vent4.position.set(-1.24, 0.65, -0.2);
  torso.add(vent4);
  const vent5 = new THREE.Mesh(boxGeo12, frameMat);
  vent5.name = 'vent';
  vent5.position.set(-1.24, 0.85, -0.2);
  torso.add(vent5);
  const vent6 = new THREE.Mesh(boxGeo12, frameMat);
  vent6.name = 'vent';
  vent6.position.set(-1.24, 1.05, -0.2);
  torso.add(vent6);
  const backpack = new THREE.Mesh(new THREE.BoxGeometry(1.6, 1.3, 0.7), frameMat);
  backpack.name = 'backpack';
  backpack.position.set(0, 1.05, -1.35);
  torso.add(backpack);
  const thrusterNozzle = new THREE.Mesh(cylinderGeo3, metalMat);
  thrusterNozzle.name = 'thrusterNozzle';
  thrusterNozzle.position.set(0.45, 0.25, -1.45);
  torso.add(thrusterNozzle);
  const thrusterGlow = new THREE.Mesh(cylinderGeo4, glowMat);
  thrusterGlow.name = 'thrusterGlow';
  thrusterGlow.position.set(0.45, -0.06, -1.45);
  torso.add(thrusterGlow);
  const thrusterNozzle2 = new THREE.Mesh(cylinderGeo3, metalMat);
  thrusterNozzle2.name = 'thrusterNozzle';
  thrusterNozzle2.position.set(-0.45, 0.25, -1.45);
  torso.add(thrusterNozzle2);
  const thrusterGlow2 = new THREE.Mesh(cylinderGeo4, glowMat);
  thrusterGlow2.name = 'thrusterGlow';
  thrusterGlow2.position.set(-0.45, -0.06, -1.45);
  torso.add(thrusterGlow2);
  const armL = new THREE.Group();
  armL.name = 'armL';
  armL.position.set(1.62, 1.35, -0.05);
  torso.add(armL);
  const shoulderJoint = new THREE.Mesh(sphereGeo4, frameMat);
  shoulderJoint.name = 'shoulderJoint';
  armL.add(shoulderJoint);
  const shoulderArmor = new THREE.Mesh(boxGeo13, accentMat);
  shoulderArmor.name = 'shoulderArmor';
  shoulderArmor.position.set(0.18, 0.32, 0);
  armL.add(shoulderArmor);
  const shoulderTrim = new THREE.Mesh(boxGeo14, frameMat);
  shoulderTrim.name = 'shoulderTrim';
  shoulderTrim.position.set(0.18, 0.02, 0);
  armL.add(shoulderTrim);
  const upperArmFrame = new THREE.Mesh(cylinderGeo5, frameMat);
  upperArmFrame.name = 'upperArmFrame';
  upperArmFrame.position.set(0.075, -0.625, 0.025);
  upperArmFrame.rotation.set(deg(2.837), deg(-36.7002), deg(-171.4609));
  armL.add(upperArmFrame);
  const upperArmArmor = new THREE.Mesh(boxGeo15, bodyMat);
  upperArmArmor.name = 'upperArmArmor';
  upperArmArmor.position.set(0.125, -0.675, 0.02);
  upperArmArmor.rotation.set(deg(-3.5008), deg(-0.2691), deg(-175.6095));
  armL.add(upperArmArmor);
  const forearmL = new THREE.Group();
  forearmL.name = 'forearmL';
  forearmL.position.set(0.15, -1.25, 0.05);
  armL.add(forearmL);
  const elbowJoint = new THREE.Mesh(sphereGeo3, frameMat);
  elbowJoint.name = 'elbowJoint';
  forearmL.add(elbowJoint);
  const forearmBlock = new THREE.Mesh(boxGeo16, bodyMat);
  forearmBlock.name = 'forearmBlock';
  forearmBlock.position.set(0, -0.05, 0.55);
  forearmL.add(forearmBlock);
  const forearmStripe = new THREE.Mesh(boxGeo17, accentMat);
  forearmStripe.name = 'forearmStripe';
  forearmStripe.position.set(0, 0.27, 0.62);
  forearmL.add(forearmStripe);
  const cannonMount = new THREE.Mesh(new THREE.CylinderGeometry(0.24, 0.3, 0.6, 10), frameMat);
  cannonMount.name = 'cannonMount';
  cannonMount.position.set(0, -0.05, 1.5);
  cannonMount.rotation.set(deg(90), 0, 0);
  forearmL.add(cannonMount);
  const cannonBarrel = new THREE.Mesh(new THREE.CylinderGeometry(0.16, 0.18, 1.6, 10), metalMat);
  cannonBarrel.name = 'cannonBarrel';
  cannonBarrel.position.set(0, -0.05, 2.5);
  cannonBarrel.rotation.set(deg(90), 0, 0);
  forearmL.add(cannonBarrel);
  const muzzleBrake = new THREE.Mesh(new THREE.CylinderGeometry(0.24, 0.24, 0.35, 10), frameMat);
  muzzleBrake.name = 'muzzleBrake';
  muzzleBrake.position.set(0, -0.05, 3.2);
  muzzleBrake.rotation.set(deg(90), 0, 0);
  forearmL.add(muzzleBrake);
  const muzzleGlow = new THREE.Mesh(new THREE.CylinderGeometry(0.11, 0.11, 0.02, 10), glowMat);
  muzzleGlow.name = 'muzzleGlow';
  muzzleGlow.position.set(0, -0.05, 3.38);
  muzzleGlow.rotation.set(deg(90), 0, 0);
  forearmL.add(muzzleGlow);
  const armR = new THREE.Group();
  armR.name = 'armR';
  armR.position.set(-1.62, 1.35, -0.05);
  torso.add(armR);
  const shoulderJoint2 = new THREE.Mesh(sphereGeo4, frameMat);
  shoulderJoint2.name = 'shoulderJoint';
  armR.add(shoulderJoint2);
  const shoulderArmor2 = new THREE.Mesh(boxGeo13, accentMat);
  shoulderArmor2.name = 'shoulderArmor';
  shoulderArmor2.position.set(-0.18, 0.32, 0);
  armR.add(shoulderArmor2);
  const shoulderTrim2 = new THREE.Mesh(boxGeo14, frameMat);
  shoulderTrim2.name = 'shoulderTrim';
  shoulderTrim2.position.set(-0.18, 0.02, 0);
  armR.add(shoulderTrim2);
  const upperArmFrame2 = new THREE.Mesh(cylinderGeo5, frameMat);
  upperArmFrame2.name = 'upperArmFrame';
  upperArmFrame2.position.set(-0.075, -0.625, 0.025);
  upperArmFrame2.rotation.set(deg(2.837), deg(36.7002), deg(171.4609));
  armR.add(upperArmFrame2);
  const upperArmArmor2 = new THREE.Mesh(boxGeo15, bodyMat);
  upperArmArmor2.name = 'upperArmArmor';
  upperArmArmor2.position.set(-0.125, -0.675, 0.02);
  upperArmArmor2.rotation.set(deg(-3.5008), deg(0.2691), deg(175.6095));
  armR.add(upperArmArmor2);
  const forearmR = new THREE.Group();
  forearmR.name = 'forearmR';
  forearmR.position.set(-0.15, -1.25, 0.05);
  armR.add(forearmR);
  const elbowJoint2 = new THREE.Mesh(sphereGeo3, frameMat);
  elbowJoint2.name = 'elbowJoint';
  forearmR.add(elbowJoint2);
  const forearmBlock2 = new THREE.Mesh(boxGeo16, bodyMat);
  forearmBlock2.name = 'forearmBlock';
  forearmBlock2.position.set(0, -0.05, 0.55);
  forearmR.add(forearmBlock2);
  const forearmStripe2 = new THREE.Mesh(boxGeo17, accentMat);
  forearmStripe2.name = 'forearmStripe';
  forearmStripe2.position.set(0, 0.27, 0.62);
  forearmR.add(forearmStripe2);
  const gatling = new THREE.Group();
  gatling.name = 'gatling';
  gatling.position.set(0, -0.05, 1.5);
  forearmR.add(gatling);
  const gatlingDrum = new THREE.Mesh(new THREE.CylinderGeometry(0.32, 0.32, 0.4, 10), frameMat);
  gatlingDrum.name = 'gatlingDrum';
  gatlingDrum.rotation.set(deg(90), 0, 0);
  gatling.add(gatlingDrum);
  const gatlingBarrel = new THREE.Mesh(cylinderGeo6, metalMat);
  gatlingBarrel.name = 'gatlingBarrel';
  gatlingBarrel.position.set(0.19, 0, 0.85);
  gatlingBarrel.rotation.set(deg(90), 0, 0);
  gatling.add(gatlingBarrel);
  const gatlingBarrel2 = new THREE.Mesh(cylinderGeo6, metalMat);
  gatlingBarrel2.name = 'gatlingBarrel';
  gatlingBarrel2.position.set(0.095, 0.1645, 0.85);
  gatlingBarrel2.rotation.set(deg(90), 0, 0);
  gatling.add(gatlingBarrel2);
  const gatlingBarrel3 = new THREE.Mesh(cylinderGeo6, metalMat);
  gatlingBarrel3.name = 'gatlingBarrel';
  gatlingBarrel3.position.set(-0.095, 0.1645, 0.85);
  gatlingBarrel3.rotation.set(deg(90), 0, 0);
  gatling.add(gatlingBarrel3);
  const gatlingBarrel4 = new THREE.Mesh(cylinderGeo6, metalMat);
  gatlingBarrel4.name = 'gatlingBarrel';
  gatlingBarrel4.position.set(-0.19, 0, 0.85);
  gatlingBarrel4.rotation.set(deg(90), 0, 0);
  gatling.add(gatlingBarrel4);
  const gatlingBarrel5 = new THREE.Mesh(cylinderGeo6, metalMat);
  gatlingBarrel5.name = 'gatlingBarrel';
  gatlingBarrel5.position.set(-0.095, -0.1645, 0.85);
  gatlingBarrel5.rotation.set(deg(90), 0, 0);
  gatling.add(gatlingBarrel5);
  const gatlingBarrel6 = new THREE.Mesh(cylinderGeo6, metalMat);
  gatlingBarrel6.name = 'gatlingBarrel';
  gatlingBarrel6.position.set(0.095, -0.1645, 0.85);
  gatlingBarrel6.rotation.set(deg(90), 0, 0);
  gatling.add(gatlingBarrel6);
  const barrelClamp = new THREE.Mesh(torusGeo, frameMat);
  barrelClamp.name = 'barrelClamp';
  barrelClamp.position.set(0, 0, 1.45);
  gatling.add(barrelClamp);
  const torus97 = new THREE.Mesh(torusGeo, frameMat);
  torus97.position.set(0, 0, 0.7);
  gatling.add(torus97);
  const missilePodL = new THREE.Group();
  missilePodL.name = 'missilePodL';
  missilePodL.position.set(1.05, 2.35, -0.55);
  torso.add(missilePodL);
  const podBox = new THREE.Mesh(boxGeo18, frameMat);
  podBox.name = 'podBox';
  missilePodL.add(podBox);
  const podFace = new THREE.Mesh(boxGeo19, accentMat);
  podFace.name = 'podFace';
  podFace.position.set(0, 0, 0.55);
  missilePodL.add(podFace);
  const cylinder101 = new THREE.Mesh(cylinderGeo7, frameMat);
  cylinder101.position.set(-0.27, -0.15, 0.61);
  cylinder101.rotation.set(deg(90), 0, 0);
  missilePodL.add(cylinder101);
  const missileTip = new THREE.Mesh(coneGeo, warnMat);
  missileTip.name = 'missileTip';
  missileTip.position.set(-0.27, -0.15, 0.62);
  missileTip.rotation.set(deg(90), 0, 0);
  missilePodL.add(missileTip);
  const cylinder103 = new THREE.Mesh(cylinderGeo7, frameMat);
  cylinder103.position.set(-0.27, 0.15, 0.61);
  cylinder103.rotation.set(deg(90), 0, 0);
  missilePodL.add(cylinder103);
  const missileTip2 = new THREE.Mesh(coneGeo, warnMat);
  missileTip2.name = 'missileTip';
  missileTip2.position.set(-0.27, 0.15, 0.62);
  missileTip2.rotation.set(deg(90), 0, 0);
  missilePodL.add(missileTip2);
  const cylinder105 = new THREE.Mesh(cylinderGeo7, frameMat);
  cylinder105.position.set(0, -0.15, 0.61);
  cylinder105.rotation.set(deg(90), 0, 0);
  missilePodL.add(cylinder105);
  const missileTip3 = new THREE.Mesh(coneGeo, warnMat);
  missileTip3.name = 'missileTip';
  missileTip3.position.set(0, -0.15, 0.62);
  missileTip3.rotation.set(deg(90), 0, 0);
  missilePodL.add(missileTip3);
  const cylinder107 = new THREE.Mesh(cylinderGeo7, frameMat);
  cylinder107.position.set(0, 0.15, 0.61);
  cylinder107.rotation.set(deg(90), 0, 0);
  missilePodL.add(cylinder107);
  const missileTip4 = new THREE.Mesh(coneGeo, warnMat);
  missileTip4.name = 'missileTip';
  missileTip4.position.set(0, 0.15, 0.62);
  missileTip4.rotation.set(deg(90), 0, 0);
  missilePodL.add(missileTip4);
  const cylinder109 = new THREE.Mesh(cylinderGeo7, frameMat);
  cylinder109.position.set(0.27, -0.15, 0.61);
  cylinder109.rotation.set(deg(90), 0, 0);
  missilePodL.add(cylinder109);
  const missileTip5 = new THREE.Mesh(coneGeo, warnMat);
  missileTip5.name = 'missileTip';
  missileTip5.position.set(0.27, -0.15, 0.62);
  missileTip5.rotation.set(deg(90), 0, 0);
  missilePodL.add(missileTip5);
  const cylinder111 = new THREE.Mesh(cylinderGeo7, frameMat);
  cylinder111.position.set(0.27, 0.15, 0.61);
  cylinder111.rotation.set(deg(90), 0, 0);
  missilePodL.add(cylinder111);
  const missileTip6 = new THREE.Mesh(coneGeo, warnMat);
  missileTip6.name = 'missileTip';
  missileTip6.position.set(0.27, 0.15, 0.62);
  missileTip6.rotation.set(deg(90), 0, 0);
  missilePodL.add(missileTip6);
  const missilePodR = new THREE.Group();
  missilePodR.name = 'missilePodR';
  missilePodR.position.set(-1.05, 2.35, -0.55);
  torso.add(missilePodR);
  const podBox2 = new THREE.Mesh(boxGeo18, frameMat);
  podBox2.name = 'podBox';
  missilePodR.add(podBox2);
  const podFace2 = new THREE.Mesh(boxGeo19, accentMat);
  podFace2.name = 'podFace';
  podFace2.position.set(0, 0, 0.55);
  missilePodR.add(podFace2);
  const cylinder116 = new THREE.Mesh(cylinderGeo7, frameMat);
  cylinder116.position.set(-0.27, -0.15, 0.61);
  cylinder116.rotation.set(deg(90), 0, 0);
  missilePodR.add(cylinder116);
  const missileTip7 = new THREE.Mesh(coneGeo, warnMat);
  missileTip7.name = 'missileTip';
  missileTip7.position.set(-0.27, -0.15, 0.62);
  missileTip7.rotation.set(deg(90), 0, 0);
  missilePodR.add(missileTip7);
  const cylinder118 = new THREE.Mesh(cylinderGeo7, frameMat);
  cylinder118.position.set(-0.27, 0.15, 0.61);
  cylinder118.rotation.set(deg(90), 0, 0);
  missilePodR.add(cylinder118);
  const missileTip8 = new THREE.Mesh(coneGeo, warnMat);
  missileTip8.name = 'missileTip';
  missileTip8.position.set(-0.27, 0.15, 0.62);
  missileTip8.rotation.set(deg(90), 0, 0);
  missilePodR.add(missileTip8);
  const cylinder120 = new THREE.Mesh(cylinderGeo7, frameMat);
  cylinder120.position.set(0, -0.15, 0.61);
  cylinder120.rotation.set(deg(90), 0, 0);
  missilePodR.add(cylinder120);
  const missileTip9 = new THREE.Mesh(coneGeo, warnMat);
  missileTip9.name = 'missileTip';
  missileTip9.position.set(0, -0.15, 0.62);
  missileTip9.rotation.set(deg(90), 0, 0);
  missilePodR.add(missileTip9);
  const cylinder122 = new THREE.Mesh(cylinderGeo7, frameMat);
  cylinder122.position.set(0, 0.15, 0.61);
  cylinder122.rotation.set(deg(90), 0, 0);
  missilePodR.add(cylinder122);
  const missileTip10 = new THREE.Mesh(coneGeo, warnMat);
  missileTip10.name = 'missileTip';
  missileTip10.position.set(0, 0.15, 0.62);
  missileTip10.rotation.set(deg(90), 0, 0);
  missilePodR.add(missileTip10);
  const cylinder124 = new THREE.Mesh(cylinderGeo7, frameMat);
  cylinder124.position.set(0.27, -0.15, 0.61);
  cylinder124.rotation.set(deg(90), 0, 0);
  missilePodR.add(cylinder124);
  const missileTip11 = new THREE.Mesh(coneGeo, warnMat);
  missileTip11.name = 'missileTip';
  missileTip11.position.set(0.27, -0.15, 0.62);
  missileTip11.rotation.set(deg(90), 0, 0);
  missilePodR.add(missileTip11);
  const cylinder126 = new THREE.Mesh(cylinderGeo7, frameMat);
  cylinder126.position.set(0.27, 0.15, 0.61);
  cylinder126.rotation.set(deg(90), 0, 0);
  missilePodR.add(cylinder126);
  const missileTip12 = new THREE.Mesh(coneGeo, warnMat);
  missileTip12.name = 'missileTip';
  missileTip12.position.set(0.27, 0.15, 0.62);
  missileTip12.rotation.set(deg(90), 0, 0);
  missilePodR.add(missileTip12);

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

export default createMech;

Оценки и комментарии

—
Оценок пока нет — будьте первым.
5
0
4
0
3
0
2
0
1
0

Войдите, чтобы ставить оценки и оставлять комментарии.

0 комментариев

Комментариев пока нет. Расскажите, как вы использовали эту модель или что можно улучшить.

Похожие модели

Та же категория или похожие теги