Codels
2328 三角面2.56 × 2.75 × 2.83 m

在代码中使用

在编辑器中改编
自包含的 ES 模块,仅依赖 three。调用工厂函数,然后把返回的 group 添加到场景中。
/**
 * Planetary Rover — Codels 3D model library
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 2,328 · Size (W × H × D): 2.56 × 2.75 × 2.83 m
 *
 * Usage:
 *   import { createRover } from './rover.js';
 *   
 *   const model = createRover();
 *   model.position.set(0, 0, 0);
 *   scene.add(model);
 */
import * as THREE from 'three';

const deg = THREE.MathUtils.degToRad;

export function createRover() {
  const root = new THREE.Group();
  root.name = 'Rover';

  // Materials
  const bodyMat = new THREE.MeshStandardMaterial({ name: 'body', color: 0xebe8e1, roughness: 0.5, metalness: 0.15, flatShading: true });
  const foilMat = new THREE.MeshStandardMaterial({ name: 'foil', color: 0xd6a43c, roughness: 0.3, metalness: 0.65, flatShading: true });
  const solarMat = new THREE.MeshStandardMaterial({ name: 'solar', color: 0x1f3358, roughness: 0.25, metalness: 0.45, flatShading: true });
  const darkMat = new THREE.MeshStandardMaterial({ name: 'dark', color: 0x2c2f34, roughness: 0.7, metalness: 0.2, flatShading: true });
  const metalMat = new THREE.MeshStandardMaterial({ name: 'metal', color: 0x9ba2ab, roughness: 0.35, metalness: 0.7, 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: 0x7dff9a, roughness: 0.4, emissive: 0x3dff6a, emissiveIntensity: 1.3, flatShading: true });

  // Shared geometries
  const cylinderGeo = new THREE.CylinderGeometry(0.26, 0.26, 0.34, 14);
  const cylinderGeo2 = new THREE.CylinderGeometry(0.1612, 0.1612, 0.36, 8);
  const cylinderGeo3 = new THREE.CylinderGeometry(0.065, 0.065, 0.4, 6);
  const boxGeo = new THREE.BoxGeometry(0.36, 0.05, 0.5304);
  const boxGeo2 = new THREE.BoxGeometry(0.09, 0.8698, 0.11);
  const boxGeo3 = new THREE.BoxGeometry(0.09, 0.6621, 0.11);
  const boxGeo4 = new THREE.BoxGeometry(0.08, 0.4903, 0.1);
  const boxGeo5 = new THREE.BoxGeometry(0.08, 0.4805, 0.1);
  const cylinderGeo4 = new THREE.CylinderGeometry(0.09, 0.09, 0.14, 8);
  const cylinderGeo5 = new THREE.CylinderGeometry(0.07, 0.07, 0.12, 8);
  const cylinderGeo6 = new THREE.CylinderGeometry(0.04, 0.04, 0.34, 6);
  const boxGeo6 = new THREE.BoxGeometry(0.1, 0.1, 0.12);
  const cylinderGeo7 = new THREE.CylinderGeometry(0.04, 0.04, 0.22, 6);
  const boxGeo7 = new THREE.BoxGeometry(0.04, 0.34, 1.5);
  const boxGeo8 = new THREE.BoxGeometry(0.12, 0.08, 0.06);
  const cylinderGeo8 = new THREE.CylinderGeometry(0.025, 0.025, 0.02, 6);
  const boxGeo9 = new THREE.BoxGeometry(0.56, 0.02, 0.66);
  const cylinderGeo9 = new THREE.CylinderGeometry(0.06, 0.06, 0.06, 10);
  const cylinderGeo10 = new THREE.CylinderGeometry(0.045, 0.045, 0.02, 10);
  const boxGeo10 = new THREE.BoxGeometry(0.06, 0.18, 0.06);

  // Parts
  const wheelFL = new THREE.Group();
  wheelFL.name = 'wheelFL';
  wheelFL.position.set(1.08, 0.26, 0.95);
  root.add(wheelFL);
  const tire = new THREE.Mesh(cylinderGeo, darkMat);
  tire.name = 'tire';
  tire.rotation.set(0, 0, deg(90));
  wheelFL.add(tire);
  const rim = new THREE.Mesh(cylinderGeo2, metalMat);
  rim.name = 'rim';
  rim.rotation.set(0, 0, deg(90));
  wheelFL.add(rim);
  const hubCap = new THREE.Mesh(cylinderGeo3, foilMat);
  hubCap.name = 'hubCap';
  hubCap.rotation.set(0, 0, deg(90));
  wheelFL.add(hubCap);
  const grouser = new THREE.Mesh(boxGeo, darkMat);
  grouser.name = 'grouser';
  wheelFL.add(grouser);
  const grouser2 = new THREE.Mesh(boxGeo, darkMat);
  grouser2.name = 'grouser';
  grouser2.rotation.set(deg(45), 0, 0);
  wheelFL.add(grouser2);
  const grouser3 = new THREE.Mesh(boxGeo, darkMat);
  grouser3.name = 'grouser';
  grouser3.rotation.set(deg(90), 0, 0);
  wheelFL.add(grouser3);
  const grouser4 = new THREE.Mesh(boxGeo, darkMat);
  grouser4.name = 'grouser';
  grouser4.rotation.set(deg(135), 0, 0);
  wheelFL.add(grouser4);
  const wheelML = new THREE.Group();
  wheelML.name = 'wheelML';
  wheelML.position.set(1.08, 0.26, 0);
  root.add(wheelML);
  const tire2 = new THREE.Mesh(cylinderGeo, darkMat);
  tire2.name = 'tire';
  tire2.rotation.set(0, 0, deg(90));
  wheelML.add(tire2);
  const rim2 = new THREE.Mesh(cylinderGeo2, metalMat);
  rim2.name = 'rim';
  rim2.rotation.set(0, 0, deg(90));
  wheelML.add(rim2);
  const hubCap2 = new THREE.Mesh(cylinderGeo3, foilMat);
  hubCap2.name = 'hubCap';
  hubCap2.rotation.set(0, 0, deg(90));
  wheelML.add(hubCap2);
  const grouser5 = new THREE.Mesh(boxGeo, darkMat);
  grouser5.name = 'grouser';
  wheelML.add(grouser5);
  const grouser6 = new THREE.Mesh(boxGeo, darkMat);
  grouser6.name = 'grouser';
  grouser6.rotation.set(deg(45), 0, 0);
  wheelML.add(grouser6);
  const grouser7 = new THREE.Mesh(boxGeo, darkMat);
  grouser7.name = 'grouser';
  grouser7.rotation.set(deg(90), 0, 0);
  wheelML.add(grouser7);
  const grouser8 = new THREE.Mesh(boxGeo, darkMat);
  grouser8.name = 'grouser';
  grouser8.rotation.set(deg(135), 0, 0);
  wheelML.add(grouser8);
  const wheelBL = new THREE.Group();
  wheelBL.name = 'wheelBL';
  wheelBL.position.set(1.08, 0.26, -0.95);
  root.add(wheelBL);
  const tire3 = new THREE.Mesh(cylinderGeo, darkMat);
  tire3.name = 'tire';
  tire3.rotation.set(0, 0, deg(90));
  wheelBL.add(tire3);
  const rim3 = new THREE.Mesh(cylinderGeo2, metalMat);
  rim3.name = 'rim';
  rim3.rotation.set(0, 0, deg(90));
  wheelBL.add(rim3);
  const hubCap3 = new THREE.Mesh(cylinderGeo3, foilMat);
  hubCap3.name = 'hubCap';
  hubCap3.rotation.set(0, 0, deg(90));
  wheelBL.add(hubCap3);
  const grouser9 = new THREE.Mesh(boxGeo, darkMat);
  grouser9.name = 'grouser';
  wheelBL.add(grouser9);
  const grouser10 = new THREE.Mesh(boxGeo, darkMat);
  grouser10.name = 'grouser';
  grouser10.rotation.set(deg(45), 0, 0);
  wheelBL.add(grouser10);
  const grouser11 = new THREE.Mesh(boxGeo, darkMat);
  grouser11.name = 'grouser';
  grouser11.rotation.set(deg(90), 0, 0);
  wheelBL.add(grouser11);
  const grouser12 = new THREE.Mesh(boxGeo, darkMat);
  grouser12.name = 'grouser';
  grouser12.rotation.set(deg(135), 0, 0);
  wheelBL.add(grouser12);
  const wheelFR = new THREE.Group();
  wheelFR.name = 'wheelFR';
  wheelFR.position.set(-1.08, 0.26, 0.95);
  root.add(wheelFR);
  const tire4 = new THREE.Mesh(cylinderGeo, darkMat);
  tire4.name = 'tire';
  tire4.rotation.set(0, 0, deg(90));
  wheelFR.add(tire4);
  const rim4 = new THREE.Mesh(cylinderGeo2, metalMat);
  rim4.name = 'rim';
  rim4.rotation.set(0, 0, deg(90));
  wheelFR.add(rim4);
  const hubCap4 = new THREE.Mesh(cylinderGeo3, foilMat);
  hubCap4.name = 'hubCap';
  hubCap4.rotation.set(0, 0, deg(90));
  wheelFR.add(hubCap4);
  const grouser13 = new THREE.Mesh(boxGeo, darkMat);
  grouser13.name = 'grouser';
  wheelFR.add(grouser13);
  const grouser14 = new THREE.Mesh(boxGeo, darkMat);
  grouser14.name = 'grouser';
  grouser14.rotation.set(deg(45), 0, 0);
  wheelFR.add(grouser14);
  const grouser15 = new THREE.Mesh(boxGeo, darkMat);
  grouser15.name = 'grouser';
  grouser15.rotation.set(deg(90), 0, 0);
  wheelFR.add(grouser15);
  const grouser16 = new THREE.Mesh(boxGeo, darkMat);
  grouser16.name = 'grouser';
  grouser16.rotation.set(deg(135), 0, 0);
  wheelFR.add(grouser16);
  const wheelMR = new THREE.Group();
  wheelMR.name = 'wheelMR';
  wheelMR.position.set(-1.08, 0.26, 0);
  root.add(wheelMR);
  const tire5 = new THREE.Mesh(cylinderGeo, darkMat);
  tire5.name = 'tire';
  tire5.rotation.set(0, 0, deg(90));
  wheelMR.add(tire5);
  const rim5 = new THREE.Mesh(cylinderGeo2, metalMat);
  rim5.name = 'rim';
  rim5.rotation.set(0, 0, deg(90));
  wheelMR.add(rim5);
  const hubCap5 = new THREE.Mesh(cylinderGeo3, foilMat);
  hubCap5.name = 'hubCap';
  hubCap5.rotation.set(0, 0, deg(90));
  wheelMR.add(hubCap5);
  const grouser17 = new THREE.Mesh(boxGeo, darkMat);
  grouser17.name = 'grouser';
  wheelMR.add(grouser17);
  const grouser18 = new THREE.Mesh(boxGeo, darkMat);
  grouser18.name = 'grouser';
  grouser18.rotation.set(deg(45), 0, 0);
  wheelMR.add(grouser18);
  const grouser19 = new THREE.Mesh(boxGeo, darkMat);
  grouser19.name = 'grouser';
  grouser19.rotation.set(deg(90), 0, 0);
  wheelMR.add(grouser19);
  const grouser20 = new THREE.Mesh(boxGeo, darkMat);
  grouser20.name = 'grouser';
  grouser20.rotation.set(deg(135), 0, 0);
  wheelMR.add(grouser20);
  const wheelBR = new THREE.Group();
  wheelBR.name = 'wheelBR';
  wheelBR.position.set(-1.08, 0.26, -0.95);
  root.add(wheelBR);
  const tire6 = new THREE.Mesh(cylinderGeo, darkMat);
  tire6.name = 'tire';
  tire6.rotation.set(0, 0, deg(90));
  wheelBR.add(tire6);
  const rim6 = new THREE.Mesh(cylinderGeo2, metalMat);
  rim6.name = 'rim';
  rim6.rotation.set(0, 0, deg(90));
  wheelBR.add(rim6);
  const hubCap6 = new THREE.Mesh(cylinderGeo3, foilMat);
  hubCap6.name = 'hubCap';
  hubCap6.rotation.set(0, 0, deg(90));
  wheelBR.add(hubCap6);
  const grouser21 = new THREE.Mesh(boxGeo, darkMat);
  grouser21.name = 'grouser';
  wheelBR.add(grouser21);
  const grouser22 = new THREE.Mesh(boxGeo, darkMat);
  grouser22.name = 'grouser';
  grouser22.rotation.set(deg(45), 0, 0);
  wheelBR.add(grouser22);
  const grouser23 = new THREE.Mesh(boxGeo, darkMat);
  grouser23.name = 'grouser';
  grouser23.rotation.set(deg(90), 0, 0);
  wheelBR.add(grouser23);
  const grouser24 = new THREE.Mesh(boxGeo, darkMat);
  grouser24.name = 'grouser';
  grouser24.rotation.set(deg(135), 0, 0);
  wheelBR.add(grouser24);
  const suspension = new THREE.Group();
  suspension.name = 'suspension';
  root.add(suspension);
  const rocker = new THREE.Mesh(boxGeo2, metalMat);
  rocker.name = 'rocker';
  rocker.position.set(0.86, 0.73, 0.535);
  rocker.rotation.set(deg(-72.6067), 0, deg(-180));
  suspension.add(rocker);
  const rocker2 = new THREE.Mesh(boxGeo3, metalMat);
  rocker2.name = 'rocker';
  rocker2.position.set(0.86, 0.72, -0.18);
  rocker2.rotation.set(deg(-115.0169), 0, 0);
  suspension.add(rocker2);
  const bogie = new THREE.Mesh(boxGeo4, metalMat);
  bogie.name = 'bogie';
  bogie.position.set(0.86, 0.53, -0.24);
  bogie.rotation.set(deg(-78.2317), 0, deg(-180));
  suspension.add(bogie);
  const bogie2 = new THREE.Mesh(boxGeo5, metalMat);
  bogie2.name = 'bogie';
  bogie2.position.set(0.86, 0.53, -0.715);
  bogie2.rotation.set(deg(-102.0115), 0, 0);
  suspension.add(bogie2);
  const rockerPivot = new THREE.Mesh(cylinderGeo4, foilMat);
  rockerPivot.name = 'rockerPivot';
  rockerPivot.position.set(0.86, 0.86, 0.12);
  rockerPivot.rotation.set(0, 0, deg(90));
  suspension.add(rockerPivot);
  const bogiePivot = new THREE.Mesh(cylinderGeo5, foilMat);
  bogiePivot.name = 'bogiePivot';
  bogiePivot.position.set(0.86, 0.58, -0.48);
  bogiePivot.rotation.set(0, 0, deg(90));
  suspension.add(bogiePivot);
  const wheelFork = new THREE.Mesh(cylinderGeo6, metalMat);
  wheelFork.name = 'wheelFork';
  wheelFork.position.set(0.86, 0.43, 0.95);
  wheelFork.rotation.set(0, 0, deg(180));
  suspension.add(wheelFork);
  const wheelMotor = new THREE.Mesh(boxGeo6, metalMat);
  wheelMotor.name = 'wheelMotor';
  wheelMotor.position.set(0.92, 0.26, 0.95);
  suspension.add(wheelMotor);
  const wheelFork2 = new THREE.Mesh(cylinderGeo7, metalMat);
  wheelFork2.name = 'wheelFork';
  wheelFork2.position.set(0.86, 0.37, 0);
  wheelFork2.rotation.set(0, 0, deg(180));
  suspension.add(wheelFork2);
  const wheelMotor2 = new THREE.Mesh(boxGeo6, metalMat);
  wheelMotor2.name = 'wheelMotor';
  wheelMotor2.position.set(0.92, 0.26, 0);
  suspension.add(wheelMotor2);
  const wheelFork3 = new THREE.Mesh(cylinderGeo7, metalMat);
  wheelFork3.name = 'wheelFork';
  wheelFork3.position.set(0.86, 0.37, -0.95);
  wheelFork3.rotation.set(0, 0, deg(180));
  suspension.add(wheelFork3);
  const wheelMotor3 = new THREE.Mesh(boxGeo6, metalMat);
  wheelMotor3.name = 'wheelMotor';
  wheelMotor3.position.set(0.92, 0.26, -0.95);
  suspension.add(wheelMotor3);
  const rocker3 = new THREE.Mesh(boxGeo2, metalMat);
  rocker3.name = 'rocker';
  rocker3.position.set(-0.86, 0.73, 0.535);
  rocker3.rotation.set(deg(-72.6067), 0, deg(-180));
  suspension.add(rocker3);
  const rocker4 = new THREE.Mesh(boxGeo3, metalMat);
  rocker4.name = 'rocker';
  rocker4.position.set(-0.86, 0.72, -0.18);
  rocker4.rotation.set(deg(-115.0169), 0, 0);
  suspension.add(rocker4);
  const bogie3 = new THREE.Mesh(boxGeo4, metalMat);
  bogie3.name = 'bogie';
  bogie3.position.set(-0.86, 0.53, -0.24);
  bogie3.rotation.set(deg(-78.2317), 0, deg(-180));
  suspension.add(bogie3);
  const bogie4 = new THREE.Mesh(boxGeo5, metalMat);
  bogie4.name = 'bogie';
  bogie4.position.set(-0.86, 0.53, -0.715);
  bogie4.rotation.set(deg(-102.0115), 0, 0);
  suspension.add(bogie4);
  const rockerPivot2 = new THREE.Mesh(cylinderGeo4, foilMat);
  rockerPivot2.name = 'rockerPivot';
  rockerPivot2.position.set(-0.86, 0.86, 0.12);
  rockerPivot2.rotation.set(0, 0, deg(90));
  suspension.add(rockerPivot2);
  const bogiePivot2 = new THREE.Mesh(cylinderGeo5, foilMat);
  bogiePivot2.name = 'bogiePivot';
  bogiePivot2.position.set(-0.86, 0.58, -0.48);
  bogiePivot2.rotation.set(0, 0, deg(90));
  suspension.add(bogiePivot2);
  const wheelFork4 = new THREE.Mesh(cylinderGeo6, metalMat);
  wheelFork4.name = 'wheelFork';
  wheelFork4.position.set(-0.86, 0.43, 0.95);
  wheelFork4.rotation.set(0, 0, deg(180));
  suspension.add(wheelFork4);
  const wheelMotor4 = new THREE.Mesh(boxGeo6, metalMat);
  wheelMotor4.name = 'wheelMotor';
  wheelMotor4.position.set(-0.92, 0.26, 0.95);
  suspension.add(wheelMotor4);
  const wheelFork5 = new THREE.Mesh(cylinderGeo7, metalMat);
  wheelFork5.name = 'wheelFork';
  wheelFork5.position.set(-0.86, 0.37, 0);
  wheelFork5.rotation.set(0, 0, deg(180));
  suspension.add(wheelFork5);
  const wheelMotor5 = new THREE.Mesh(boxGeo6, metalMat);
  wheelMotor5.name = 'wheelMotor';
  wheelMotor5.position.set(-0.92, 0.26, 0);
  suspension.add(wheelMotor5);
  const wheelFork6 = new THREE.Mesh(cylinderGeo7, metalMat);
  wheelFork6.name = 'wheelFork';
  wheelFork6.position.set(-0.86, 0.37, -0.95);
  wheelFork6.rotation.set(0, 0, deg(180));
  suspension.add(wheelFork6);
  const wheelMotor6 = new THREE.Mesh(boxGeo6, metalMat);
  wheelMotor6.name = 'wheelMotor';
  wheelMotor6.position.set(-0.92, 0.26, -0.95);
  suspension.add(wheelMotor6);
  const differentialBar = new THREE.Mesh(new THREE.BoxGeometry(1.72, 0.06, 0.08), metalMat);
  differentialBar.name = 'differentialBar';
  differentialBar.position.set(0, 0.82, -0.75);
  suspension.add(differentialBar);
  const body = new THREE.Group();
  body.name = 'body';
  root.add(body);
  const electronicsBox = new THREE.Mesh(new THREE.BoxGeometry(1.5, 0.5, 1.85), bodyMat);
  electronicsBox.name = 'electronicsBox';
  electronicsBox.position.set(0, 1.03, 0);
  body.add(electronicsBox);
  const foilPanel = new THREE.Mesh(boxGeo7, foilMat);
  foilPanel.name = 'foilPanel';
  foilPanel.position.set(0.76, 1.03, 0);
  body.add(foilPanel);
  const foilPanel2 = new THREE.Mesh(boxGeo7, foilMat);
  foilPanel2.name = 'foilPanel';
  foilPanel2.position.set(-0.76, 1.03, 0);
  body.add(foilPanel2);
  const foilPanelBack = new THREE.Mesh(new THREE.BoxGeometry(1.1, 0.34, 0.04), foilMat);
  foilPanelBack.name = 'foilPanelBack';
  foilPanelBack.position.set(0, 1.03, -0.94);
  body.add(foilPanelBack);
  const bellyPan = new THREE.Mesh(new THREE.BoxGeometry(1.3, 0.08, 1.6), darkMat);
  bellyPan.name = 'bellyPan';
  bellyPan.position.set(0, 0.74, 0);
  body.add(bellyPan);
  const hazcam = new THREE.Mesh(boxGeo8, darkMat);
  hazcam.name = 'hazcam';
  hazcam.position.set(-0.25, 0.88, 0.93);
  body.add(hazcam);
  const cylinder82 = new THREE.Mesh(cylinderGeo8, glassMat);
  cylinder82.position.set(-0.25, 0.88, 0.965);
  cylinder82.rotation.set(deg(90), 0, 0);
  body.add(cylinder82);
  const hazcam2 = new THREE.Mesh(boxGeo8, darkMat);
  hazcam2.name = 'hazcam';
  hazcam2.position.set(0.25, 0.88, 0.93);
  body.add(hazcam2);
  const cylinder84 = new THREE.Mesh(cylinderGeo8, glassMat);
  cylinder84.position.set(0.25, 0.88, 0.965);
  cylinder84.rotation.set(deg(90), 0, 0);
  body.add(cylinder84);
  const hazcam3 = new THREE.Mesh(boxGeo8, darkMat);
  hazcam3.name = 'hazcam';
  hazcam3.position.set(-0.25, 0.88, -0.93);
  body.add(hazcam3);
  const cylinder86 = new THREE.Mesh(cylinderGeo8, glassMat);
  cylinder86.position.set(-0.25, 0.88, -0.965);
  cylinder86.rotation.set(deg(90), 0, 0);
  body.add(cylinder86);
  const hazcam4 = new THREE.Mesh(boxGeo8, darkMat);
  hazcam4.name = 'hazcam';
  hazcam4.position.set(0.25, 0.88, -0.93);
  body.add(hazcam4);
  const cylinder88 = new THREE.Mesh(cylinderGeo8, glassMat);
  cylinder88.position.set(0.25, 0.88, -0.965);
  cylinder88.rotation.set(deg(90), 0, 0);
  body.add(cylinder88);
  const statusLight = new THREE.Mesh(new THREE.SphereGeometry(0.03, 6, 4), glowMat);
  statusLight.name = 'statusLight';
  statusLight.position.set(0.6, 1.2, 0.93);
  body.add(statusLight);
  const solarPanel = new THREE.Group();
  solarPanel.name = 'solarPanel';
  root.add(solarPanel);
  const panelFrame = new THREE.Mesh(new THREE.BoxGeometry(2.5, 0.05, 2.25), bodyMat);
  panelFrame.name = 'panelFrame';
  panelFrame.position.set(0, 1.34, -0.05);
  solarPanel.add(panelFrame);
  const solarCells = new THREE.Mesh(boxGeo9, solarMat);
  solarCells.name = 'solarCells';
  solarCells.position.set(-0.9, 1.37, -0.75);
  solarPanel.add(solarCells);
  const solarCells2 = new THREE.Mesh(boxGeo9, solarMat);
  solarCells2.name = 'solarCells';
  solarCells2.position.set(-0.9, 1.37, -0.05);
  solarPanel.add(solarCells2);
  const solarCells3 = new THREE.Mesh(boxGeo9, solarMat);
  solarCells3.name = 'solarCells';
  solarCells3.position.set(-0.3, 1.37, -0.75);
  solarPanel.add(solarCells3);
  const solarCells4 = new THREE.Mesh(boxGeo9, solarMat);
  solarCells4.name = 'solarCells';
  solarCells4.position.set(-0.3, 1.37, -0.05);
  solarPanel.add(solarCells4);
  const solarCells5 = new THREE.Mesh(boxGeo9, solarMat);
  solarCells5.name = 'solarCells';
  solarCells5.position.set(-0.3, 1.37, 0.65);
  solarPanel.add(solarCells5);
  const solarCells6 = new THREE.Mesh(boxGeo9, solarMat);
  solarCells6.name = 'solarCells';
  solarCells6.position.set(0.3, 1.37, -0.75);
  solarPanel.add(solarCells6);
  const solarCells7 = new THREE.Mesh(boxGeo9, solarMat);
  solarCells7.name = 'solarCells';
  solarCells7.position.set(0.3, 1.37, -0.05);
  solarPanel.add(solarCells7);
  const solarCells8 = new THREE.Mesh(boxGeo9, solarMat);
  solarCells8.name = 'solarCells';
  solarCells8.position.set(0.3, 1.37, 0.65);
  solarPanel.add(solarCells8);
  const solarCells9 = new THREE.Mesh(boxGeo9, solarMat);
  solarCells9.name = 'solarCells';
  solarCells9.position.set(0.9, 1.37, -0.75);
  solarPanel.add(solarCells9);
  const solarCells10 = new THREE.Mesh(boxGeo9, solarMat);
  solarCells10.name = 'solarCells';
  solarCells10.position.set(0.9, 1.37, -0.05);
  solarPanel.add(solarCells10);
  const solarCells11 = new THREE.Mesh(boxGeo9, solarMat);
  solarCells11.name = 'solarCells';
  solarCells11.position.set(0.9, 1.37, 0.65);
  solarPanel.add(solarCells11);
  const panelMount = new THREE.Mesh(new THREE.CylinderGeometry(0.04, 0.04, 0.06, 6), metalMat);
  panelMount.name = 'panelMount';
  panelMount.position.set(0, 1.31, 0);
  solarPanel.add(panelMount);
  const mast = new THREE.Group();
  mast.name = 'mast';
  mast.position.set(-0.9, 1.37, 0.68);
  mast.rotation.set(0, deg(20), 0);
  root.add(mast);
  const mastPole = new THREE.Mesh(new THREE.CylinderGeometry(0.05, 0.06, 1.1, 8), metalMat);
  mastPole.name = 'mastPole';
  mastPole.position.set(0, 0.55, 0);
  mast.add(mastPole);
  const cameraHead = new THREE.Group();
  cameraHead.name = 'cameraHead';
  cameraHead.position.set(0, 1.2, 0);
  cameraHead.rotation.set(deg(-8), 0, 0);
  mast.add(cameraHead);
  const headBox = new THREE.Mesh(new THREE.BoxGeometry(0.42, 0.22, 0.24), bodyMat);
  headBox.name = 'headBox';
  cameraHead.add(headBox);
  const headCap = new THREE.Mesh(new THREE.BoxGeometry(0.44, 0.06, 0.26), foilMat);
  headCap.name = 'headCap';
  headCap.position.set(0, 0.13, 0);
  cameraHead.add(headCap);
  const lensBarrel = new THREE.Mesh(cylinderGeo9, darkMat);
  lensBarrel.name = 'lensBarrel';
  lensBarrel.position.set(-0.12, 0, 0.14);
  lensBarrel.rotation.set(deg(90), 0, 0);
  cameraHead.add(lensBarrel);
  const lens = new THREE.Mesh(cylinderGeo10, glassMat);
  lens.name = 'lens';
  lens.position.set(-0.12, 0, 0.18);
  lens.rotation.set(deg(90), 0, 0);
  cameraHead.add(lens);
  const lensBarrel2 = new THREE.Mesh(cylinderGeo9, darkMat);
  lensBarrel2.name = 'lensBarrel';
  lensBarrel2.position.set(0.12, 0, 0.14);
  lensBarrel2.rotation.set(deg(90), 0, 0);
  cameraHead.add(lensBarrel2);
  const lens2 = new THREE.Mesh(cylinderGeo10, glassMat);
  lens2.name = 'lens';
  lens2.position.set(0.12, 0, 0.18);
  lens2.rotation.set(deg(90), 0, 0);
  cameraHead.add(lens2);
  const laserEye = new THREE.Mesh(new THREE.BoxGeometry(0.08, 0.06, 0.04), glowMat);
  laserEye.name = 'laserEye';
  laserEye.position.set(0, -0.06, 0.13);
  cameraHead.add(laserEye);
  const antenna = new THREE.Group();
  antenna.name = 'antenna';
  antenna.position.set(0.8, 1.37, -0.75);
  root.add(antenna);
  const antennaPost = new THREE.Mesh(new THREE.CylinderGeometry(0.04, 0.04, 0.3, 6), metalMat);
  antennaPost.name = 'antennaPost';
  antennaPost.position.set(0, 0.15, 0);
  antenna.add(antennaPost);
  const highGainDish = new THREE.Mesh(new THREE.CylinderGeometry(0.24, 0.24, 0.03, 12), bodyMat);
  highGainDish.name = 'highGainDish';
  highGainDish.position.set(0, 0.36, 0);
  highGainDish.rotation.set(deg(60), 0, 0);
  antenna.add(highGainDish);
  const dishFeed = new THREE.Mesh(new THREE.CylinderGeometry(0.02, 0.02, 0.18, 4), metalMat);
  dishFeed.name = 'dishFeed';
  dishFeed.position.set(0, 0.44, 0.05);
  dishFeed.rotation.set(deg(60), 0, 0);
  antenna.add(dishFeed);
  const uhfAntenna = new THREE.Mesh(new THREE.CylinderGeometry(0.02, 0.02, 0.5, 4), metalMat);
  uhfAntenna.name = 'uhfAntenna';
  uhfAntenna.position.set(-0.95, 1.62, -0.9);
  root.add(uhfAntenna);
  const roboticArm = new THREE.Group();
  roboticArm.name = 'roboticArm';
  roboticArm.position.set(0.45, 1.08, 0.98);
  root.add(roboticArm);
  const shoulder = new THREE.Mesh(new THREE.BoxGeometry(0.18, 0.18, 0.18), metalMat);
  shoulder.name = 'shoulder';
  roboticArm.add(shoulder);
  const upperArm = new THREE.Mesh(new THREE.CylinderGeometry(0.05, 0.05, 0.6366, 6), metalMat);
  upperArm.name = 'upperArm';
  upperArm.position.set(-0.275, -0.01, 0.16);
  upperArm.rotation.set(deg(34.2168), deg(26.6366), deg(75.1273));
  roboticArm.add(upperArm);
  const elbow = new THREE.Mesh(new THREE.SphereGeometry(0.07, 6, 4), foilMat);
  elbow.name = 'elbow';
  elbow.position.set(-0.55, -0.02, 0.32);
  roboticArm.add(elbow);
  const forearm = new THREE.Mesh(new THREE.CylinderGeometry(0.045, 0.045, 0.7091, 6), metalMat);
  forearm.name = 'forearm';
  forearm.position.set(-0.2, -0.06, 0.36);
  forearm.rotation.set(deg(6.5299), deg(-7.2119), deg(-95.6965));
  roboticArm.add(forearm);
  const turret = new THREE.Group();
  turret.name = 'turret';
  turret.position.set(0.15, -0.1, 0.4);
  roboticArm.add(turret);
  const toolTurret = new THREE.Mesh(new THREE.CylinderGeometry(0.12, 0.12, 0.12, 8), foilMat);
  toolTurret.name = 'toolTurret';
  toolTurret.rotation.set(0, 0, deg(90));
  turret.add(toolTurret);
  const tool = new THREE.Mesh(boxGeo10, metalMat);
  tool.name = 'tool';
  tool.position.set(0, 0.14, 0);
  turret.add(tool);
  const tool2 = new THREE.Mesh(boxGeo10, darkMat);
  tool2.name = 'tool';
  tool2.position.set(0, 0, 0.14);
  tool2.rotation.set(deg(90), 0, 0);
  turret.add(tool2);
  const tool3 = new THREE.Mesh(boxGeo10, metalMat);
  tool3.name = 'tool';
  tool3.position.set(0, -0.14, 0);
  tool3.rotation.set(deg(180), 0, 0);
  turret.add(tool3);
  const tool4 = new THREE.Mesh(boxGeo10, darkMat);
  tool4.name = 'tool';
  tool4.position.set(0, 0, -0.14);
  tool4.rotation.set(deg(270), 0, 0);
  turret.add(tool4);

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

export default createRover;

评分与评论

—
暂无评分,快来抢先评分吧。
5
0
4
0
3
0
2
0
1
0

登录后即可评分和评论。

0 条评论

暂无评论。分享一下你是如何使用这个模型的,或者有哪些可以改进的地方。

相关模型

同一分类或相似标签