삼각형 260개0.39 × 0.73 × 0.39 m
코드에서 사용하기
에디터에서 리믹스traffic-cone.js · 60줄
독립형 ES 모듈이에요 — three에만 의존해요. 팩토리 함수를 호출하고 그룹을 씬에 추가하세요.
/**
* Traffic Cone — Codels 3D model library
* License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
* Triangles: 260 · Size (W × H × D): 0.39 × 0.72 × 0.39 m
*
* Usage:
* import { createTrafficCone } from './traffic-cone.js';
*
* const model = createTrafficCone();
* model.position.set(0, 0, 0);
* scene.add(model);
*/
import * as THREE from 'three';
export function createTrafficCone() {
const root = new THREE.Group();
root.name = 'TrafficCone';
// Materials
const coneMat = new THREE.MeshStandardMaterial({ name: 'cone', color: 0xf26a1b, roughness: 0.6, flatShading: true });
const stripeMat = new THREE.MeshStandardMaterial({ name: 'stripe', color: 0xf4f4f0, roughness: 0.3, metalness: 0.1, flatShading: true });
const baseMat = new THREE.MeshStandardMaterial({ name: 'base', color: 0x26292c, roughness: 0.9, flatShading: true });
// Parts
const base = new THREE.Mesh(new THREE.BoxGeometry(0.385, 0.0315, 0.385), baseMat);
base.name = 'base';
base.position.set(0, 0.0158, 0);
root.add(base);
const baseCollar = new THREE.Mesh(new THREE.CylinderGeometry(0.159, 0.167, 0.0252, 12), baseMat);
baseCollar.name = 'baseCollar';
baseCollar.position.set(0, 0.0315, 0);
root.add(baseCollar);
const cone = new THREE.Mesh(new THREE.CylinderGeometry(0.0245, 0.147, 0.6685, 12), coneMat);
cone.name = 'cone';
cone.position.set(0, 0.3658, 0);
root.add(cone);
const tip = new THREE.Mesh(new THREE.SphereGeometry(0.025, 8, 4, 0, Math.PI * 2, 0, Math.PI / 2), coneMat);
tip.name = 'tip';
tip.position.set(0, 0.7, 0);
root.add(tip);
const stripe = new THREE.Mesh(new THREE.CylinderGeometry(0.0993, 0.1152, 0.0869, 12), stripeMat);
stripe.name = 'stripe';
stripe.position.set(0, 0.2855, 0);
root.add(stripe);
const stripe2 = new THREE.Mesh(new THREE.CylinderGeometry(0.0625, 0.0785, 0.0869, 12), stripeMat);
stripe2.name = 'stripe';
stripe2.position.set(0, 0.4861, 0);
root.add(stripe2);
root.traverse((o) => {
if (o.isMesh) {
o.castShadow = true;
o.receiveShadow = true;
}
});
return root;
}
export default createTrafficCone;
평점 및 댓글
댓글 0개
아직 댓글이 없어요. 이 모델을 어떻게 사용했는지, 어떤 점이 더 나아질 수 있을지 공유해 주세요.
관련 모델
같은 카테고리 또는 비슷한 태그









