2588 ポリゴン1.24 × 1.95 × 1.77 m
コードで使う
エディターでリミックスdragon.js · 522 行
自己完結型の ES モジュールで、依存先は three のみです。ファクトリー関数を呼び出し、返された group をシーンに追加してください。
/**
* Dragon — Codels 3D model library
* License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
* Triangles: 2,588 · Size (W × H × D): 1.24 × 1.95 × 1.77 m
*
* Usage:
* import { createDragon } from './dragon.js';
*
* const model = createDragon();
* 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);
}
// Extrude a 2D outline along Z (centered). bevel = [thickness, size, segments].
function extrude(outline, depth, holes = [], bevel = null) {
const shape = new THREE.Shape(outline.map(([x, y]) => new THREE.Vector2(x, y)));
for (const hole of holes) shape.holes.push(new THREE.Path(hole.map(([x, y]) => new THREE.Vector2(x, y))));
const options = bevel
? { depth, bevelEnabled: true, bevelThickness: bevel[0], bevelSize: bevel[1], bevelSegments: bevel[2] }
: { depth, bevelEnabled: false };
return new THREE.ExtrudeGeometry(shape, options).translate(0, 0, -depth / 2);
}
// Tube along a smooth curve through the given points.
function tube(path, radius, tubularSegments, radialSegments, closed = false) {
const curve = new THREE.CatmullRomCurve3(path.map(([x, y, z]) => new THREE.Vector3(x, y, z)), closed);
return new THREE.TubeGeometry(curve, tubularSegments, radius, radialSegments, closed);
}
export function createDragon() {
const root = new THREE.Group();
root.name = 'Dragon';
// Materials
const scalesMat = new THREE.MeshStandardMaterial({ name: 'scales', color: 0x4fb36b, roughness: 0.6, flatShading: true });
const bellyMat = new THREE.MeshStandardMaterial({ name: 'belly', color: 0xf6d58e, roughness: 0.7, flatShading: true });
const plateMat = new THREE.MeshStandardMaterial({ name: 'plate', color: 0xc0a66f, roughness: 0.7, flatShading: true });
const wingMat = new THREE.MeshStandardMaterial({ name: 'wing', color: 0xe8735a, roughness: 0.65, flatShading: true });
const hornMat = new THREE.MeshStandardMaterial({ name: 'horn', color: 0xf3ead6, roughness: 0.5, flatShading: true });
const eyeMat = new THREE.MeshStandardMaterial({ name: 'eye', color: 0x17131b, roughness: 0.2, flatShading: true });
const shineMat = new THREE.MeshStandardMaterial({ name: 'shine', color: 0xffffff, roughness: 0.3, flatShading: true });
const blushMat = new THREE.MeshStandardMaterial({ name: 'blush', color: 0xf49a9a, roughness: 0.7, flatShading: true });
// Shared geometries
const latheGeo = lathe([[0, 0], [0.2, 0.02], [0.32, 0.1], [0.37, 0.25], [0.36, 0.42], [0.31, 0.6], [0.22, 0.75], [0.1, 0.84], [0, 0.86]], 10);
const sphereGeo = new THREE.SphereGeometry(0.2, 8, 6);
const sphereGeo2 = new THREE.SphereGeometry(0.15, 8, 5);
const coneGeo = new THREE.ConeGeometry(0.024, 0.07, 5);
const capsuleGeo = new THREE.CapsuleGeometry(0.07, 0.14, 2, 7);
const sphereGeo3 = new THREE.SphereGeometry(0.085, 7, 5);
const coneGeo2 = new THREE.ConeGeometry(0.017, 0.05, 4);
const cylinderGeo = new THREE.CylinderGeometry(0.028, 0.035, 0.5241, 5);
const cylinderGeo2 = new THREE.CylinderGeometry(0.012, 0.026, 0.2978, 5);
const cylinderGeo3 = new THREE.CylinderGeometry(0.01, 0.02, 0.3311, 4);
const cylinderGeo4 = new THREE.CylinderGeometry(0.01, 0.02, 0.4231, 4);
const cylinderGeo5 = new THREE.CylinderGeometry(0.01, 0.02, 0.5387, 4);
const coneGeo3 = new THREE.ConeGeometry(0.025, 0.08, 4);
const sphereGeo4 = new THREE.SphereGeometry(0.022, 5, 4);
const sphereGeo5 = new THREE.SphereGeometry(0.068, 8, 6);
const sphereGeo6 = new THREE.SphereGeometry(0.012, 4, 3);
const sphereGeo7 = new THREE.SphereGeometry(0.05, 6, 4);
const cylinderGeo6 = new THREE.CylinderGeometry(0.035, 0.058, 0.14, 6);
const coneGeo4 = new THREE.ConeGeometry(0.035, 0.16, 6);
const coneGeo5 = new THREE.ConeGeometry(0.016, 0.04, 4);
// Parts
const body = new THREE.Group();
body.name = 'body';
root.add(body);
const torso = new THREE.Mesh(latheGeo, scalesMat);
torso.name = 'torso';
torso.position.set(0, 0.28, 0);
body.add(torso);
const bellyFront = new THREE.Mesh(latheGeo, bellyMat);
bellyFront.name = 'bellyFront';
bellyFront.position.set(0, 0.29, 0.065);
bellyFront.scale.set(0.76, 0.86, 1);
body.add(bellyFront);
const bellyPlate1 = new THREE.Mesh(new THREE.CylinderGeometry(0.3567, 0.3567, 0.022, 10, 1, true, -0.85, 1.7), plateMat);
bellyPlate1.name = 'bellyPlate1';
bellyPlate1.position.set(0, 0.45, 0.065);
bellyPlate1.scale.set(0.76, 1, 1);
body.add(bellyPlate1);
const bellyPlate2 = new THREE.Mesh(new THREE.CylinderGeometry(0.3722, 0.3722, 0.022, 10, 1, true, -0.85, 1.7), plateMat);
bellyPlate2.name = 'bellyPlate2';
bellyPlate2.position.set(0, 0.59, 0.065);
bellyPlate2.scale.set(0.76, 1, 1);
body.add(bellyPlate2);
const bellyPlate3 = new THREE.Mesh(new THREE.CylinderGeometry(0.3425, 0.3425, 0.022, 10, 1, true, -0.85, 1.7), plateMat);
bellyPlate3.name = 'bellyPlate3';
bellyPlate3.position.set(0, 0.73, 0.065);
bellyPlate3.scale.set(0.76, 1, 1);
body.add(bellyPlate3);
const bellyPlate4 = new THREE.Mesh(new THREE.CylinderGeometry(0.2733, 0.2733, 0.022, 10, 1, true, -0.85, 1.7), plateMat);
bellyPlate4.name = 'bellyPlate4';
bellyPlate4.position.set(0, 0.87, 0.065);
bellyPlate4.scale.set(0.76, 1, 1);
body.add(bellyPlate4);
const backSpine1 = new THREE.Mesh(new THREE.ConeGeometry(0.055, 0.13, 5), wingMat);
backSpine1.name = 'backSpine1';
backSpine1.position.set(0, 1, -0.218);
backSpine1.rotation.set(deg(-70.71), 0, 0);
body.add(backSpine1);
const backSpine2 = new THREE.Mesh(new THREE.ConeGeometry(0.051, 0.13, 5), wingMat);
backSpine2.name = 'backSpine2';
backSpine2.position.set(0, 0.86, -0.2956);
backSpine2.rotation.set(deg(-70.71), 0, 0);
body.add(backSpine2);
const backSpine3 = new THREE.Mesh(new THREE.ConeGeometry(0.047, 0.13, 5), wingMat);
backSpine3.name = 'backSpine3';
backSpine3.position.set(0, 0.71, -0.3372);
backSpine3.rotation.set(deg(-70.71), 0, 0);
body.add(backSpine3);
const backSpine4 = new THREE.Mesh(new THREE.ConeGeometry(0.043, 0.13, 5), wingMat);
backSpine4.name = 'backSpine4';
backSpine4.position.set(0, 0.56, -0.3482);
backSpine4.rotation.set(deg(-70.71), 0, 0);
body.add(backSpine4);
const legL = new THREE.Group();
legL.name = 'legL';
legL.position.set(0.19, 0.42, 0);
root.add(legL);
const thighL = new THREE.Mesh(sphereGeo, scalesMat);
thighL.name = 'thighL';
thighL.position.set(0, -0.1, 0.02);
thighL.scale.set(0.9, 1, 1.05);
legL.add(thighL);
const footL = new THREE.Mesh(sphereGeo2, scalesMat);
footL.name = 'footL';
footL.position.set(0, -0.3375, 0.06);
footL.scale.set(0.9, 0.55, 1.3);
legL.add(footL);
const toeClawL = new THREE.Mesh(coneGeo, hornMat);
toeClawL.name = 'toeClawL';
toeClawL.position.set(-0.06, -0.39, 0.25);
toeClawL.rotation.set(deg(90), 0, 0);
legL.add(toeClawL);
const toeClawL2 = new THREE.Mesh(coneGeo, hornMat);
toeClawL2.name = 'toeClawL';
toeClawL2.position.set(0, -0.39, 0.25);
toeClawL2.rotation.set(deg(90), 0, 0);
legL.add(toeClawL2);
const toeClawL3 = new THREE.Mesh(coneGeo, hornMat);
toeClawL3.name = 'toeClawL';
toeClawL3.position.set(0.06, -0.39, 0.25);
toeClawL3.rotation.set(deg(90), 0, 0);
legL.add(toeClawL3);
const legR = new THREE.Group();
legR.name = 'legR';
legR.position.set(-0.19, 0.42, 0);
root.add(legR);
const thighR = new THREE.Mesh(sphereGeo, scalesMat);
thighR.name = 'thighR';
thighR.position.set(0, -0.1, 0.02);
thighR.scale.set(0.9, 1, 1.05);
legR.add(thighR);
const footR = new THREE.Mesh(sphereGeo2, scalesMat);
footR.name = 'footR';
footR.position.set(0, -0.3375, 0.06);
footR.scale.set(0.9, 0.55, 1.3);
legR.add(footR);
const toeClawR = new THREE.Mesh(coneGeo, hornMat);
toeClawR.name = 'toeClawR';
toeClawR.position.set(-0.06, -0.39, 0.25);
toeClawR.rotation.set(deg(90), 0, 0);
legR.add(toeClawR);
const toeClawR2 = new THREE.Mesh(coneGeo, hornMat);
toeClawR2.name = 'toeClawR';
toeClawR2.position.set(0, -0.39, 0.25);
toeClawR2.rotation.set(deg(90), 0, 0);
legR.add(toeClawR2);
const toeClawR3 = new THREE.Mesh(coneGeo, hornMat);
toeClawR3.name = 'toeClawR';
toeClawR3.position.set(0.06, -0.39, 0.25);
toeClawR3.rotation.set(deg(90), 0, 0);
legR.add(toeClawR3);
const armL = new THREE.Group();
armL.name = 'armL';
armL.position.set(0.3, 0.86, 0.1);
armL.rotation.set(deg(-55), 0, deg(12));
root.add(armL);
const upperArmL = new THREE.Mesh(capsuleGeo, scalesMat);
upperArmL.name = 'upperArmL';
upperArmL.position.set(0, -0.1, 0);
armL.add(upperArmL);
const handL = new THREE.Mesh(sphereGeo3, scalesMat);
handL.name = 'handL';
handL.position.set(0, -0.23, 0.01);
armL.add(handL);
const fingerClawL = new THREE.Mesh(coneGeo2, hornMat);
fingerClawL.name = 'fingerClawL';
fingerClawL.position.set(-0.035, -0.29, 0.05);
fingerClawL.rotation.set(deg(150), 0, 0);
armL.add(fingerClawL);
const fingerClawL2 = new THREE.Mesh(coneGeo2, hornMat);
fingerClawL2.name = 'fingerClawL';
fingerClawL2.position.set(0, -0.29, 0.05);
fingerClawL2.rotation.set(deg(150), 0, 0);
armL.add(fingerClawL2);
const fingerClawL3 = new THREE.Mesh(coneGeo2, hornMat);
fingerClawL3.name = 'fingerClawL';
fingerClawL3.position.set(0.035, -0.29, 0.05);
fingerClawL3.rotation.set(deg(150), 0, 0);
armL.add(fingerClawL3);
const armR = new THREE.Group();
armR.name = 'armR';
armR.position.set(-0.3, 0.86, 0.1);
armR.rotation.set(deg(-55), 0, deg(-12));
root.add(armR);
const upperArmR = new THREE.Mesh(capsuleGeo, scalesMat);
upperArmR.name = 'upperArmR';
upperArmR.position.set(0, -0.1, 0);
armR.add(upperArmR);
const handR = new THREE.Mesh(sphereGeo3, scalesMat);
handR.name = 'handR';
handR.position.set(0, -0.23, 0.01);
armR.add(handR);
const fingerClawR = new THREE.Mesh(coneGeo2, hornMat);
fingerClawR.name = 'fingerClawR';
fingerClawR.position.set(-0.035, -0.29, 0.05);
fingerClawR.rotation.set(deg(150), 0, 0);
armR.add(fingerClawR);
const fingerClawR2 = new THREE.Mesh(coneGeo2, hornMat);
fingerClawR2.name = 'fingerClawR';
fingerClawR2.position.set(0, -0.29, 0.05);
fingerClawR2.rotation.set(deg(150), 0, 0);
armR.add(fingerClawR2);
const fingerClawR3 = new THREE.Mesh(coneGeo2, hornMat);
fingerClawR3.name = 'fingerClawR';
fingerClawR3.position.set(0.035, -0.29, 0.05);
fingerClawR3.rotation.set(deg(150), 0, 0);
armR.add(fingerClawR3);
const wingL = new THREE.Group();
wingL.name = 'wingL';
wingL.position.set(0.14, 0.98, -0.22);
wingL.rotation.set(0, deg(38), deg(18));
wingL.scale.setScalar(1.35);
root.add(wingL);
const wingMembraneL = new THREE.Mesh(extrude([[0, 0.04], [0.3, 0.42], [0.54, 0.56], [0.52, 0.2], [0.43, 0.25], [0.35, 0.02], [0.24, 0.1], [0.13, -0.07], [0.05, -0.02]], 0.018), wingMat);
wingMembraneL.name = 'wingMembraneL';
wingL.add(wingMembraneL);
const wingArmL = new THREE.Mesh(cylinderGeo, scalesMat);
wingArmL.name = 'wingArmL';
wingArmL.position.set(0.15, 0.23, 0);
wingArmL.rotation.set(0, 0, deg(-38.2902));
wingL.add(wingArmL);
const wingFingerL1 = new THREE.Mesh(cylinderGeo2, scalesMat);
wingFingerL1.name = 'wingFingerL1';
wingFingerL1.position.set(0.42, 0.49, 0);
wingFingerL1.rotation.set(0, 0, deg(-59.7436));
wingL.add(wingFingerL1);
const wingFingerL2 = new THREE.Mesh(cylinderGeo3, scalesMat);
wingFingerL2.name = 'wingFingerL2';
wingFingerL2.position.set(0.41, 0.31, 0);
wingFingerL2.rotation.set(0, 0, deg(-135));
wingL.add(wingFingerL2);
const wingFingerL3 = new THREE.Mesh(cylinderGeo4, scalesMat);
wingFingerL3.name = 'wingFingerL3';
wingFingerL3.position.set(0.325, 0.22, 0);
wingFingerL3.rotation.set(0, 0, deg(-172.875));
wingL.add(wingFingerL3);
const wingFingerL4 = new THREE.Mesh(cylinderGeo5, scalesMat);
wingFingerL4.name = 'wingFingerL4';
wingFingerL4.position.set(0.215, 0.175, 0);
wingFingerL4.rotation.set(0, 0, deg(160.8664));
wingL.add(wingFingerL4);
const wingThumbL = new THREE.Mesh(coneGeo3, hornMat);
wingThumbL.name = 'wingThumbL';
wingThumbL.position.set(0.31, 0.47, 0);
wingThumbL.rotation.set(0, 0, deg(-20));
wingL.add(wingThumbL);
const wingR = new THREE.Group();
wingR.name = 'wingR';
wingR.position.set(-0.14, 0.98, -0.22);
wingR.rotation.set(0, deg(-38), deg(-18));
wingR.scale.setScalar(1.35);
root.add(wingR);
const wingMembraneR = new THREE.Mesh(extrude([[0, 0.04], [-0.3, 0.42], [-0.54, 0.56], [-0.52, 0.2], [-0.43, 0.25], [-0.35, 0.02], [-0.24, 0.1], [-0.13, -0.07], [-0.05, -0.02]], 0.018), wingMat);
wingMembraneR.name = 'wingMembraneR';
wingR.add(wingMembraneR);
const wingArmR = new THREE.Mesh(cylinderGeo, scalesMat);
wingArmR.name = 'wingArmR';
wingArmR.position.set(-0.15, 0.23, 0);
wingArmR.rotation.set(0, 0, deg(38.2902));
wingR.add(wingArmR);
const wingFingerR1 = new THREE.Mesh(cylinderGeo2, scalesMat);
wingFingerR1.name = 'wingFingerR1';
wingFingerR1.position.set(-0.42, 0.49, 0);
wingFingerR1.rotation.set(0, 0, deg(59.7436));
wingR.add(wingFingerR1);
const wingFingerR2 = new THREE.Mesh(cylinderGeo3, scalesMat);
wingFingerR2.name = 'wingFingerR2';
wingFingerR2.position.set(-0.41, 0.31, 0);
wingFingerR2.rotation.set(0, 0, deg(135));
wingR.add(wingFingerR2);
const wingFingerR3 = new THREE.Mesh(cylinderGeo4, scalesMat);
wingFingerR3.name = 'wingFingerR3';
wingFingerR3.position.set(-0.325, 0.22, 0);
wingFingerR3.rotation.set(0, 0, deg(172.875));
wingR.add(wingFingerR3);
const wingFingerR4 = new THREE.Mesh(cylinderGeo5, scalesMat);
wingFingerR4.name = 'wingFingerR4';
wingFingerR4.position.set(-0.215, 0.175, 0);
wingFingerR4.rotation.set(0, 0, deg(-160.8664));
wingR.add(wingFingerR4);
const wingThumbR = new THREE.Mesh(coneGeo3, hornMat);
wingThumbR.name = 'wingThumbR';
wingThumbR.position.set(-0.31, 0.47, 0);
wingThumbR.rotation.set(0, 0, deg(20));
wingR.add(wingThumbR);
const tail = new THREE.Group();
tail.name = 'tail';
tail.position.set(0, 0.44, -0.24);
root.add(tail);
const tailSeg1 = new THREE.Mesh(new THREE.CylinderGeometry(0.13, 0.17, 0.3602, 7), scalesMat);
tailSeg1.name = 'tailSeg1';
tailSeg1.position.set(0, -0.1, -0.125);
tailSeg1.rotation.set(deg(-128.6598), 0, 0);
tail.add(tailSeg1);
const tailSpine1 = new THREE.Mesh(new THREE.ConeGeometry(0.035, 0.09, 4), wingMat);
tailSpine1.name = 'tailSpine1';
tailSpine1.position.set(0, 0.0275, -0.125);
tailSpine1.rotation.set(deg(-21.8014), 0, 0);
tail.add(tailSpine1);
const tailSeg2 = new THREE.Mesh(new THREE.CylinderGeometry(0.09, 0.13, 0.3182, 7), scalesMat);
tailSeg2.name = 'tailSeg2';
tailSeg2.position.set(0.035, -0.25, -0.375);
tailSeg2.rotation.set(deg(-106.173), deg(20.6691), deg(-15.5999));
tail.add(tailSeg2);
const tailJoint1 = new THREE.Mesh(new THREE.SphereGeometry(0.13, 7, 5), scalesMat);
tailJoint1.name = 'tailJoint1';
tailJoint1.position.set(0, -0.2, -0.25);
tail.add(tailJoint1);
const tailSpine2 = new THREE.Mesh(new THREE.ConeGeometry(0.031, 0.082, 4), wingMat);
tailSpine2.name = 'tailSpine2';
tailSpine2.position.set(0.035, -0.1565, -0.375);
tailSpine2.rotation.set(deg(-21.8014), 0, 0);
tail.add(tailSpine2);
const tailSeg3 = new THREE.Mesh(new THREE.CylinderGeometry(0.062, 0.09, 0.2741, 7), scalesMat);
tailSeg3.name = 'tailSeg3';
tailSeg3.position.set(0.13, -0.29, -0.6);
tailSeg3.rotation.set(deg(-69.0252), deg(23.7962), deg(-34.0726));
tail.add(tailSeg3);
const tailJoint2 = new THREE.Mesh(new THREE.SphereGeometry(0.09, 7, 5), scalesMat);
tailJoint2.name = 'tailJoint2';
tailJoint2.position.set(0.07, -0.3, -0.5);
tail.add(tailJoint2);
const tailSpine3 = new THREE.Mesh(new THREE.ConeGeometry(0.027, 0.074, 4), wingMat);
tailSpine3.name = 'tailSpine3';
tailSpine3.position.set(0.13, -0.2254, -0.6);
tailSpine3.rotation.set(deg(-21.8014), 0, 0);
tail.add(tailSpine3);
const tailSeg4 = new THREE.Mesh(new THREE.CylinderGeometry(0.04, 0.062, 0.2483, 7), scalesMat);
tailSeg4.name = 'tailSeg4';
tailSeg4.position.set(0.25, -0.225, -0.765);
tailSeg4.rotation.set(deg(-39.9439), deg(13.6056), deg(-36.3452));
tail.add(tailSeg4);
const tailJoint3 = new THREE.Mesh(new THREE.SphereGeometry(0.062, 7, 5), scalesMat);
tailJoint3.name = 'tailJoint3';
tailJoint3.position.set(0.19, -0.28, -0.7);
tail.add(tailJoint3);
const tailSpine4 = new THREE.Mesh(new THREE.ConeGeometry(0.023, 0.066, 4), wingMat);
tailSpine4.name = 'tailSpine4';
tailSpine4.position.set(0.25, -0.1817, -0.765);
tailSpine4.rotation.set(deg(-21.8014), 0, 0);
tail.add(tailSpine4);
const tailSpade = new THREE.Mesh(extrude([[0, -0.02], [0.1, 0.07], [0, 0.22], [-0.1, 0.07]], 0.03), wingMat);
tailSpade.name = 'tailSpade';
tailSpade.position.set(0.31, -0.17, -0.83);
tailSpade.rotation.set(deg(67.7856), deg(51.523), deg(-112.2144));
tailSpade.scale.setScalar(1.45);
tail.add(tailSpade);
const head = new THREE.Group();
head.name = 'head';
head.position.set(0, 1.06, 0.05);
root.add(head);
const cranium = new THREE.Mesh(new THREE.SphereGeometry(0.3, 10, 8), scalesMat);
cranium.name = 'cranium';
cranium.position.set(0, 0.27, 0);
cranium.scale.set(1.1, 0.92, 1);
head.add(cranium);
const snout = new THREE.Mesh(new THREE.SphereGeometry(0.2, 10, 6), scalesMat);
snout.name = 'snout';
snout.position.set(0, 0.17, 0.25);
snout.scale.set(1.05, 0.72, 1);
head.add(snout);
const jaw = new THREE.Mesh(new THREE.SphereGeometry(0.185, 10, 5), bellyMat);
jaw.name = 'jaw';
jaw.position.set(0, 0.1, 0.235);
jaw.scale.set(1, 0.5, 1);
head.add(jaw);
const nostrilL = new THREE.Mesh(sphereGeo4, eyeMat);
nostrilL.name = 'nostrilL';
nostrilL.position.set(0.06, 0.245, 0.43);
nostrilL.scale.set(1.2, 0.7, 0.6);
head.add(nostrilL);
const eyeL = new THREE.Mesh(sphereGeo5, eyeMat);
eyeL.name = 'eyeL';
eyeL.position.set(0.125, 0.33, 0.262);
eyeL.rotation.set(0, deg(20), 0);
eyeL.scale.set(0.85, 1.1, 0.5);
head.add(eyeL);
const eyeShineL = new THREE.Mesh(sphereGeo4, shineMat);
eyeShineL.name = 'eyeShineL';
eyeShineL.position.set(0.145, 0.36, 0.3);
head.add(eyeShineL);
const eyeShineSmallL = new THREE.Mesh(sphereGeo6, shineMat);
eyeShineSmallL.name = 'eyeShineSmallL';
eyeShineSmallL.position.set(0.11, 0.31, 0.3);
head.add(eyeShineSmallL);
const cheekL = new THREE.Mesh(sphereGeo7, blushMat);
cheekL.name = 'cheekL';
cheekL.position.set(0.215, 0.2, 0.2);
cheekL.rotation.set(0, deg(45), 0);
cheekL.scale.set(1, 0.55, 0.4);
head.add(cheekL);
const hornL = new THREE.Group();
hornL.name = 'hornL';
hornL.position.set(0.15, 0.48, -0.06);
hornL.rotation.set(deg(-28), 0, deg(-22));
head.add(hornL);
const hornBaseL = new THREE.Mesh(cylinderGeo6, hornMat);
hornBaseL.name = 'hornBaseL';
hornBaseL.position.set(0, 0.07, 0);
hornL.add(hornBaseL);
const hornTipL = new THREE.Mesh(coneGeo4, hornMat);
hornTipL.name = 'hornTipL';
hornTipL.position.set(0, 0.21, -0.04);
hornTipL.rotation.set(deg(-28), 0, 0);
hornL.add(hornTipL);
const earFrillL = new THREE.Mesh(extrude([[0, 0], [0.12, 0.1], [0.08, 0.02], [0.15, -0.02], [0.06, -0.06]], 0.02), wingMat);
earFrillL.name = 'earFrillL';
earFrillL.position.set(0.3, 0.3, -0.06);
earFrillL.rotation.set(0, deg(-30), 0);
head.add(earFrillL);
const fangL = new THREE.Mesh(coneGeo5, hornMat);
fangL.name = 'fangL';
fangL.position.set(0.08, 0.1, 0.405);
fangL.rotation.set(deg(180), 0, 0);
head.add(fangL);
const nostrilR = new THREE.Mesh(sphereGeo4, eyeMat);
nostrilR.name = 'nostrilR';
nostrilR.position.set(-0.06, 0.245, 0.43);
nostrilR.scale.set(1.2, 0.7, 0.6);
head.add(nostrilR);
const eyeR = new THREE.Mesh(sphereGeo5, eyeMat);
eyeR.name = 'eyeR';
eyeR.position.set(-0.125, 0.33, 0.262);
eyeR.rotation.set(0, deg(-20), 0);
eyeR.scale.set(0.85, 1.1, 0.5);
head.add(eyeR);
const eyeShineR = new THREE.Mesh(sphereGeo4, shineMat);
eyeShineR.name = 'eyeShineR';
eyeShineR.position.set(-0.105, 0.36, 0.3);
head.add(eyeShineR);
const eyeShineSmallR = new THREE.Mesh(sphereGeo6, shineMat);
eyeShineSmallR.name = 'eyeShineSmallR';
eyeShineSmallR.position.set(-0.14, 0.31, 0.3);
head.add(eyeShineSmallR);
const cheekR = new THREE.Mesh(sphereGeo7, blushMat);
cheekR.name = 'cheekR';
cheekR.position.set(-0.215, 0.2, 0.2);
cheekR.rotation.set(0, deg(-45), 0);
cheekR.scale.set(1, 0.55, 0.4);
head.add(cheekR);
const hornR = new THREE.Group();
hornR.name = 'hornR';
hornR.position.set(-0.15, 0.48, -0.06);
hornR.rotation.set(deg(-28), 0, deg(22));
head.add(hornR);
const hornBaseR = new THREE.Mesh(cylinderGeo6, hornMat);
hornBaseR.name = 'hornBaseR';
hornBaseR.position.set(0, 0.07, 0);
hornR.add(hornBaseR);
const hornTipR = new THREE.Mesh(coneGeo4, hornMat);
hornTipR.name = 'hornTipR';
hornTipR.position.set(0, 0.21, -0.04);
hornTipR.rotation.set(deg(-28), 0, 0);
hornR.add(hornTipR);
const earFrillR = new THREE.Mesh(extrude([[0, 0], [-0.12, 0.1], [-0.08, 0.02], [-0.15, -0.02], [-0.06, -0.06]], 0.02), wingMat);
earFrillR.name = 'earFrillR';
earFrillR.position.set(-0.3, 0.3, -0.06);
earFrillR.rotation.set(0, deg(30), 0);
head.add(earFrillR);
const fangR = new THREE.Mesh(coneGeo5, hornMat);
fangR.name = 'fangR';
fangR.position.set(-0.08, 0.1, 0.405);
fangR.rotation.set(deg(180), 0, 0);
head.add(fangR);
const headSpine1 = new THREE.Mesh(new THREE.ConeGeometry(0.04, 0.1, 4), wingMat);
headSpine1.name = 'headSpine1';
headSpine1.position.set(0, 0.5, -0.05);
headSpine1.rotation.set(deg(-26.5651), 0, 0);
head.add(headSpine1);
const headSpine2 = new THREE.Mesh(new THREE.ConeGeometry(0.032, 0.08, 4), wingMat);
headSpine2.name = 'headSpine2';
headSpine2.position.set(0, 0.45, -0.17);
headSpine2.rotation.set(deg(-26.5651), 0, 0);
head.add(headSpine2);
const smile = new THREE.Mesh(tube([[-0.12, 0.125, 0.37], [-0.05, 0.11, 0.425], [0.05, 0.11, 0.425], [0.12, 0.125, 0.37]], 0.01, 10, 4), eyeMat);
smile.name = 'smile';
head.add(smile);
root.traverse((o) => {
if (o.isMesh) {
o.castShadow = true;
o.receiveShadow = true;
}
});
return root;
}
export default createDragon;
評価とコメント
0 件のコメント
まだコメントはありません。このモデルの使い方や改善できる点を共有しましょう。
関連モデル
同じカテゴリまたは似たタグ









