Codels
260 tris0,39 × 0,73 × 0,39 m

Úsalo en código

Hacer remix en el editor
Módulo ES autónomo — solo depende de three. Llama a la función factory y añade el grupo a tu escena.
/**
 * 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;

Valoraciones y comentarios

—
Aún no hay valoraciones — sé el primero.
5
0
4
0
3
0
2
0
1
0

Inicia sesión para valorar y comentar.

0 comentarios

Aún no hay comentarios. Cuenta cómo usaste este modelo o qué se podría mejorar.

Modelos relacionados

Misma categoría o etiquetas similares