삼각형 3.3천개1.97 × 2.26 × 4.73 m
코드에서 사용하기
에디터에서 리믹스wagon.js · 604줄
독립형 ES 모듈이에요 — three에만 의존해요. 팩토리 함수를 호출하고 그룹을 씬에 추가하세요.
/**
* Covered Wagon — Codels 3D model library
* License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
* Triangles: 3,316 · Size (W × H × D): 1.97 × 2.26 × 4.73 m
*
* Usage:
* import { createWagon } from './wagon.js';
*
* const model = createWagon();
* model.position.set(0, 0, 0);
* scene.add(model);
*/
import * as THREE from 'three';
const deg = THREE.MathUtils.degToRad;
// Revolve a 2D profile [[radius, y], ...] around the Y axis.
function lathe(points, segments, phiStart = 0, phiLength = Math.PI * 2) {
return new THREE.LatheGeometry(points.map(([x, y]) => new THREE.Vector2(x, y)), segments, phiStart, phiLength);
}
// 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 createWagon() {
const root = new THREE.Group();
root.name = 'Wagon';
// Materials
const woodMat = new THREE.MeshStandardMaterial({ name: 'wood', color: 0x9b6b3f, roughness: 0.9, flatShading: true });
const woodDarkMat = new THREE.MeshStandardMaterial({ name: 'woodDark', color: 0x6d4b2c, roughness: 0.9, flatShading: true });
const woodLightMat = new THREE.MeshStandardMaterial({ name: 'woodLight', color: 0xa77d56, roughness: 0.9, flatShading: true });
const canvasMat = new THREE.MeshStandardMaterial({ name: 'canvas', color: 0xece2c8, roughness: 0.95, flatShading: true, side: THREE.DoubleSide });
const ironMat = new THREE.MeshStandardMaterial({ name: 'iron', color: 0x3a3b3f, roughness: 0.6, metalness: 0.5, flatShading: true });
const sackMat = new THREE.MeshStandardMaterial({ name: 'sack', color: 0xc4a676, roughness: 1, flatShading: true });
// Shared geometries
const boxGeo = new THREE.BoxGeometry(0.04, 0.1387, 2.8);
const boxGeo2 = new THREE.BoxGeometry(1.2, 0.1387, 0.04);
const boxGeo3 = new THREE.BoxGeometry(0.012, 0.46, 0.05);
const boxGeo4 = new THREE.BoxGeometry(0.06, 0.06, 2.9);
const boxGeo5 = new THREE.BoxGeometry(1.5, 0.1, 0.12);
const boxGeo6 = new THREE.BoxGeometry(1.22, 0.12, 0.16);
const boxGeo7 = new THREE.BoxGeometry(0.06, 0.9453, 0.06);
const boxGeo8 = new THREE.BoxGeometry(0.04, 0.04, 0.12);
const boxGeo9 = new THREE.BoxGeometry(0.06, 0.32, 0.36);
const boxGeo10 = new THREE.BoxGeometry(0.1, 0.16, 0.05);
const cylinderGeo = new THREE.CylinderGeometry(0.158, 0.158, 0.03, 10);
const extrudeGeo = extrude([[0.66, 0], [0.6375, 0.1708], [0.5716, 0.33], [0.4667, 0.4667], [0.33, 0.5716], [0.1708, 0.6375], [0, 0.66], [-0.1708, 0.6375], [-0.33, 0.5716], [-0.4667, 0.4667], [-0.5716, 0.33], [-0.6375, 0.1708], [-0.66, 0], [-0.36, 0], [-0.3477, 0.1035], [-0.3118, 0.2], [-0.2546, 0.2828], [-0.18, 0.3464], [-0.0932, 0.3864], [0, 0.4], [0.0932, 0.3864], [0.18, 0.3464], [0.2546, 0.2828], [0.3118, 0.2], [0.3477, 0.1035], [0.36, 0]], 0.05);
const torusGeo = new THREE.TorusGeometry(0.652, 0.016, 3, 14, Math.PI);
const boxGeo11 = new THREE.BoxGeometry(0.03, 0.03, 2.39);
const latheGeo = lathe([[0.455, -0.045], [0.48, -0.045], [0.48, 0.045], [0.455, 0.045], [0.455, -0.045]], 16);
const latheGeo2 = lathe([[0.395, -0.0378], [0.455, -0.0378], [0.455, 0.0378], [0.395, 0.0378], [0.395, -0.0378]], 16);
const cylinderGeo2 = new THREE.CylinderGeometry(0.085, 0.1, 0.24, 10);
const cylinderGeo3 = new THREE.CylinderGeometry(0.06, 0.06, 0.05, 8);
const boxGeo12 = new THREE.BoxGeometry(0.032, 0.35, 0.04);
const latheGeo3 = lathe([[0.595, -0.045], [0.62, -0.045], [0.62, 0.045], [0.595, 0.045], [0.595, -0.045]], 16);
const latheGeo4 = lathe([[0.535, -0.0378], [0.595, -0.0378], [0.595, 0.0378], [0.535, 0.0378], [0.535, -0.0378]], 16);
const boxGeo13 = new THREE.BoxGeometry(0.032, 0.49, 0.04);
// Parts
const body = new THREE.Group();
body.name = 'body';
root.add(body);
const floor = new THREE.Mesh(new THREE.BoxGeometry(1.12, 0.06, 2.8), woodDarkMat);
floor.name = 'floor';
floor.position.set(0, 0.95, -0.05);
body.add(floor);
const box3 = new THREE.Mesh(boxGeo, woodMat);
box3.position.set(0.58, 1.0533, -0.05);
body.add(box3);
const box4 = new THREE.Mesh(boxGeo, woodMat);
box4.position.set(-0.58, 1.0533, -0.05);
body.add(box4);
const box5 = new THREE.Mesh(boxGeo2, woodMat);
box5.position.set(0, 1.0533, 1.37);
body.add(box5);
const box6 = new THREE.Mesh(boxGeo2, woodMat);
box6.position.set(0, 1.0533, -1.47);
body.add(box6);
const box7 = new THREE.Mesh(boxGeo, woodLightMat);
box7.position.set(0.58, 1.2, -0.05);
body.add(box7);
const box8 = new THREE.Mesh(boxGeo, woodLightMat);
box8.position.set(-0.58, 1.2, -0.05);
body.add(box8);
const box9 = new THREE.Mesh(boxGeo2, woodLightMat);
box9.position.set(0, 1.2, 1.37);
body.add(box9);
const box10 = new THREE.Mesh(boxGeo2, woodLightMat);
box10.position.set(0, 1.2, -1.47);
body.add(box10);
const sideTopL = new THREE.Mesh(boxGeo, woodMat);
sideTopL.name = 'sideTopL';
sideTopL.position.set(0.58, 1.3467, -0.05);
body.add(sideTopL);
const sideTopR = new THREE.Mesh(boxGeo, woodMat);
sideTopR.name = 'sideTopR';
sideTopR.position.set(-0.58, 1.3467, -0.05);
body.add(sideTopR);
const box13 = new THREE.Mesh(boxGeo2, woodMat);
box13.position.set(0, 1.3467, 1.37);
body.add(box13);
const box14 = new THREE.Mesh(boxGeo2, woodMat);
box14.position.set(0, 1.3467, -1.47);
body.add(box14);
const box15 = new THREE.Mesh(boxGeo3, ironMat);
box15.position.set(0.606, 1.2, -1.33);
body.add(box15);
const box16 = new THREE.Mesh(boxGeo3, ironMat);
box16.position.set(0.606, 1.2, -0.69);
body.add(box16);
const box17 = new THREE.Mesh(boxGeo3, ironMat);
box17.position.set(0.606, 1.2, -0.05);
body.add(box17);
const box18 = new THREE.Mesh(boxGeo3, ironMat);
box18.position.set(0.606, 1.2, 0.59);
body.add(box18);
const box19 = new THREE.Mesh(boxGeo3, ironMat);
box19.position.set(0.606, 1.2, 1.23);
body.add(box19);
const railL = new THREE.Mesh(boxGeo4, woodDarkMat);
railL.name = 'railL';
railL.position.set(0.58, 1.45, -0.05);
body.add(railL);
const box21 = new THREE.Mesh(boxGeo3, ironMat);
box21.position.set(-0.606, 1.2, -1.33);
body.add(box21);
const box22 = new THREE.Mesh(boxGeo3, ironMat);
box22.position.set(-0.606, 1.2, -0.69);
body.add(box22);
const box23 = new THREE.Mesh(boxGeo3, ironMat);
box23.position.set(-0.606, 1.2, -0.05);
body.add(box23);
const box24 = new THREE.Mesh(boxGeo3, ironMat);
box24.position.set(-0.606, 1.2, 0.59);
body.add(box24);
const box25 = new THREE.Mesh(boxGeo3, ironMat);
box25.position.set(-0.606, 1.2, 1.23);
body.add(box25);
const railR = new THREE.Mesh(boxGeo4, woodDarkMat);
railR.name = 'railR';
railR.position.set(-0.58, 1.45, -0.05);
body.add(railR);
const frontAxle = new THREE.Mesh(boxGeo5, woodDarkMat);
frontAxle.name = 'frontAxle';
frontAxle.position.set(0, 0.48, 0.95);
body.add(frontAxle);
const rearAxle = new THREE.Mesh(boxGeo5, woodDarkMat);
rearAxle.name = 'rearAxle';
rearAxle.position.set(0, 0.62, -0.95);
body.add(rearAxle);
const frontBolster = new THREE.Mesh(boxGeo6, woodDarkMat);
frontBolster.name = 'frontBolster';
frontBolster.position.set(0, 0.86, 0.95);
body.add(frontBolster);
const rearBolster = new THREE.Mesh(boxGeo6, woodDarkMat);
rearBolster.name = 'rearBolster';
rearBolster.position.set(0, 0.86, -0.95);
body.add(rearBolster);
const box31 = new THREE.Mesh(new THREE.BoxGeometry(0.3, 0.27, 0.26), woodMat);
box31.position.set(0, 0.665, 0.95);
body.add(box31);
const box32 = new THREE.Mesh(new THREE.BoxGeometry(0.3, 0.13, 0.26), woodMat);
box32.position.set(0, 0.735, -0.95);
body.add(box32);
const reachPole = new THREE.Mesh(new THREE.BoxGeometry(0.09, 2.2544, 0.09), woodDarkMat);
reachPole.name = 'reachPole';
reachPole.position.set(0, 0.57, -0.175);
reachPole.rotation.set(deg(-86.4395), 0, 0);
body.add(reachPole);
const tongue = new THREE.Mesh(new THREE.BoxGeometry(0.09, 2.1887, 0.1), woodMat);
tongue.name = 'tongue';
tongue.position.set(0, 0.275, 2.075);
tongue.rotation.set(deg(-79.2035), 0, deg(-180));
body.add(tongue);
const box35 = new THREE.Mesh(boxGeo7, woodDarkMat);
box35.position.set(0.25, 0.45, 1.35);
box35.rotation.set(deg(-86.9129), deg(-1.9278), deg(148.0466));
body.add(box35);
const box36 = new THREE.Mesh(boxGeo7, woodDarkMat);
box36.position.set(-0.25, 0.45, 1.35);
box36.rotation.set(deg(-86.9129), deg(1.9278), deg(-148.0466));
body.add(box36);
const singletree = new THREE.Mesh(new THREE.BoxGeometry(1, 0.07, 0.07), woodDarkMat);
singletree.name = 'singletree';
singletree.position.set(0, 0.27, 2.6);
singletree.rotation.set(deg(-11), 0, 0);
body.add(singletree);
const box38 = new THREE.Mesh(boxGeo8, ironMat);
box38.position.set(0.48, 0.27, 2.6);
body.add(box38);
const box39 = new THREE.Mesh(boxGeo8, ironMat);
box39.position.set(-0.48, 0.27, 2.6);
body.add(box39);
const neckYoke = new THREE.Mesh(new THREE.BoxGeometry(0.6, 0.06, 0.06), woodDarkMat);
neckYoke.name = 'neckYoke';
neckYoke.position.set(0, 0.11, 3.08);
neckYoke.rotation.set(deg(-11), 0, 0);
body.add(neckYoke);
const box41 = new THREE.Mesh(boxGeo9, woodDarkMat);
box41.position.set(0.5, 1.58, 1.14);
body.add(box41);
const box42 = new THREE.Mesh(boxGeo9, woodDarkMat);
box42.position.set(-0.5, 1.58, 1.14);
body.add(box42);
const bench = new THREE.Mesh(new THREE.BoxGeometry(1.14, 0.06, 0.42), woodMat);
bench.name = 'bench';
bench.position.set(0, 1.77, 1.14);
body.add(bench);
const backrest = new THREE.Mesh(new THREE.BoxGeometry(1.14, 0.22, 0.05), woodLightMat);
backrest.name = 'backrest';
backrest.position.set(0, 1.92, 0.94);
backrest.rotation.set(deg(-12), 0, 0);
body.add(backrest);
const footboard = new THREE.Mesh(new THREE.BoxGeometry(1.1, 0.04, 0.32), woodMat);
footboard.name = 'footboard';
footboard.position.set(0, 1.1, 1.51);
footboard.rotation.set(deg(38), 0, 0);
body.add(footboard);
const brakeLever = new THREE.Mesh(new THREE.BoxGeometry(0.04, 0.8707, 0.04), ironMat);
brakeLever.name = 'brakeLever';
brakeLever.position.set(0.69, 1.505, 1.08);
brakeLever.rotation.set(deg(-165.3311), deg(-31.1583), deg(-172.2869));
body.add(brakeLever);
const brakeBeam = new THREE.Mesh(new THREE.BoxGeometry(1.64, 0.06, 0.07), woodDarkMat);
brakeBeam.name = 'brakeBeam';
brakeBeam.position.set(0, 0.6, -0.27);
body.add(brakeBeam);
const box48 = new THREE.Mesh(boxGeo10, ironMat);
box48.position.set(0.8, 0.6, -0.3);
body.add(box48);
const box49 = new THREE.Mesh(boxGeo10, ironMat);
box49.position.set(-0.8, 0.6, -0.3);
body.add(box49);
const box50 = new THREE.Mesh(new THREE.BoxGeometry(0.26, 0.04, 0.4), woodDarkMat);
box50.position.set(0.73, 0.88, 0.08);
body.add(box50);
const waterBarrel = new THREE.Mesh(new THREE.CylinderGeometry(0.15, 0.15, 0.42, 10), woodMat);
waterBarrel.name = 'waterBarrel';
waterBarrel.position.set(0.76, 1.11, 0.08);
body.add(waterBarrel);
const cylinder52 = new THREE.Mesh(cylinderGeo, ironMat);
cylinder52.position.set(0.76, 0.995, 0.08);
body.add(cylinder52);
const cylinder53 = new THREE.Mesh(cylinderGeo, ironMat);
cylinder53.position.set(0.76, 1.255, 0.08);
body.add(cylinder53);
const canvas = new THREE.Mesh(new THREE.CylinderGeometry(0.64, 0.64, 2.39, 14, 1, true, Math.PI / 2, Math.PI), canvasMat);
canvas.name = 'canvas';
canvas.position.set(0, 1.38, -0.335);
canvas.rotation.set(deg(90), 0, 0);
canvas.scale.set(1, 1, 1.32);
body.add(canvas);
const canvasFront = new THREE.Mesh(extrudeGeo, canvasMat);
canvasFront.name = 'canvasFront';
canvasFront.position.set(0, 1.38, 0.86);
canvasFront.scale.set(1, 1.32, 1);
body.add(canvasFront);
const canvasBack = new THREE.Mesh(extrudeGeo, canvasMat);
canvasBack.name = 'canvasBack';
canvasBack.position.set(0, 1.38, -1.53);
canvasBack.scale.set(1, 1.32, 1);
body.add(canvasBack);
const torus57 = new THREE.Mesh(torusGeo, woodLightMat);
torus57.position.set(0, 1.38, -1.39);
torus57.scale.set(1, 1.32, 1);
body.add(torus57);
const torus58 = new THREE.Mesh(torusGeo, woodLightMat);
torus58.position.set(0, 1.38, -0.8625);
torus58.scale.set(1, 1.32, 1);
body.add(torus58);
const torus59 = new THREE.Mesh(torusGeo, woodLightMat);
torus59.position.set(0, 1.38, -0.335);
torus59.scale.set(1, 1.32, 1);
body.add(torus59);
const torus60 = new THREE.Mesh(torusGeo, woodLightMat);
torus60.position.set(0, 1.38, 0.1925);
torus60.scale.set(1, 1.32, 1);
body.add(torus60);
const torus61 = new THREE.Mesh(torusGeo, woodLightMat);
torus61.position.set(0, 1.38, 0.72);
torus61.scale.set(1, 1.32, 1);
body.add(torus61);
const box62 = new THREE.Mesh(boxGeo11, sackMat);
box62.position.set(0.645, 1.44, -0.335);
body.add(box62);
const box63 = new THREE.Mesh(boxGeo11, sackMat);
box63.position.set(-0.645, 1.44, -0.335);
body.add(box63);
const wheels = new THREE.Group();
wheels.name = 'wheels';
root.add(wheels);
const wheelFL = new THREE.Group();
wheelFL.name = 'wheelFL';
wheelFL.position.set(0.8, 0.48, 0.95);
wheels.add(wheelFL);
const ironTire = new THREE.Mesh(latheGeo, ironMat);
ironTire.name = 'ironTire';
ironTire.rotation.set(0, 0, deg(90));
wheelFL.add(ironTire);
const felloe = new THREE.Mesh(latheGeo2, woodDarkMat);
felloe.name = 'felloe';
felloe.rotation.set(0, 0, deg(90));
wheelFL.add(felloe);
const hub = new THREE.Mesh(cylinderGeo2, woodDarkMat);
hub.name = 'hub';
hub.position.set(0.03, 0, 0);
hub.rotation.set(0, 0, deg(-90));
wheelFL.add(hub);
const hubCap = new THREE.Mesh(cylinderGeo3, ironMat);
hubCap.name = 'hubCap';
hubCap.position.set(0.16, 0, 0);
hubCap.rotation.set(0, 0, deg(90));
wheelFL.add(hubCap);
const box70 = new THREE.Mesh(boxGeo12, woodMat);
box70.position.set(0, 0.235, 0);
wheelFL.add(box70);
const box71 = new THREE.Mesh(boxGeo12, woodMat);
box71.position.set(0, 0.2035, 0.1175);
box71.rotation.set(deg(30), 0, 0);
wheelFL.add(box71);
const box72 = new THREE.Mesh(boxGeo12, woodMat);
box72.position.set(0, 0.1175, 0.2035);
box72.rotation.set(deg(60), 0, 0);
wheelFL.add(box72);
const box73 = new THREE.Mesh(boxGeo12, woodMat);
box73.position.set(0, 0, 0.235);
box73.rotation.set(deg(90), 0, 0);
wheelFL.add(box73);
const box74 = new THREE.Mesh(boxGeo12, woodMat);
box74.position.set(0, -0.1175, 0.2035);
box74.rotation.set(deg(120), 0, 0);
wheelFL.add(box74);
const box75 = new THREE.Mesh(boxGeo12, woodMat);
box75.position.set(0, -0.2035, 0.1175);
box75.rotation.set(deg(150), 0, 0);
wheelFL.add(box75);
const box76 = new THREE.Mesh(boxGeo12, woodMat);
box76.position.set(0, -0.235, 0);
box76.rotation.set(deg(180), 0, 0);
wheelFL.add(box76);
const box77 = new THREE.Mesh(boxGeo12, woodMat);
box77.position.set(0, -0.2035, -0.1175);
box77.rotation.set(deg(210), 0, 0);
wheelFL.add(box77);
const box78 = new THREE.Mesh(boxGeo12, woodMat);
box78.position.set(0, -0.1175, -0.2035);
box78.rotation.set(deg(240), 0, 0);
wheelFL.add(box78);
const box79 = new THREE.Mesh(boxGeo12, woodMat);
box79.position.set(0, 0, -0.235);
box79.rotation.set(deg(270), 0, 0);
wheelFL.add(box79);
const box80 = new THREE.Mesh(boxGeo12, woodMat);
box80.position.set(0, 0.1175, -0.2035);
box80.rotation.set(deg(300), 0, 0);
wheelFL.add(box80);
const box81 = new THREE.Mesh(boxGeo12, woodMat);
box81.position.set(0, 0.2035, -0.1175);
box81.rotation.set(deg(330), 0, 0);
wheelFL.add(box81);
const wheelFR = new THREE.Group();
wheelFR.name = 'wheelFR';
wheelFR.position.set(-0.8, 0.48, 0.95);
wheels.add(wheelFR);
const ironTire2 = new THREE.Mesh(latheGeo, ironMat);
ironTire2.name = 'ironTire';
ironTire2.rotation.set(0, 0, deg(90));
wheelFR.add(ironTire2);
const felloe2 = new THREE.Mesh(latheGeo2, woodDarkMat);
felloe2.name = 'felloe';
felloe2.rotation.set(0, 0, deg(90));
wheelFR.add(felloe2);
const hub2 = new THREE.Mesh(cylinderGeo2, woodDarkMat);
hub2.name = 'hub';
hub2.position.set(-0.03, 0, 0);
hub2.rotation.set(0, 0, deg(90));
wheelFR.add(hub2);
const hubCap2 = new THREE.Mesh(cylinderGeo3, ironMat);
hubCap2.name = 'hubCap';
hubCap2.position.set(-0.16, 0, 0);
hubCap2.rotation.set(0, 0, deg(90));
wheelFR.add(hubCap2);
const box87 = new THREE.Mesh(boxGeo12, woodMat);
box87.position.set(0, 0.235, 0);
wheelFR.add(box87);
const box88 = new THREE.Mesh(boxGeo12, woodMat);
box88.position.set(0, 0.2035, 0.1175);
box88.rotation.set(deg(30), 0, 0);
wheelFR.add(box88);
const box89 = new THREE.Mesh(boxGeo12, woodMat);
box89.position.set(0, 0.1175, 0.2035);
box89.rotation.set(deg(60), 0, 0);
wheelFR.add(box89);
const box90 = new THREE.Mesh(boxGeo12, woodMat);
box90.position.set(0, 0, 0.235);
box90.rotation.set(deg(90), 0, 0);
wheelFR.add(box90);
const box91 = new THREE.Mesh(boxGeo12, woodMat);
box91.position.set(0, -0.1175, 0.2035);
box91.rotation.set(deg(120), 0, 0);
wheelFR.add(box91);
const box92 = new THREE.Mesh(boxGeo12, woodMat);
box92.position.set(0, -0.2035, 0.1175);
box92.rotation.set(deg(150), 0, 0);
wheelFR.add(box92);
const box93 = new THREE.Mesh(boxGeo12, woodMat);
box93.position.set(0, -0.235, 0);
box93.rotation.set(deg(180), 0, 0);
wheelFR.add(box93);
const box94 = new THREE.Mesh(boxGeo12, woodMat);
box94.position.set(0, -0.2035, -0.1175);
box94.rotation.set(deg(210), 0, 0);
wheelFR.add(box94);
const box95 = new THREE.Mesh(boxGeo12, woodMat);
box95.position.set(0, -0.1175, -0.2035);
box95.rotation.set(deg(240), 0, 0);
wheelFR.add(box95);
const box96 = new THREE.Mesh(boxGeo12, woodMat);
box96.position.set(0, 0, -0.235);
box96.rotation.set(deg(270), 0, 0);
wheelFR.add(box96);
const box97 = new THREE.Mesh(boxGeo12, woodMat);
box97.position.set(0, 0.1175, -0.2035);
box97.rotation.set(deg(300), 0, 0);
wheelFR.add(box97);
const box98 = new THREE.Mesh(boxGeo12, woodMat);
box98.position.set(0, 0.2035, -0.1175);
box98.rotation.set(deg(330), 0, 0);
wheelFR.add(box98);
const wheelRL = new THREE.Group();
wheelRL.name = 'wheelRL';
wheelRL.position.set(0.8, 0.62, -0.95);
wheels.add(wheelRL);
const ironTire3 = new THREE.Mesh(latheGeo3, ironMat);
ironTire3.name = 'ironTire';
ironTire3.rotation.set(0, 0, deg(90));
wheelRL.add(ironTire3);
const felloe3 = new THREE.Mesh(latheGeo4, woodDarkMat);
felloe3.name = 'felloe';
felloe3.rotation.set(0, 0, deg(90));
wheelRL.add(felloe3);
const hub3 = new THREE.Mesh(cylinderGeo2, woodDarkMat);
hub3.name = 'hub';
hub3.position.set(0.03, 0, 0);
hub3.rotation.set(0, 0, deg(-90));
wheelRL.add(hub3);
const hubCap3 = new THREE.Mesh(cylinderGeo3, ironMat);
hubCap3.name = 'hubCap';
hubCap3.position.set(0.16, 0, 0);
hubCap3.rotation.set(0, 0, deg(90));
wheelRL.add(hubCap3);
const box104 = new THREE.Mesh(boxGeo13, woodMat);
box104.position.set(0, 0.305, 0);
wheelRL.add(box104);
const box105 = new THREE.Mesh(boxGeo13, woodMat);
box105.position.set(0, 0.2748, 0.1323);
box105.rotation.set(deg(25.7143), 0, 0);
wheelRL.add(box105);
const box106 = new THREE.Mesh(boxGeo13, woodMat);
box106.position.set(0, 0.1902, 0.2385);
box106.rotation.set(deg(51.4286), 0, 0);
wheelRL.add(box106);
const box107 = new THREE.Mesh(boxGeo13, woodMat);
box107.position.set(0, 0.0679, 0.2974);
box107.rotation.set(deg(77.1429), 0, 0);
wheelRL.add(box107);
const box108 = new THREE.Mesh(boxGeo13, woodMat);
box108.position.set(0, -0.0679, 0.2974);
box108.rotation.set(deg(102.8571), 0, 0);
wheelRL.add(box108);
const box109 = new THREE.Mesh(boxGeo13, woodMat);
box109.position.set(0, -0.1902, 0.2385);
box109.rotation.set(deg(128.5714), 0, 0);
wheelRL.add(box109);
const box110 = new THREE.Mesh(boxGeo13, woodMat);
box110.position.set(0, -0.2748, 0.1323);
box110.rotation.set(deg(154.2857), 0, 0);
wheelRL.add(box110);
const box111 = new THREE.Mesh(boxGeo13, woodMat);
box111.position.set(0, -0.305, 0);
box111.rotation.set(deg(180), 0, 0);
wheelRL.add(box111);
const box112 = new THREE.Mesh(boxGeo13, woodMat);
box112.position.set(0, -0.2748, -0.1323);
box112.rotation.set(deg(205.7143), 0, 0);
wheelRL.add(box112);
const box113 = new THREE.Mesh(boxGeo13, woodMat);
box113.position.set(0, -0.1902, -0.2385);
box113.rotation.set(deg(231.4286), 0, 0);
wheelRL.add(box113);
const box114 = new THREE.Mesh(boxGeo13, woodMat);
box114.position.set(0, -0.0679, -0.2974);
box114.rotation.set(deg(257.1429), 0, 0);
wheelRL.add(box114);
const box115 = new THREE.Mesh(boxGeo13, woodMat);
box115.position.set(0, 0.0679, -0.2974);
box115.rotation.set(deg(282.8571), 0, 0);
wheelRL.add(box115);
const box116 = new THREE.Mesh(boxGeo13, woodMat);
box116.position.set(0, 0.1902, -0.2385);
box116.rotation.set(deg(308.5714), 0, 0);
wheelRL.add(box116);
const box117 = new THREE.Mesh(boxGeo13, woodMat);
box117.position.set(0, 0.2748, -0.1323);
box117.rotation.set(deg(334.2857), 0, 0);
wheelRL.add(box117);
const wheelRR = new THREE.Group();
wheelRR.name = 'wheelRR';
wheelRR.position.set(-0.8, 0.62, -0.95);
wheels.add(wheelRR);
const ironTire4 = new THREE.Mesh(latheGeo3, ironMat);
ironTire4.name = 'ironTire';
ironTire4.rotation.set(0, 0, deg(90));
wheelRR.add(ironTire4);
const felloe4 = new THREE.Mesh(latheGeo4, woodDarkMat);
felloe4.name = 'felloe';
felloe4.rotation.set(0, 0, deg(90));
wheelRR.add(felloe4);
const hub4 = new THREE.Mesh(cylinderGeo2, woodDarkMat);
hub4.name = 'hub';
hub4.position.set(-0.03, 0, 0);
hub4.rotation.set(0, 0, deg(90));
wheelRR.add(hub4);
const hubCap4 = new THREE.Mesh(cylinderGeo3, ironMat);
hubCap4.name = 'hubCap';
hubCap4.position.set(-0.16, 0, 0);
hubCap4.rotation.set(0, 0, deg(90));
wheelRR.add(hubCap4);
const box123 = new THREE.Mesh(boxGeo13, woodMat);
box123.position.set(0, 0.305, 0);
wheelRR.add(box123);
const box124 = new THREE.Mesh(boxGeo13, woodMat);
box124.position.set(0, 0.2748, 0.1323);
box124.rotation.set(deg(25.7143), 0, 0);
wheelRR.add(box124);
const box125 = new THREE.Mesh(boxGeo13, woodMat);
box125.position.set(0, 0.1902, 0.2385);
box125.rotation.set(deg(51.4286), 0, 0);
wheelRR.add(box125);
const box126 = new THREE.Mesh(boxGeo13, woodMat);
box126.position.set(0, 0.0679, 0.2974);
box126.rotation.set(deg(77.1429), 0, 0);
wheelRR.add(box126);
const box127 = new THREE.Mesh(boxGeo13, woodMat);
box127.position.set(0, -0.0679, 0.2974);
box127.rotation.set(deg(102.8571), 0, 0);
wheelRR.add(box127);
const box128 = new THREE.Mesh(boxGeo13, woodMat);
box128.position.set(0, -0.1902, 0.2385);
box128.rotation.set(deg(128.5714), 0, 0);
wheelRR.add(box128);
const box129 = new THREE.Mesh(boxGeo13, woodMat);
box129.position.set(0, -0.2748, 0.1323);
box129.rotation.set(deg(154.2857), 0, 0);
wheelRR.add(box129);
const box130 = new THREE.Mesh(boxGeo13, woodMat);
box130.position.set(0, -0.305, 0);
box130.rotation.set(deg(180), 0, 0);
wheelRR.add(box130);
const box131 = new THREE.Mesh(boxGeo13, woodMat);
box131.position.set(0, -0.2748, -0.1323);
box131.rotation.set(deg(205.7143), 0, 0);
wheelRR.add(box131);
const box132 = new THREE.Mesh(boxGeo13, woodMat);
box132.position.set(0, -0.1902, -0.2385);
box132.rotation.set(deg(231.4286), 0, 0);
wheelRR.add(box132);
const box133 = new THREE.Mesh(boxGeo13, woodMat);
box133.position.set(0, -0.0679, -0.2974);
box133.rotation.set(deg(257.1429), 0, 0);
wheelRR.add(box133);
const box134 = new THREE.Mesh(boxGeo13, woodMat);
box134.position.set(0, 0.0679, -0.2974);
box134.rotation.set(deg(282.8571), 0, 0);
wheelRR.add(box134);
const box135 = new THREE.Mesh(boxGeo13, woodMat);
box135.position.set(0, 0.1902, -0.2385);
box135.rotation.set(deg(308.5714), 0, 0);
wheelRR.add(box135);
const box136 = new THREE.Mesh(boxGeo13, woodMat);
box136.position.set(0, 0.2748, -0.1323);
box136.rotation.set(deg(334.2857), 0, 0);
wheelRR.add(box136);
root.traverse((o) => {
if (o.isMesh) {
o.castShadow = true;
o.receiveShadow = true;
}
});
return root;
}
export default createWagon;
평점 및 댓글
댓글 0개
아직 댓글이 없어요. 이 모델을 어떻게 사용했는지, 어떤 점이 더 나아질 수 있을지 공유해 주세요.
관련 모델
같은 카테고리 또는 비슷한 태그









