440 ポリゴン0.56 × 1.09 × 1.37 m
コードで使う
エディターでリミックスbear.js · 215 行
自己完結型の ES モジュールで、依存先は three のみです。ファクトリー関数を呼び出し、返された group をシーンに追加してください。
/**
* Bear — Codels 3D model library
* License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
* Triangles: 440 · Size (W × H × D): 0.56 × 1.09 × 1.37 m
*
* Usage:
* import { createBear } from './bear.js';
*
* const model = createBear();
* model.position.set(0, 0, 0);
* scene.add(model);
*/
import * as THREE from 'three';
const deg = THREE.MathUtils.degToRad;
export function createBear() {
const root = new THREE.Group();
root.name = 'Bear';
// Materials
const furMat = new THREE.MeshStandardMaterial({ name: 'fur', color: 0x8a5a3a, roughness: 0.95, flatShading: true });
const darkMat = new THREE.MeshStandardMaterial({ name: 'dark', color: 0x4f3324, roughness: 0.9, flatShading: true });
const muzzleMat = new THREE.MeshStandardMaterial({ name: 'muzzle', color: 0xc99d70, roughness: 0.95, flatShading: true });
const innerMat = new THREE.MeshStandardMaterial({ name: 'inner', color: 0xc99d70, roughness: 0.9, flatShading: true });
const noseMat = new THREE.MeshStandardMaterial({ name: 'nose', color: 0x1b1719, roughness: 0.35, flatShading: true });
const shineMat = new THREE.MeshStandardMaterial({ name: 'shine', color: 0xffffff, roughness: 0.3, flatShading: true });
const clawMat = new THREE.MeshStandardMaterial({ name: 'claw', color: 0xefe6d2, roughness: 0.6, flatShading: true });
// Shared geometries
const boxGeo = new THREE.BoxGeometry(0.2, 0.3, 0.23);
const boxGeo2 = new THREE.BoxGeometry(0.22, 0.09, 0.27);
const boxGeo3 = new THREE.BoxGeometry(0.03, 0.03, 0.04);
const boxGeo4 = new THREE.BoxGeometry(0.055, 0.065, 0.012);
const boxGeo5 = new THREE.BoxGeometry(0.02, 0.02, 0.006);
const cylinderGeo = new THREE.CylinderGeometry(0.08, 0.08, 0.06, 8);
const cylinderGeo2 = new THREE.CylinderGeometry(0.048, 0.048, 0.02, 8);
// Parts
const bear = new THREE.Group();
bear.name = 'bear';
root.add(bear);
const legFL = new THREE.Group();
legFL.name = 'legFL';
legFL.position.set(0.17, 0.38, 0.27);
bear.add(legFL);
const legFLLeg = new THREE.Mesh(boxGeo, furMat);
legFLLeg.name = 'legFLLeg';
legFLLeg.position.set(0, -0.15, 0);
legFL.add(legFLLeg);
const legFLPaw = new THREE.Mesh(boxGeo2, darkMat);
legFLPaw.name = 'legFLPaw';
legFLPaw.position.set(0, -0.335, 0.02);
legFL.add(legFLPaw);
const claw = new THREE.Mesh(boxGeo3, clawMat);
claw.name = 'claw';
claw.position.set(-0.06, -0.365, 0.165);
legFL.add(claw);
const claw2 = new THREE.Mesh(boxGeo3, clawMat);
claw2.name = 'claw';
claw2.position.set(0, -0.365, 0.165);
legFL.add(claw2);
const claw3 = new THREE.Mesh(boxGeo3, clawMat);
claw3.name = 'claw';
claw3.position.set(0.06, -0.365, 0.165);
legFL.add(claw3);
const legFR = new THREE.Group();
legFR.name = 'legFR';
legFR.position.set(-0.17, 0.38, 0.27);
bear.add(legFR);
const legFRLeg = new THREE.Mesh(boxGeo, furMat);
legFRLeg.name = 'legFRLeg';
legFRLeg.position.set(0, -0.15, 0);
legFR.add(legFRLeg);
const legFRPaw = new THREE.Mesh(boxGeo2, darkMat);
legFRPaw.name = 'legFRPaw';
legFRPaw.position.set(0, -0.335, 0.02);
legFR.add(legFRPaw);
const claw4 = new THREE.Mesh(boxGeo3, clawMat);
claw4.name = 'claw';
claw4.position.set(-0.06, -0.365, 0.165);
legFR.add(claw4);
const claw5 = new THREE.Mesh(boxGeo3, clawMat);
claw5.name = 'claw';
claw5.position.set(0, -0.365, 0.165);
legFR.add(claw5);
const claw6 = new THREE.Mesh(boxGeo3, clawMat);
claw6.name = 'claw';
claw6.position.set(0.06, -0.365, 0.165);
legFR.add(claw6);
const legBL = new THREE.Group();
legBL.name = 'legBL';
legBL.position.set(0.17, 0.38, -0.3);
bear.add(legBL);
const legBLLeg = new THREE.Mesh(boxGeo, furMat);
legBLLeg.name = 'legBLLeg';
legBLLeg.position.set(0, -0.15, 0);
legBL.add(legBLLeg);
const legBLPaw = new THREE.Mesh(boxGeo2, darkMat);
legBLPaw.name = 'legBLPaw';
legBLPaw.position.set(0, -0.335, 0.02);
legBL.add(legBLPaw);
const legBR = new THREE.Group();
legBR.name = 'legBR';
legBR.position.set(-0.17, 0.38, -0.3);
bear.add(legBR);
const legBRLeg = new THREE.Mesh(boxGeo, furMat);
legBRLeg.name = 'legBRLeg';
legBRLeg.position.set(0, -0.15, 0);
legBR.add(legBRLeg);
const legBRPaw = new THREE.Mesh(boxGeo2, darkMat);
legBRPaw.name = 'legBRPaw';
legBRPaw.position.set(0, -0.335, 0.02);
legBR.add(legBRPaw);
const body = new THREE.Group();
body.name = 'body';
bear.add(body);
const torso = new THREE.Mesh(new THREE.BoxGeometry(0.56, 0.48, 0.88), furMat);
torso.name = 'torso';
torso.position.set(0, 0.56, 0);
body.add(torso);
const belly = new THREE.Mesh(new THREE.BoxGeometry(0.44, 0.012, 0.68), muzzleMat);
belly.name = 'belly';
belly.position.set(0, 0.314, 0);
body.add(belly);
const shoulderHump = new THREE.Mesh(new THREE.BoxGeometry(0.4, 0.09, 0.32), furMat);
shoulderHump.name = 'shoulderHump';
shoulderHump.position.set(0, 0.84, 0.18);
body.add(shoulderHump);
const tail = new THREE.Group();
tail.name = 'tail';
tail.position.set(0, 0.7, -0.44);
bear.add(tail);
const tailStub = new THREE.Mesh(new THREE.BoxGeometry(0.1, 0.09, 0.08), furMat);
tailStub.name = 'tailStub';
tailStub.position.set(0, 0, -0.03);
tail.add(tailStub);
const head = new THREE.Group();
head.name = 'head';
head.position.set(0, 0.68, 0.39);
bear.add(head);
const skull = new THREE.Mesh(new THREE.BoxGeometry(0.46, 0.4, 0.38), furMat);
skull.name = 'skull';
skull.position.set(0, 0.1, 0.14);
head.add(skull);
const muzzle = new THREE.Mesh(new THREE.BoxGeometry(0.22, 0.15, 0.13), muzzleMat);
muzzle.name = 'muzzle';
muzzle.position.set(0, -0.01, 0.39);
head.add(muzzle);
const nose = new THREE.Mesh(new THREE.BoxGeometry(0.1, 0.06, 0.04), noseMat);
nose.name = 'nose';
nose.position.set(0, 0.04, 0.45);
head.add(nose);
const mouthLine = new THREE.Mesh(new THREE.BoxGeometry(0.012, 0.05, 0.012), noseMat);
mouthLine.name = 'mouthLine';
mouthLine.position.set(0, -0.02, 0.457);
head.add(mouthLine);
const eyeL = new THREE.Mesh(boxGeo4, noseMat);
eyeL.name = 'eyeL';
eyeL.position.set(0.11, 0.15, 0.333);
head.add(eyeL);
const eyeShineL = new THREE.Mesh(boxGeo5, shineMat);
eyeShineL.name = 'eyeShineL';
eyeShineL.position.set(0.122, 0.165, 0.34);
head.add(eyeShineL);
const eyeR = new THREE.Mesh(boxGeo4, noseMat);
eyeR.name = 'eyeR';
eyeR.position.set(-0.11, 0.15, 0.333);
head.add(eyeR);
const eyeShineR = new THREE.Mesh(boxGeo5, shineMat);
eyeShineR.name = 'eyeShineR';
eyeShineR.position.set(-0.098, 0.165, 0.34);
head.add(eyeShineR);
const earL = new THREE.Group();
earL.name = 'earL';
earL.position.set(0.182, 0.28, 0.09);
earL.rotation.set(0, 0, deg(-15));
head.add(earL);
const earOuterL = new THREE.Mesh(cylinderGeo, furMat);
earOuterL.name = 'earOuterL';
earOuterL.position.set(0, 0.056, 0);
earOuterL.rotation.set(deg(90), 0, 0);
earL.add(earOuterL);
const earInnerL = new THREE.Mesh(cylinderGeo2, innerMat);
earInnerL.name = 'earInnerL';
earInnerL.position.set(0, 0.056, 0.025);
earInnerL.rotation.set(deg(90), 0, 0);
earL.add(earInnerL);
const earR = new THREE.Group();
earR.name = 'earR';
earR.position.set(-0.182, 0.28, 0.09);
earR.rotation.set(0, 0, deg(15));
head.add(earR);
const earOuterR = new THREE.Mesh(cylinderGeo, furMat);
earOuterR.name = 'earOuterR';
earOuterR.position.set(0, 0.056, 0);
earOuterR.rotation.set(deg(90), 0, 0);
earR.add(earOuterR);
const earInnerR = new THREE.Mesh(cylinderGeo2, innerMat);
earInnerR.name = 'earInnerR';
earInnerR.position.set(0, 0.056, 0.025);
earInnerR.rotation.set(deg(90), 0, 0);
earR.add(earInnerR);
root.traverse((o) => {
if (o.isMesh) {
o.castShadow = true;
o.receiveShadow = true;
}
});
return root;
}
export default createBear;
評価とコメント
0 件のコメント
まだコメントはありません。このモデルの使い方や改善できる点を共有しましょう。
関連モデル
同じカテゴリまたは似たタグ









