1440 Tris0,25 × 0,56 × 0,31 m
Im Code verwenden
Im Editor remixenknight-helmet.js · 256 Zeilen
Eigenständiges ES-Modul — hängt nur von three ab. Ruf die Factory auf und füge die Gruppe deiner Szene hinzu.
/**
* Knight Helmet — Codels 3D model library
* License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
* Triangles: 1,440 · Size (W × H × D): 0.25 × 0.56 × 0.31 m
*
* Usage:
* import { createKnightHelmet } from './knight-helmet.js';
*
* const model = createKnightHelmet();
* model.position.set(0, 0, 0);
* scene.add(model);
*/
import * as THREE from 'three';
const deg = THREE.MathUtils.degToRad;
// Revolve a 2D profile [[radius, y], ...] around the Y axis.
function lathe(points, segments, phiStart = 0, phiLength = Math.PI * 2) {
return new THREE.LatheGeometry(points.map(([x, y]) => new THREE.Vector2(x, y)), segments, phiStart, phiLength);
}
export function createKnightHelmet() {
const root = new THREE.Group();
root.name = 'KnightHelmet';
// Materials
const metalMat = new THREE.MeshStandardMaterial({ name: 'metal', color: 0xb4bdc7, roughness: 0.35, metalness: 0.75, flatShading: true });
const trimMat = new THREE.MeshStandardMaterial({ name: 'trim', color: 0xd3a64a, roughness: 0.35, metalness: 0.75, flatShading: true });
const darkMat = new THREE.MeshStandardMaterial({ name: 'dark', color: 0x16181d, roughness: 0.9, flatShading: true });
const plumeMat = new THREE.MeshStandardMaterial({ name: 'plume', color: 0xc9343c, roughness: 0.9 });
const plume2Mat = new THREE.MeshStandardMaterial({ name: 'plume2', color: 0xf1ece2, roughness: 0.9 });
// Shared geometries
const boxGeo = new THREE.BoxGeometry(0.0464, 0.024, 0.006);
const boxGeo2 = new THREE.BoxGeometry(0.007, 0.007, 0.004);
const sphereGeo = new THREE.SphereGeometry(0.006, 5, 3);
const sphereGeo2 = new THREE.SphereGeometry(1, 7, 5);
// Parts
const helmet = new THREE.Group();
helmet.name = 'helmet';
root.add(helmet);
const shell = new THREE.Mesh(lathe([[0.109, 0], [0.116, 0], [0.12, 0.05], [0.122, 0.13], [0.121, 0.2], [0.115, 0.245], [0.098, 0.275], [0.07, 0.295], [0.035, 0.305], [0, 0.308], [0, 0.3], [0.065, 0.287], [0.1, 0.258], [0.113, 0.2], [0.109, 0]], 16), metalMat);
shell.name = 'shell';
helmet.add(shell);
const browBand = new THREE.Mesh(lathe([[0.1172, 0.184], [0.1262, 0.184], [0.1255, 0.204], [0.1165, 0.204], [0.1172, 0.184]], 16), metalMat);
browBand.name = 'browBand';
helmet.add(browBand);
const faceBand = new THREE.Mesh(lathe([[0.1179, 0.14], [0.1269, 0.14], [0.1266, 0.158], [0.1176, 0.158], [0.1179, 0.14]], 16), metalMat);
faceBand.name = 'faceBand';
helmet.add(faceBand);
const rimBand = new THREE.Mesh(lathe([[0.1123, 0.004], [0.1213, 0.004], [0.1229, 0.024], [0.1139, 0.024], [0.1123, 0.004]], 16), metalMat);
rimBand.name = 'rimBand';
helmet.add(rimBand);
const slitMount56 = new THREE.Group();
slitMount56.name = 'slitMount-56';
slitMount56.rotation.set(0, deg(-56.25), 0);
helmet.add(slitMount56);
const slit56 = new THREE.Mesh(boxGeo, darkMat);
slit56.name = 'slit-56';
slit56.position.set(0, 0.17, 0.1176);
slitMount56.add(slit56);
const slitMount34 = new THREE.Group();
slitMount34.name = 'slitMount-34';
slitMount34.rotation.set(0, deg(-33.75), 0);
helmet.add(slitMount34);
const slit34 = new THREE.Mesh(boxGeo, darkMat);
slit34.name = 'slit-34';
slit34.position.set(0, 0.17, 0.1176);
slitMount34.add(slit34);
const slitMount11 = new THREE.Group();
slitMount11.name = 'slitMount-11';
slitMount11.rotation.set(0, deg(-11.25), 0);
helmet.add(slitMount11);
const slit11 = new THREE.Mesh(boxGeo, darkMat);
slit11.name = 'slit-11';
slit11.position.set(0, 0.17, 0.1176);
slitMount11.add(slit11);
const slitMount112 = new THREE.Group();
slitMount112.name = 'slitMount11';
slitMount112.rotation.set(0, deg(11.25), 0);
helmet.add(slitMount112);
const slit112 = new THREE.Mesh(boxGeo, darkMat);
slit112.name = 'slit11';
slit112.position.set(0, 0.17, 0.1176);
slitMount112.add(slit112);
const slitMount342 = new THREE.Group();
slitMount342.name = 'slitMount34';
slitMount342.rotation.set(0, deg(33.75), 0);
helmet.add(slitMount342);
const slit342 = new THREE.Mesh(boxGeo, darkMat);
slit342.name = 'slit34';
slit342.position.set(0, 0.17, 0.1176);
slitMount342.add(slit342);
const slitMount562 = new THREE.Group();
slitMount562.name = 'slitMount56';
slitMount562.rotation.set(0, deg(56.25), 0);
helmet.add(slitMount562);
const slit562 = new THREE.Mesh(boxGeo, darkMat);
slit562.name = 'slit56';
slit562.position.set(0, 0.17, 0.1176);
slitMount562.add(slit562);
const noseStrip = new THREE.Mesh(new THREE.BoxGeometry(0.032, 0.17, 0.012), metalMat);
noseStrip.name = 'noseStrip';
noseStrip.position.set(0, 0.115, 0.12);
helmet.add(noseStrip);
const stripCap = new THREE.Mesh(new THREE.BoxGeometry(0.032, 0.03, 0.012), trimMat);
stripCap.name = 'stripCap';
stripCap.position.set(0, 0.215, 0.119);
helmet.add(stripCap);
const holes34 = new THREE.Group();
holes34.name = 'holes34';
holes34.rotation.set(0, deg(33.75), 0);
helmet.add(holes34);
const hole341 = new THREE.Mesh(boxGeo2, darkMat);
hole341.name = 'hole34_1';
hole341.position.set(0, 0.085, 0.1191);
holes34.add(hole341);
const hole342 = new THREE.Mesh(boxGeo2, darkMat);
hole342.name = 'hole34_2';
hole342.position.set(-0.012, 0.085, 0.1191);
holes34.add(hole342);
const hole343 = new THREE.Mesh(boxGeo2, darkMat);
hole343.name = 'hole34_3';
hole343.position.set(0.012, 0.085, 0.1191);
holes34.add(hole343);
const hole344 = new THREE.Mesh(boxGeo2, darkMat);
hole344.name = 'hole34_4';
hole344.position.set(0, 0.065, 0.1191);
holes34.add(hole344);
const hole345 = new THREE.Mesh(boxGeo2, darkMat);
hole345.name = 'hole34_5';
hole345.position.set(0, 0.105, 0.1191);
holes34.add(hole345);
const holes56 = new THREE.Group();
holes56.name = 'holes56';
holes56.rotation.set(0, deg(56.25), 0);
helmet.add(holes56);
const hole561 = new THREE.Mesh(boxGeo2, darkMat);
hole561.name = 'hole56_1';
hole561.position.set(0, 0.085, 0.1191);
holes56.add(hole561);
const hole562 = new THREE.Mesh(boxGeo2, darkMat);
hole562.name = 'hole56_2';
hole562.position.set(-0.012, 0.085, 0.1191);
holes56.add(hole562);
const hole563 = new THREE.Mesh(boxGeo2, darkMat);
hole563.name = 'hole56_3';
hole563.position.set(0.012, 0.085, 0.1191);
holes56.add(hole563);
const hole564 = new THREE.Mesh(boxGeo2, darkMat);
hole564.name = 'hole56_4';
hole564.position.set(0, 0.065, 0.1191);
holes56.add(hole564);
const hole565 = new THREE.Mesh(boxGeo2, darkMat);
hole565.name = 'hole56_5';
hole565.position.set(0, 0.105, 0.1191);
holes56.add(hole565);
const rivetMount6 = new THREE.Group();
rivetMount6.name = 'rivetMount-6';
rivetMount6.rotation.set(0, deg(-67.5), 0);
helmet.add(rivetMount6);
const rivet6 = new THREE.Mesh(sphereGeo, trimMat);
rivet6.name = 'rivet-6';
rivet6.position.set(0, 0.194, 0.1237);
rivetMount6.add(rivet6);
const rivetMount2 = new THREE.Group();
rivetMount2.name = 'rivetMount-2';
rivetMount2.rotation.set(0, deg(-22.5), 0);
helmet.add(rivetMount2);
const rivet2 = new THREE.Mesh(sphereGeo, trimMat);
rivet2.name = 'rivet-2';
rivet2.position.set(0, 0.194, 0.1237);
rivetMount2.add(rivet2);
const rivetMount22 = new THREE.Group();
rivetMount22.name = 'rivetMount2';
rivetMount22.rotation.set(0, deg(22.5), 0);
helmet.add(rivetMount22);
const rivet22 = new THREE.Mesh(sphereGeo, trimMat);
rivet22.name = 'rivet2';
rivet22.position.set(0, 0.194, 0.1237);
rivetMount22.add(rivet22);
const rivetMount62 = new THREE.Group();
rivetMount62.name = 'rivetMount6';
rivetMount62.rotation.set(0, deg(67.5), 0);
helmet.add(rivetMount62);
const rivet62 = new THREE.Mesh(sphereGeo, trimMat);
rivet62.name = 'rivet6';
rivet62.position.set(0, 0.194, 0.1237);
rivetMount62.add(rivet62);
const plumeHolder = new THREE.Mesh(new THREE.CylinderGeometry(0.016, 0.022, 0.035, 8), trimMat);
plumeHolder.name = 'plumeHolder';
plumeHolder.position.set(0, 0.3135, 0);
helmet.add(plumeHolder);
const feather1 = new THREE.Group();
feather1.name = 'feather1';
feather1.position.set(0, 0.326, 0);
feather1.rotation.set(deg(12), 0, deg(-4));
helmet.add(feather1);
const featherBlade1 = new THREE.Mesh(sphereGeo2, plumeMat);
featherBlade1.name = 'featherBlade1';
featherBlade1.position.set(0, 0.1, 0);
featherBlade1.scale.set(0.026, 0.1, 0.042);
feather1.add(featherBlade1);
const feather2 = new THREE.Group();
feather2.name = 'feather2';
feather2.position.set(0, 0.326, 0);
feather2.rotation.set(deg(-10), 0, deg(4));
helmet.add(feather2);
const featherBlade2 = new THREE.Mesh(sphereGeo2, plume2Mat);
featherBlade2.name = 'featherBlade2';
featherBlade2.position.set(0, 0.12, 0);
featherBlade2.scale.set(0.026, 0.12, 0.042);
feather2.add(featherBlade2);
const feather3 = new THREE.Group();
feather3.name = 'feather3';
feather3.position.set(0, 0.326, 0);
feather3.rotation.set(deg(-32), 0, deg(-4));
helmet.add(feather3);
const featherBlade3 = new THREE.Mesh(sphereGeo2, plumeMat);
featherBlade3.name = 'featherBlade3';
featherBlade3.position.set(0, 0.125, 0);
featherBlade3.scale.set(0.026, 0.125, 0.042);
feather3.add(featherBlade3);
const feather4 = new THREE.Group();
feather4.name = 'feather4';
feather4.position.set(0, 0.326, 0);
feather4.rotation.set(deg(-55), 0, deg(4));
helmet.add(feather4);
const featherBlade4 = new THREE.Mesh(sphereGeo2, plume2Mat);
featherBlade4.name = 'featherBlade4';
featherBlade4.position.set(0, 0.11, 0);
featherBlade4.scale.set(0.026, 0.11, 0.042);
feather4.add(featherBlade4);
const feather5 = new THREE.Group();
feather5.name = 'feather5';
feather5.position.set(0, 0.326, 0);
feather5.rotation.set(deg(-78), 0, deg(-4));
helmet.add(feather5);
const featherBlade5 = new THREE.Mesh(sphereGeo2, plumeMat);
featherBlade5.name = 'featherBlade5';
featherBlade5.position.set(0, 0.09, 0);
featherBlade5.scale.set(0.026, 0.09, 0.042);
feather5.add(featherBlade5);
root.traverse((o) => {
if (o.isMesh) {
o.castShadow = true;
o.receiveShadow = true;
}
});
return root;
}
export default createKnightHelmet;
Bewertungen & Kommentare
—
Noch keine Bewertungen — gib die erste ab.
5
0
4
0
3
0
2
0
1
0
Melde dich an, um zu bewerten und zu kommentieren.
0 Kommentare
Noch keine Kommentare. Erzähl, wie du dieses Modell genutzt hast oder was besser sein könnte.
Ähnliche Modelle
Gleiche Kategorie oder ähnliche Tags









