Codels
208 tris1,40 × 0,75 × 0,80 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.
/**
 * Wooden Table — Codels 3D model library
 * License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
 * Triangles: 208 · Size (W × H × D): 1.40 × 0.75 × 0.80 m
 *
 * Usage:
 *   import { createWoodenTable } from './wooden-table.js';
 *   
 *   const model = createWoodenTable();
 *   model.position.set(0, 0, 0);
 *   scene.add(model);
 */
import * as THREE from 'three';

const deg = THREE.MathUtils.degToRad;

export function createWoodenTable() {
  const root = new THREE.Group();
  root.name = 'WoodenTable';

  // Materials
  const plankMat = new THREE.MeshStandardMaterial({ name: 'plank', color: 0xa5693a, roughness: 0.85, flatShading: true });
  const plankAltMat = new THREE.MeshStandardMaterial({ name: 'plankAlt', color: 0xb97641, roughness: 0.85, flatShading: true });
  const plankDarkMat = new THREE.MeshStandardMaterial({ name: 'plankDark', color: 0x915c33, roughness: 0.85, flatShading: true });
  const frameMat = new THREE.MeshStandardMaterial({ name: 'frame', color: 0x774c2a, roughness: 0.9, flatShading: true });
  const underMat = new THREE.MeshStandardMaterial({ name: 'under', color: 0x422a17, roughness: 1, flatShading: true });

  // Shared geometries
  const boxGeo = new THREE.BoxGeometry(1.24, 0.05, 0.153);
  const boxGeo2 = new THREE.BoxGeometry(0.08, 0.054, 0.8);
  const cylinderGeo = new THREE.CylinderGeometry(0.0566, 0.0389, 0.7, 4);
  const boxGeo3 = new THREE.BoxGeometry(1.18, 0.1, 0.025);
  const boxGeo4 = new THREE.BoxGeometry(0.025, 0.1, 0.58);

  // Parts
  const plank = new THREE.Mesh(boxGeo, plankAltMat);
  plank.name = 'plank';
  plank.position.set(0, 0.7276, -0.32);
  root.add(plank);
  const plank2 = new THREE.Mesh(boxGeo, plankAltMat);
  plank2.name = 'plank';
  plank2.position.set(0, 0.725, -0.16);
  root.add(plank2);
  const plank3 = new THREE.Mesh(boxGeo, plankMat);
  plank3.name = 'plank';
  plank3.position.set(0, 0.7265, 0);
  root.add(plank3);
  const plank4 = new THREE.Mesh(boxGeo, plankDarkMat);
  plank4.name = 'plank';
  plank4.position.set(0, 0.7266, 0.16);
  root.add(plank4);
  const plank5 = new THREE.Mesh(boxGeo, plankMat);
  plank5.name = 'plank';
  plank5.position.set(0, 0.7258, 0.32);
  root.add(plank5);
  const breadboard = new THREE.Mesh(boxGeo2, frameMat);
  breadboard.name = 'breadboard';
  breadboard.position.set(-0.66, 0.727, 0);
  root.add(breadboard);
  const breadboard2 = new THREE.Mesh(boxGeo2, frameMat);
  breadboard2.name = 'breadboard';
  breadboard2.position.set(0.66, 0.727, 0);
  root.add(breadboard2);
  const underboard = new THREE.Mesh(new THREE.BoxGeometry(1.24, 0.02, 0.76), underMat);
  underboard.name = 'underboard';
  underboard.position.set(0, 0.69, 0);
  root.add(underboard);
  const leg = new THREE.Mesh(cylinderGeo, frameMat);
  leg.name = 'leg';
  leg.position.set(-0.59, 0.35, -0.29);
  leg.rotation.set(0, deg(45), 0);
  root.add(leg);
  const leg2 = new THREE.Mesh(cylinderGeo, frameMat);
  leg2.name = 'leg';
  leg2.position.set(0.59, 0.35, -0.29);
  leg2.rotation.set(0, deg(45), 0);
  root.add(leg2);
  const leg3 = new THREE.Mesh(cylinderGeo, frameMat);
  leg3.name = 'leg';
  leg3.position.set(0.59, 0.35, 0.29);
  leg3.rotation.set(0, deg(45), 0);
  root.add(leg3);
  const leg4 = new THREE.Mesh(cylinderGeo, frameMat);
  leg4.name = 'leg';
  leg4.position.set(-0.59, 0.35, 0.29);
  leg4.rotation.set(0, deg(45), 0);
  root.add(leg4);
  const apronLong = new THREE.Mesh(boxGeo3, plankDarkMat);
  apronLong.name = 'apronLong';
  apronLong.position.set(0, 0.63, -0.3055);
  root.add(apronLong);
  const apronShort = new THREE.Mesh(boxGeo4, plankDarkMat);
  apronShort.name = 'apronShort';
  apronShort.position.set(-0.6055, 0.63, 0);
  root.add(apronShort);
  const apronLong2 = new THREE.Mesh(boxGeo3, plankDarkMat);
  apronLong2.name = 'apronLong';
  apronLong2.position.set(0, 0.63, 0.3055);
  root.add(apronLong2);
  const apronShort2 = new THREE.Mesh(boxGeo4, plankDarkMat);
  apronShort2.name = 'apronShort';
  apronShort2.position.set(0.6055, 0.63, 0);
  root.add(apronShort2);

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

export default createWoodenTable;

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