Codels
삼각형 288개0.56 × 3.01 × 0.90 m

코드에서 사용하기

에디터에서 리믹스
독립형 ES 모듈이에요 — three에만 의존해요. 팩토리 함수를 호출하고 그룹을 씬에 추가하세요.
/**
 * Wooden Ladder — Codels 3D model library
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 288 · Size (W × H × D): 0.56 × 3.01 × 0.90 m
 *
 * Usage:
 *   import { createLadder } from './ladder.js';
 *   
 *   const model = createLadder();
 *   model.position.set(0, 0, 0);
 *   scene.add(model);
 */
import * as THREE from 'three';

const deg = THREE.MathUtils.degToRad;

export function createLadder() {
  const root = new THREE.Group();
  root.name = 'Ladder';

  // Materials
  const railMat = new THREE.MeshStandardMaterial({ name: 'rail', color: 0xa7763f, roughness: 0.9, flatShading: true });
  const rungMat = new THREE.MeshStandardMaterial({ name: 'rung', color: 0x896134, roughness: 0.9, flatShading: true });
  const ropeMat = new THREE.MeshStandardMaterial({ name: 'rope', color: 0xcdb88a, roughness: 1, flatShading: true });

  // Shared geometries
  const boxGeo = new THREE.BoxGeometry(0.06, 3.0945, 0.095);
  const cylinderGeo = new THREE.CylinderGeometry(0.058, 0.058, 0.08, 6);

  // Parts
  const rail = new THREE.Mesh(boxGeo, railMat);
  rail.name = 'rail';
  rail.position.set(-0.23, 1.506, 0);
  rail.rotation.set(deg(-15.0549), deg(0.1992), deg(-0.7406));
  root.add(rail);
  const lashing = new THREE.Mesh(cylinderGeo, ropeMat);
  lashing.name = 'lashing';
  lashing.position.set(-0.2116, 2.8805, -0.3698);
  lashing.rotation.set(deg(-15), 0, 0);
  root.add(lashing);
  const rail2 = new THREE.Mesh(boxGeo, railMat);
  rail2.name = 'rail';
  rail2.position.set(0.23, 1.506, 0);
  rail2.rotation.set(deg(-15.0549), deg(-0.1992), deg(0.7406));
  root.add(rail2);
  const lashing2 = new THREE.Mesh(cylinderGeo, ropeMat);
  lashing2.name = 'lashing';
  lashing2.position.set(0.2116, 2.8805, -0.3698);
  lashing2.rotation.set(deg(-15), 0, 0);
  root.add(lashing2);
  const rung = new THREE.Mesh(new THREE.CylinderGeometry(0.027, 0.027, 0.5521, 6), rungMat);
  rung.name = 'rung';
  rung.position.set(0, 0.3108, 0.3215);
  rung.rotation.set(0, 0, deg(-88.7494));
  root.add(rung);
  const rung2 = new THREE.Mesh(new THREE.CylinderGeometry(0.027, 0.027, 0.544, 6), rungMat);
  rung2.name = 'rung';
  rung2.position.set(0, 0.6158, 0.2395);
  rung2.rotation.set(0, 0, deg(-91.4797));
  root.add(rung2);
  const rung3 = new THREE.Mesh(new THREE.CylinderGeometry(0.027, 0.027, 0.5359, 6), rungMat);
  rung3.name = 'rung';
  rung3.position.set(0, 0.9209, 0.1574);
  rung3.rotation.set(0, 0, deg(-88.4677));
  root.add(rung3);
  const rung4 = new THREE.Mesh(new THREE.CylinderGeometry(0.027, 0.027, 0.5277, 6), rungMat);
  rung4.name = 'rung';
  rung4.position.set(0, 1.2259, 0.0754);
  rung4.rotation.set(0, 0, deg(-91.3973));
  root.add(rung4);
  const rung5 = new THREE.Mesh(new THREE.CylinderGeometry(0.027, 0.027, 0.5194, 6), rungMat);
  rung5.name = 'rung';
  rung5.position.set(0, 1.5309, -0.0067);
  rung5.rotation.set(0, 0, deg(-90.9876));
  root.add(rung5);
  const rung6 = new THREE.Mesh(new THREE.CylinderGeometry(0.027, 0.027, 0.5112, 6), rungMat);
  rung6.name = 'rung';
  rung6.position.set(0, 1.8359, -0.0888);
  rung6.rotation.set(0, 0, deg(-90.8467));
  root.add(rung6);
  const rung7 = new THREE.Mesh(new THREE.CylinderGeometry(0.027, 0.027, 0.5031, 6), rungMat);
  rung7.name = 'rung';
  rung7.position.set(0, 2.141, -0.1708);
  rung7.rotation.set(0, 0, deg(-88.919));
  root.add(rung7);
  const rung8 = new THREE.Mesh(new THREE.CylinderGeometry(0.027, 0.027, 0.4951, 6), rungMat);
  rung8.name = 'rung';
  rung8.position.set(0, 2.446, -0.2529);
  rung8.rotation.set(0, 0, deg(-91.942));
  root.add(rung8);
  const rung9 = new THREE.Mesh(new THREE.CylinderGeometry(0.027, 0.027, 0.4869, 6), rungMat);
  rung9.name = 'rung';
  rung9.position.set(0, 2.751, -0.3349);
  rung9.rotation.set(0, 0, deg(-88.2622));
  root.add(rung9);

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

export default createLadder;

평점 및 댓글

—
아직 평점이 없어요 — 첫 평점을 남겨 보세요.
5
0
4
0
3
0
2
0
1
0

평점과 댓글을 남기려면 로그인하세요.

댓글 0개

아직 댓글이 없어요. 이 모델을 어떻게 사용했는지, 어떤 점이 더 나아질 수 있을지 공유해 주세요.

관련 모델

같은 카테고리 또는 비슷한 태그