1,5 mil tris1,83 × 2,12 × 1,99 m
Úsalo en código
Hacer remix en el editorsentry-bot.js · 299 líneas
Módulo ES autónomo — solo depende de three. Llama a la función factory y añade el grupo a tu escena.
/**
* Sentry Bot — Codels 3D model library
* License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
* Triangles: 1,490 · Size (W × H × D): 1.83 × 2.12 × 1.99 m
*
* Usage:
* import { createSentryBot } from './sentry-bot.js';
*
* const model = createSentryBot();
* model.position.set(0, 0, 0);
* scene.add(model);
*/
import * as THREE from 'three';
const deg = THREE.MathUtils.degToRad;
export function createSentryBot() {
const root = new THREE.Group();
root.name = 'SentryBot';
// Materials
const bodyMat = new THREE.MeshStandardMaterial({ name: 'body', color: 0xdfe2dc, roughness: 0.45, metalness: 0.2, flatShading: true });
const accentMat = new THREE.MeshStandardMaterial({ name: 'accent', color: 0x3d6fb6, roughness: 0.45, metalness: 0.2, flatShading: true });
const darkMat = new THREE.MeshStandardMaterial({ name: 'dark', color: 0x2d3036, roughness: 0.55, metalness: 0.45, flatShading: true });
const metalMat = new THREE.MeshStandardMaterial({ name: 'metal', color: 0x9aa1aa, roughness: 0.3, metalness: 0.8, flatShading: true });
const eyeMat = new THREE.MeshStandardMaterial({ name: 'eye', color: 0xff3b2f, roughness: 0.3, emissive: 0xff3b2f, emissiveIntensity: 1.7, flatShading: true });
const warnMat = new THREE.MeshStandardMaterial({ name: 'warn', color: 0xe9c23a, roughness: 0.5, flatShading: true });
// Shared geometries
const sphereGeo = new THREE.SphereGeometry(0.08, 6, 4);
const cylinderGeo = new THREE.CylinderGeometry(0.065, 0.075, 0.4079, 6);
const sphereGeo2 = new THREE.SphereGeometry(0.075, 6, 4);
const cylinderGeo2 = new THREE.CylinderGeometry(0.05, 0.06, 0.7558, 6);
const cylinderGeo3 = new THREE.CylinderGeometry(0.085, 0.085, 0.2843, 6);
const cylinderGeo4 = new THREE.CylinderGeometry(0.15, 0.18, 0.08, 8);
const cylinderGeo5 = new THREE.CylinderGeometry(0.05, 0.05, 0.06, 6);
const boxGeo = new THREE.BoxGeometry(0.07, 0.36, 0.2);
const boxGeo2 = new THREE.BoxGeometry(0.14, 0.2, 0.42);
const cylinderGeo6 = new THREE.CylinderGeometry(0.05, 0.05, 0.42, 8);
const cylinderGeo7 = new THREE.CylinderGeometry(0.07, 0.07, 0.1, 8);
const cylinderGeo8 = new THREE.CylinderGeometry(0.035, 0.035, 0.02, 8);
const boxGeo3 = new THREE.BoxGeometry(0.06, 0.06, 0.2);
// Parts
const tripod = new THREE.Group();
tripod.name = 'tripod';
root.add(tripod);
const hub = new THREE.Mesh(new THREE.CylinderGeometry(0.26, 0.3, 0.3, 6), darkMat);
hub.name = 'hub';
hub.position.set(0, 0.72, 0);
tripod.add(hub);
const hubCap = new THREE.Mesh(new THREE.CylinderGeometry(0.28, 0.28, 0.06, 6), accentMat);
hubCap.name = 'hubCap';
hubCap.position.set(0, 0.87, 0);
tripod.add(hubCap);
const neck = new THREE.Mesh(new THREE.CylinderGeometry(0.11, 0.13, 0.15, 8), metalMat);
neck.name = 'neck';
neck.position.set(0, 0.945, 0);
tripod.add(neck);
const leg1 = new THREE.Group();
leg1.name = 'leg1';
tripod.add(leg1);
const hipJoint = new THREE.Mesh(sphereGeo, darkMat);
hipJoint.name = 'hipJoint';
hipJoint.position.set(0, 0.72, -0.22);
leg1.add(hipJoint);
const upperLeg = new THREE.Mesh(cylinderGeo, bodyMat);
upperLeg.name = 'upperLeg';
upperLeg.position.set(0, 0.76, -0.42);
upperLeg.rotation.set(deg(-78.6901), 0, 0);
leg1.add(upperLeg);
const kneeJoint = new THREE.Mesh(sphereGeo2, darkMat);
kneeJoint.name = 'kneeJoint';
kneeJoint.position.set(0, 0.8, -0.62);
leg1.add(kneeJoint);
const piston = new THREE.Mesh(cylinderGeo2, metalMat);
piston.name = 'piston';
piston.position.set(0, 0.44, -0.735);
piston.rotation.set(deg(-162.2842), 0, 0);
leg1.add(piston);
const pistonSleeve = new THREE.Mesh(cylinderGeo3, warnMat);
pistonSleeve.name = 'pistonSleeve';
pistonSleeve.position.set(0, 0.62, -0.6775);
pistonSleeve.rotation.set(deg(-156.1398), 0, 0);
leg1.add(pistonSleeve);
const footPad = new THREE.Mesh(cylinderGeo4, darkMat);
footPad.name = 'footPad';
footPad.position.set(0, 0.04, -0.85);
leg1.add(footPad);
const footBolt = new THREE.Mesh(cylinderGeo5, accentMat);
footBolt.name = 'footBolt';
footBolt.position.set(0, 0.11, -0.85);
leg1.add(footBolt);
const leg2 = new THREE.Group();
leg2.name = 'leg2';
tripod.add(leg2);
const hipJoint2 = new THREE.Mesh(sphereGeo, darkMat);
hipJoint2.name = 'hipJoint';
hipJoint2.position.set(-0.1905, 0.72, 0.11);
leg2.add(hipJoint2);
const upperLeg2 = new THREE.Mesh(cylinderGeo, bodyMat);
upperLeg2.name = 'upperLeg';
upperLeg2.position.set(-0.3637, 0.76, 0.21);
upperLeg2.rotation.set(deg(31.5336), deg(20.3707), deg(64.9393));
leg2.add(upperLeg2);
const kneeJoint2 = new THREE.Mesh(sphereGeo2, darkMat);
kneeJoint2.name = 'kneeJoint';
kneeJoint2.position.set(-0.5369, 0.8, 0.31);
leg2.add(kneeJoint2);
const piston2 = new THREE.Mesh(cylinderGeo2, metalMat);
piston2.name = 'piston';
piston2.position.set(-0.6365, 0.44, 0.3675);
piston2.rotation.set(deg(16.5545), deg(57.7246), deg(150.4286));
leg2.add(piston2);
const pistonSleeve2 = new THREE.Mesh(cylinderGeo3, warnMat);
pistonSleeve2.name = 'pistonSleeve';
pistonSleeve2.position.set(-0.5867, 0.62, 0.3387);
pistonSleeve2.rotation.set(deg(21.2027), deg(55.998), deg(141.2129));
leg2.add(pistonSleeve2);
const footPad2 = new THREE.Mesh(cylinderGeo4, darkMat);
footPad2.name = 'footPad';
footPad2.position.set(-0.7361, 0.04, 0.425);
leg2.add(footPad2);
const footBolt2 = new THREE.Mesh(cylinderGeo5, accentMat);
footBolt2.name = 'footBolt';
footBolt2.position.set(-0.7361, 0.11, 0.425);
leg2.add(footBolt2);
const leg3 = new THREE.Group();
leg3.name = 'leg3';
tripod.add(leg3);
const hipJoint3 = new THREE.Mesh(sphereGeo, darkMat);
hipJoint3.name = 'hipJoint';
hipJoint3.position.set(0.1905, 0.72, 0.11);
leg3.add(hipJoint3);
const upperLeg3 = new THREE.Mesh(cylinderGeo, bodyMat);
upperLeg3.name = 'upperLeg';
upperLeg3.position.set(0.3637, 0.76, 0.21);
upperLeg3.rotation.set(deg(31.5336), deg(-20.3707), deg(-64.9393));
leg3.add(upperLeg3);
const kneeJoint3 = new THREE.Mesh(sphereGeo2, darkMat);
kneeJoint3.name = 'kneeJoint';
kneeJoint3.position.set(0.5369, 0.8, 0.31);
leg3.add(kneeJoint3);
const piston3 = new THREE.Mesh(cylinderGeo2, metalMat);
piston3.name = 'piston';
piston3.position.set(0.6365, 0.44, 0.3675);
piston3.rotation.set(deg(16.5545), deg(-57.7246), deg(-150.4286));
leg3.add(piston3);
const pistonSleeve3 = new THREE.Mesh(cylinderGeo3, warnMat);
pistonSleeve3.name = 'pistonSleeve';
pistonSleeve3.position.set(0.5867, 0.62, 0.3388);
pistonSleeve3.rotation.set(deg(21.2027), deg(-55.998), deg(-141.2129));
leg3.add(pistonSleeve3);
const footPad3 = new THREE.Mesh(cylinderGeo4, darkMat);
footPad3.name = 'footPad';
footPad3.position.set(0.7361, 0.04, 0.425);
leg3.add(footPad3);
const footBolt3 = new THREE.Mesh(cylinderGeo5, accentMat);
footBolt3.name = 'footBolt';
footBolt3.position.set(0.7361, 0.11, 0.425);
leg3.add(footBolt3);
const head = new THREE.Group();
head.name = 'head';
head.position.set(0, 1.02, 0);
head.rotation.set(0, deg(25), 0);
root.add(head);
const bearingRing = new THREE.Mesh(new THREE.CylinderGeometry(0.2, 0.22, 0.08, 12), accentMat);
bearingRing.name = 'bearingRing';
bearingRing.position.set(0, 0.04, 0);
head.add(bearingRing);
const yokeBase = new THREE.Mesh(new THREE.BoxGeometry(0.3, 0.12, 0.3), darkMat);
yokeBase.name = 'yokeBase';
yokeBase.position.set(0, 0.14, 0);
head.add(yokeBase);
const yokeArm = new THREE.Mesh(boxGeo, darkMat);
yokeArm.name = 'yokeArm';
yokeArm.position.set(0.3, 0.26, 0);
head.add(yokeArm);
const yokeArm2 = new THREE.Mesh(boxGeo, darkMat);
yokeArm2.name = 'yokeArm';
yokeArm2.position.set(-0.3, 0.26, 0);
head.add(yokeArm2);
const aim = new THREE.Group();
aim.name = 'aim';
aim.position.set(0, 0.42, 0);
aim.rotation.set(deg(-5), 0, 0);
aim.scale.setScalar(1.2);
head.add(aim);
const shell = new THREE.Mesh(new THREE.SphereGeometry(0.32, 10, 7), bodyMat);
shell.name = 'shell';
shell.scale.set(1, 0.86, 1.08);
aim.add(shell);
const topArmor = new THREE.Mesh(new THREE.SphereGeometry(0.33, 10, 3, 0, Math.PI * 2, 0, 0.75), accentMat);
topArmor.name = 'topArmor';
topArmor.scale.set(1, 0.86, 1.08);
aim.add(topArmor);
const seam = new THREE.Mesh(new THREE.BoxGeometry(0.66, 0.06, 0.5), darkMat);
seam.name = 'seam';
seam.position.set(0, -0.06, -0.05);
aim.add(seam);
const eyeSocket = new THREE.Mesh(new THREE.CylinderGeometry(0.15, 0.17, 0.1, 12), darkMat);
eyeSocket.name = 'eyeSocket';
eyeSocket.position.set(0, 0.02, 0.32);
eyeSocket.rotation.set(deg(90), 0, 0);
aim.add(eyeSocket);
const eyeGlow = new THREE.Mesh(new THREE.CylinderGeometry(0.11, 0.11, 0.04, 12), eyeMat);
eyeGlow.name = 'eyeGlow';
eyeGlow.position.set(0, 0.02, 0.37);
eyeGlow.rotation.set(deg(90), 0, 0);
aim.add(eyeGlow);
const pupil = new THREE.Mesh(new THREE.CylinderGeometry(0.045, 0.045, 0.03, 8), darkMat);
pupil.name = 'pupil';
pupil.position.set(0, 0.02, 0.39);
pupil.rotation.set(deg(90), 0, 0);
aim.add(pupil);
const eyeRim = new THREE.Mesh(new THREE.TorusGeometry(0.16, 0.025, 4, 12), metalMat);
eyeRim.name = 'eyeRim';
eyeRim.position.set(0, 0.02, 0.37);
aim.add(eyeRim);
const antenna = new THREE.Mesh(new THREE.CylinderGeometry(0.012, 0.018, 0.35, 5), metalMat);
antenna.name = 'antenna';
antenna.position.set(-0.14, 0.375, -0.12);
antenna.rotation.set(0, 0, deg(12));
aim.add(antenna);
const antennaTip = new THREE.Mesh(new THREE.SphereGeometry(0.025, 5, 3), eyeMat);
antennaTip.name = 'antennaTip';
antennaTip.position.set(-0.18, 0.55, -0.12);
aim.add(antennaTip);
const ammoDrum = new THREE.Mesh(new THREE.CylinderGeometry(0.14, 0.14, 0.3, 10), darkMat);
ammoDrum.name = 'ammoDrum';
ammoDrum.position.set(0, -0.02, -0.33);
ammoDrum.rotation.set(0, 0, deg(90));
aim.add(ammoDrum);
const gunL = new THREE.Group();
gunL.name = 'gunL';
gunL.position.set(0.4, -0.02, 0);
aim.add(gunL);
const gunHousing = new THREE.Mesh(boxGeo2, accentMat);
gunHousing.name = 'gunHousing';
gunHousing.position.set(0, 0, 0.02);
gunL.add(gunHousing);
const barrel = new THREE.Mesh(cylinderGeo6, metalMat);
barrel.name = 'barrel';
barrel.position.set(0, 0.02, 0.42);
barrel.rotation.set(deg(90), 0, 0);
gunL.add(barrel);
const muzzle = new THREE.Mesh(cylinderGeo7, darkMat);
muzzle.name = 'muzzle';
muzzle.position.set(0, 0.02, 0.62);
muzzle.rotation.set(deg(90), 0, 0);
gunL.add(muzzle);
const muzzleGlow = new THREE.Mesh(cylinderGeo8, eyeMat);
muzzleGlow.name = 'muzzleGlow';
muzzleGlow.position.set(0, 0.02, 0.675);
muzzleGlow.rotation.set(deg(90), 0, 0);
gunL.add(muzzleGlow);
const gunMount = new THREE.Mesh(boxGeo3, darkMat);
gunMount.name = 'gunMount';
gunMount.position.set(-0.08, 0, -0.05);
gunL.add(gunMount);
const gunR = new THREE.Group();
gunR.name = 'gunR';
gunR.position.set(-0.4, -0.02, 0);
aim.add(gunR);
const gunHousing2 = new THREE.Mesh(boxGeo2, accentMat);
gunHousing2.name = 'gunHousing';
gunHousing2.position.set(0, 0, 0.02);
gunR.add(gunHousing2);
const barrel2 = new THREE.Mesh(cylinderGeo6, metalMat);
barrel2.name = 'barrel';
barrel2.position.set(0, 0.02, 0.42);
barrel2.rotation.set(deg(90), 0, 0);
gunR.add(barrel2);
const muzzle2 = new THREE.Mesh(cylinderGeo7, darkMat);
muzzle2.name = 'muzzle';
muzzle2.position.set(0, 0.02, 0.62);
muzzle2.rotation.set(deg(90), 0, 0);
gunR.add(muzzle2);
const muzzleGlow2 = new THREE.Mesh(cylinderGeo8, eyeMat);
muzzleGlow2.name = 'muzzleGlow';
muzzleGlow2.position.set(0, 0.02, 0.675);
muzzleGlow2.rotation.set(deg(90), 0, 0);
gunR.add(muzzleGlow2);
const gunMount2 = new THREE.Mesh(boxGeo3, darkMat);
gunMount2.name = 'gunMount';
gunMount2.position.set(0.08, 0, -0.05);
gunR.add(gunMount2);
root.traverse((o) => {
if (o.isMesh) {
o.castShadow = true;
o.receiveShadow = true;
}
});
return root;
}
export default createSentryBot;
Valoraciones y comentarios
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









