640 треуг.1,25 × 1,74 × 1,16 m
Использовать в коде
Ремикс в редактореtarget.js · 175 строк
Самодостаточный ES-модуль — зависит только от three. Вызовите фабрику и добавьте группу в сцену.
/**
* Archery Target — Codels 3D model library
* License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
* Triangles: 640 · Size (W × H × D): 1.25 × 1.74 × 1.16 m
*
* Usage:
* import { createTarget } from './target.js';
*
* const model = createTarget();
* model.position.set(0, 0, 0);
* scene.add(model);
*/
import * as THREE from 'three';
const deg = THREE.MathUtils.degToRad;
export function createTarget() {
const root = new THREE.Group();
root.name = 'Target';
// Materials
const ring1Mat = new THREE.MeshStandardMaterial({ name: 'ring1', color: 0xf4f1e8, roughness: 0.75, flatShading: true });
const ring2Mat = new THREE.MeshStandardMaterial({ name: 'ring2', color: 0x2a2c33, roughness: 0.75, flatShading: true });
const ring3Mat = new THREE.MeshStandardMaterial({ name: 'ring3', color: 0x3a8fe0, roughness: 0.75, flatShading: true });
const ring4Mat = new THREE.MeshStandardMaterial({ name: 'ring4', color: 0xe23b2e, roughness: 0.75, flatShading: true });
const ring5Mat = new THREE.MeshStandardMaterial({ name: 'ring5', color: 0xffcf3a, roughness: 0.75, flatShading: true });
const strawMat = new THREE.MeshStandardMaterial({ name: 'straw', color: 0xd9b866, roughness: 1, flatShading: true });
const strawDarkMat = new THREE.MeshStandardMaterial({ name: 'strawDark', color: 0xb08e45, roughness: 1, flatShading: true });
const woodMat = new THREE.MeshStandardMaterial({ name: 'wood', color: 0x8a5a2b, roughness: 0.85, flatShading: true });
const shaftMat = new THREE.MeshStandardMaterial({ name: 'shaft', color: 0xc89b5e, roughness: 0.7, flatShading: true });
const fletchMat = new THREE.MeshStandardMaterial({ name: 'fletch', color: 0xe23b2e, roughness: 0.7, flatShading: true });
// Shared geometries
const boxGeo = new THREE.BoxGeometry(0.07, 1.6498, 0.07);
const cylinderGeo = new THREE.CylinderGeometry(0.012, 0.012, 0.62, 5);
const boxGeo2 = new THREE.BoxGeometry(0.004, 0.11, 0.045);
const cylinderGeo2 = new THREE.CylinderGeometry(0.016, 0.016, 0.03, 5);
// Parts
const legLeft = new THREE.Mesh(boxGeo, woodMat);
legLeft.name = 'legLeft';
legLeft.position.set(-0.24, 0.7834, 0.0231);
legLeft.rotation.set(deg(-21.4168), deg(-30.9954), deg(-11.4194));
root.add(legLeft);
const legRight = new THREE.Mesh(boxGeo, woodMat);
legRight.name = 'legRight';
legRight.position.set(0.24, 0.7834, 0.0231);
legRight.rotation.set(deg(-21.4168), deg(30.9954), deg(11.4194));
root.add(legRight);
const legBack = new THREE.Mesh(new THREE.BoxGeometry(0.07, 1.5515, 0.07), woodMat);
legBack.name = 'legBack';
legBack.position.set(0, 0.7584, -0.3969);
legBack.rotation.set(deg(-167.8672), 0, deg(-180));
root.add(legBack);
const legCap = new THREE.Mesh(new THREE.BoxGeometry(0.12, 0.12, 0.1), woodMat);
legCap.name = 'legCap';
legCap.position.set(0, 1.5669, -0.1939);
root.add(legCap);
const ledge = new THREE.Mesh(new THREE.BoxGeometry(0.98, 0.06, 0.22), woodMat);
ledge.name = 'ledge';
ledge.position.set(0, 0.47, 0.0101);
root.add(ledge);
const box6 = new THREE.Mesh(new THREE.BoxGeometry(0.98, 0.06, 0.04), woodMat);
box6.position.set(0, 0.5, 0.1001);
root.add(box6);
const targetFace = new THREE.Group();
targetFace.name = 'targetFace';
targetFace.position.set(0, 1.1169, -0.0499);
targetFace.rotation.set(deg(-12), 0, 0);
root.add(targetFace);
const boss = new THREE.Mesh(new THREE.CylinderGeometry(0.6, 0.6, 0.16, 20), strawMat);
boss.name = 'boss';
boss.rotation.set(deg(90), 0, 0);
targetFace.add(boss);
const bossBand = new THREE.Mesh(new THREE.TorusGeometry(0.6, 0.025, 4, 20), strawDarkMat);
bossBand.name = 'bossBand';
targetFace.add(bossBand);
const ring1 = new THREE.Mesh(new THREE.CircleGeometry(0.564, 20), ring1Mat);
ring1.name = 'ring1';
ring1.position.set(0, 0, 0.083);
targetFace.add(ring1);
const ring2 = new THREE.Mesh(new THREE.CircleGeometry(0.4512, 20), ring2Mat);
ring2.name = 'ring2';
ring2.position.set(0, 0, 0.086);
targetFace.add(ring2);
const ring3 = new THREE.Mesh(new THREE.CircleGeometry(0.3384, 20), ring3Mat);
ring3.name = 'ring3';
ring3.position.set(0, 0, 0.089);
targetFace.add(ring3);
const ring4 = new THREE.Mesh(new THREE.CircleGeometry(0.2256, 20), ring4Mat);
ring4.name = 'ring4';
ring4.position.set(0, 0, 0.092);
targetFace.add(ring4);
const ring5 = new THREE.Mesh(new THREE.CircleGeometry(0.1128, 20), ring5Mat);
ring5.name = 'ring5';
ring5.position.set(0, 0, 0.095);
targetFace.add(ring5);
const arrow1 = new THREE.Group();
arrow1.name = 'arrow1';
arrow1.position.set(0.06, 0.048, 0.08);
arrow1.rotation.set(deg(84), 0, deg(8));
targetFace.add(arrow1);
const cylinder16 = new THREE.Mesh(cylinderGeo, shaftMat);
cylinder16.position.set(0, 0.21, 0);
arrow1.add(cylinder16);
const box17 = new THREE.Mesh(boxGeo2, fletchMat);
box17.position.set(0, 0.44, 0.025);
arrow1.add(box17);
const box18 = new THREE.Mesh(boxGeo2, fletchMat);
box18.position.set(0.0217, 0.44, -0.0125);
box18.rotation.set(0, deg(120), 0);
arrow1.add(box18);
const box19 = new THREE.Mesh(boxGeo2, fletchMat);
box19.position.set(-0.0217, 0.44, -0.0125);
box19.rotation.set(0, deg(240), 0);
arrow1.add(box19);
const cylinder20 = new THREE.Mesh(cylinderGeo2, woodMat);
cylinder20.position.set(0, 0.525, 0);
arrow1.add(cylinder20);
const arrow2 = new THREE.Group();
arrow2.name = 'arrow2';
arrow2.position.set(-0.252, 0.18, 0.08);
arrow2.rotation.set(deg(94), 0, deg(-12));
targetFace.add(arrow2);
const cylinder22 = new THREE.Mesh(cylinderGeo, shaftMat);
cylinder22.position.set(0, 0.21, 0);
arrow2.add(cylinder22);
const box23 = new THREE.Mesh(boxGeo2, fletchMat);
box23.position.set(0, 0.44, 0.025);
arrow2.add(box23);
const box24 = new THREE.Mesh(boxGeo2, fletchMat);
box24.position.set(0.0217, 0.44, -0.0125);
box24.rotation.set(0, deg(120), 0);
arrow2.add(box24);
const box25 = new THREE.Mesh(boxGeo2, fletchMat);
box25.position.set(-0.0217, 0.44, -0.0125);
box25.rotation.set(0, deg(240), 0);
arrow2.add(box25);
const cylinder26 = new THREE.Mesh(cylinderGeo2, woodMat);
cylinder26.position.set(0, 0.525, 0);
arrow2.add(cylinder26);
const arrow3 = new THREE.Group();
arrow3.name = 'arrow3';
arrow3.position.set(0.21, -0.24, 0.08);
arrow3.rotation.set(deg(80), 0, deg(14));
targetFace.add(arrow3);
const cylinder28 = new THREE.Mesh(cylinderGeo, shaftMat);
cylinder28.position.set(0, 0.21, 0);
arrow3.add(cylinder28);
const box29 = new THREE.Mesh(boxGeo2, fletchMat);
box29.position.set(0, 0.44, 0.025);
arrow3.add(box29);
const box30 = new THREE.Mesh(boxGeo2, fletchMat);
box30.position.set(0.0217, 0.44, -0.0125);
box30.rotation.set(0, deg(120), 0);
arrow3.add(box30);
const box31 = new THREE.Mesh(boxGeo2, fletchMat);
box31.position.set(-0.0217, 0.44, -0.0125);
box31.rotation.set(0, deg(240), 0);
arrow3.add(box31);
const cylinder32 = new THREE.Mesh(cylinderGeo2, woodMat);
cylinder32.position.set(0, 0.525, 0);
arrow3.add(cylinder32);
root.traverse((o) => {
if (o.isMesh) {
o.castShadow = true;
o.receiveShadow = true;
}
});
return root;
}
export default createTarget;
Оценки и комментарии
0 комментариев
Комментариев пока нет. Расскажите, как вы использовали эту модель или что можно улучшить.
Похожие модели
Та же категория или похожие теги









