1468 三角面5.08 × 5.66 × 4.83 m
在代码中使用
在编辑器中改编gazebo.js · 512 行
自包含的 ES 模块,仅依赖 three。调用工厂函数,然后把返回的 group 添加到场景中。
/**
* Garden Gazebo — Codels 3D model library
* License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
* Triangles: 1,468 · Size (W × H × D): 5.08 × 5.66 × 4.83 m
*
* Usage:
* import { createGazebo } from './gazebo.js';
*
* const model = createGazebo();
* 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);
}
// 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 createGazebo() {
const root = new THREE.Group();
root.name = 'Gazebo';
// Materials
const paintMat = new THREE.MeshStandardMaterial({ name: 'paint', color: 0xefe9dc, roughness: 0.75, flatShading: true });
const trimMat = new THREE.MeshStandardMaterial({ name: 'trim', color: 0xc4bfb4, roughness: 0.8, flatShading: true });
const floorMat = new THREE.MeshStandardMaterial({ name: 'floor', color: 0xa8764a, roughness: 0.9, flatShading: true });
const stoneMat = new THREE.MeshStandardMaterial({ name: 'stone', color: 0x9a948a, roughness: 0.95, flatShading: true });
const roofMat = new THREE.MeshStandardMaterial({ name: 'roof', color: 0x4f6f63, roughness: 0.8, flatShading: true });
const roof2Mat = new THREE.MeshStandardMaterial({ name: 'roof2', color: 0x466257, roughness: 0.8, flatShading: true });
const roofDarkMat = new THREE.MeshStandardMaterial({ name: 'roofDark', color: 0x364b43, roughness: 0.85, flatShading: true });
const metalMat = new THREE.MeshStandardMaterial({ name: 'metal', color: 0x3b3d40, roughness: 0.5, metalness: 0.6, flatShading: true });
const glowMat = new THREE.MeshStandardMaterial({ name: 'glow', color: 0xffd889, roughness: 0.4, emissive: 0xffb347, emissiveIntensity: 1.1, flatShading: true });
// Shared geometries
const boxGeo = new THREE.BoxGeometry(0.14, 2.35, 0.14);
const boxGeo2 = new THREE.BoxGeometry(0.2, 0.12, 0.2);
const boxGeo3 = new THREE.BoxGeometry(0.12, 2.12, 0.16);
const boxGeo4 = new THREE.BoxGeometry(0.06, 0.568, 0.07);
const boxGeo5 = new THREE.BoxGeometry(0.11, 2, 0.06);
const boxGeo6 = new THREE.BoxGeometry(0.07, 2, 0.06);
const boxGeo7 = new THREE.BoxGeometry(0.045, 0.72, 0.045);
// Parts
const plinth = new THREE.Mesh(new THREE.CylinderGeometry(2.3, 2.36, 0.32, 6, 1, false, Math.PI / 6), stoneMat);
plinth.name = 'plinth';
plinth.position.set(0, 0.16, 0);
root.add(plinth);
const deck = new THREE.Mesh(new THREE.CylinderGeometry(2.2, 2.2, 0.1, 6, 1, false, Math.PI / 6), floorMat);
deck.name = 'deck';
deck.position.set(0, 0.37, 0);
root.add(deck);
const deckEdge = new THREE.Mesh(new THREE.CylinderGeometry(2.22, 2.22, 0.04, 6, 1, true, Math.PI / 6), trimMat);
deckEdge.name = 'deckEdge';
deckEdge.position.set(0, 0.39, 0);
root.add(deckEdge);
const step = new THREE.Mesh(new THREE.BoxGeometry(2, 0.29, 0.3), stoneMat);
step.name = 'step';
step.position.set(0, 0.145, 2.1678);
root.add(step);
const step2 = new THREE.Mesh(new THREE.BoxGeometry(1.8, 0.15, 0.3), stoneMat);
step2.name = 'step';
step2.position.set(0, 0.075, 2.4678);
root.add(step2);
const post = new THREE.Mesh(boxGeo, paintMat);
post.name = 'post';
post.position.set(1, 1.595, 1.7321);
post.rotation.set(0, deg(30), 0);
root.add(post);
const postBase = new THREE.Mesh(boxGeo2, trimMat);
postBase.name = 'postBase';
postBase.position.set(1, 0.48, 1.7321);
postBase.rotation.set(0, deg(30), 0);
root.add(postBase);
const topBeam = new THREE.Mesh(boxGeo3, paintMat);
topBeam.name = 'topBeam';
topBeam.position.set(1.5, 2.69, 0.866);
topBeam.rotation.set(deg(-90), 0, deg(-30));
root.add(topBeam);
const bracket = new THREE.Mesh(boxGeo4, paintMat);
bracket.name = 'bracket';
bracket.position.set(1.08, 2.4, 1.5935);
bracket.rotation.set(deg(-41.3404), deg(-23.4355), deg(-19.2849));
root.add(bracket);
const bracket2 = new THREE.Mesh(boxGeo4, paintMat);
bracket2.name = 'bracket';
bracket2.position.set(0.84, 2.4, 1.7321);
bracket2.rotation.set(deg(-90), deg(52.6961), deg(90));
root.add(bracket2);
const post2 = new THREE.Mesh(boxGeo, paintMat);
post2.name = 'post';
post2.position.set(2, 1.595, 0);
post2.rotation.set(0, deg(90), 0);
root.add(post2);
const postBase2 = new THREE.Mesh(boxGeo2, trimMat);
postBase2.name = 'postBase';
postBase2.position.set(2, 0.48, 0);
postBase2.rotation.set(0, deg(90), 0);
root.add(postBase2);
const topBeam2 = new THREE.Mesh(boxGeo3, paintMat);
topBeam2.name = 'topBeam';
topBeam2.position.set(1.5, 2.69, -0.866);
topBeam2.rotation.set(deg(-90), 0, deg(30));
root.add(topBeam2);
const bracket3 = new THREE.Mesh(boxGeo4, paintMat);
bracket3.name = 'bracket';
bracket3.position.set(1.92, 2.4, -0.1386);
bracket3.rotation.set(deg(-41.3404), deg(23.4355), deg(19.2849));
root.add(bracket3);
const bracket4 = new THREE.Mesh(boxGeo4, paintMat);
bracket4.name = 'bracket';
bracket4.position.set(1.92, 2.4, 0.1386);
bracket4.rotation.set(deg(-138.6596), deg(23.4355), deg(160.7151));
root.add(bracket4);
const post3 = new THREE.Mesh(boxGeo, paintMat);
post3.name = 'post';
post3.position.set(1, 1.595, -1.7321);
post3.rotation.set(0, deg(150), 0);
root.add(post3);
const postBase3 = new THREE.Mesh(boxGeo2, trimMat);
postBase3.name = 'postBase';
postBase3.position.set(1, 0.48, -1.7321);
postBase3.rotation.set(0, deg(150), 0);
root.add(postBase3);
const topBeam3 = new THREE.Mesh(boxGeo3, paintMat);
topBeam3.name = 'topBeam';
topBeam3.position.set(0, 2.69, -1.7321);
topBeam3.rotation.set(deg(-90), 0, deg(90));
root.add(topBeam3);
const bracket5 = new THREE.Mesh(boxGeo4, paintMat);
bracket5.name = 'bracket';
bracket5.position.set(0.84, 2.4, -1.7321);
bracket5.rotation.set(deg(-90), deg(52.6961), deg(90));
root.add(bracket5);
const bracket6 = new THREE.Mesh(boxGeo4, paintMat);
bracket6.name = 'bracket';
bracket6.position.set(1.08, 2.4, -1.5935);
bracket6.rotation.set(deg(-138.6596), deg(-23.4355), deg(-160.7151));
root.add(bracket6);
const post4 = new THREE.Mesh(boxGeo, paintMat);
post4.name = 'post';
post4.position.set(-1, 1.595, -1.7321);
post4.rotation.set(0, deg(210), 0);
root.add(post4);
const postBase4 = new THREE.Mesh(boxGeo2, trimMat);
postBase4.name = 'postBase';
postBase4.position.set(-1, 0.48, -1.7321);
postBase4.rotation.set(0, deg(210), 0);
root.add(postBase4);
const topBeam4 = new THREE.Mesh(boxGeo3, paintMat);
topBeam4.name = 'topBeam';
topBeam4.position.set(-1.5, 2.69, -0.866);
topBeam4.rotation.set(deg(-90), 0, deg(150));
root.add(topBeam4);
const bracket7 = new THREE.Mesh(boxGeo4, paintMat);
bracket7.name = 'bracket';
bracket7.position.set(-1.08, 2.4, -1.5935);
bracket7.rotation.set(deg(-138.6596), deg(23.4355), deg(160.7151));
root.add(bracket7);
const bracket8 = new THREE.Mesh(boxGeo4, paintMat);
bracket8.name = 'bracket';
bracket8.position.set(-0.84, 2.4, -1.7321);
bracket8.rotation.set(deg(-90), deg(-52.6961), deg(-90));
root.add(bracket8);
const post5 = new THREE.Mesh(boxGeo, paintMat);
post5.name = 'post';
post5.position.set(-2, 1.595, 0);
post5.rotation.set(0, deg(270), 0);
root.add(post5);
const postBase5 = new THREE.Mesh(boxGeo2, trimMat);
postBase5.name = 'postBase';
postBase5.position.set(-2, 0.48, 0);
postBase5.rotation.set(0, deg(270), 0);
root.add(postBase5);
const topBeam5 = new THREE.Mesh(boxGeo3, paintMat);
topBeam5.name = 'topBeam';
topBeam5.position.set(-1.5, 2.69, 0.866);
topBeam5.rotation.set(deg(-90), 0, deg(-150));
root.add(topBeam5);
const bracket9 = new THREE.Mesh(boxGeo4, paintMat);
bracket9.name = 'bracket';
bracket9.position.set(-1.92, 2.4, 0.1386);
bracket9.rotation.set(deg(-138.6596), deg(-23.4355), deg(-160.7151));
root.add(bracket9);
const bracket10 = new THREE.Mesh(boxGeo4, paintMat);
bracket10.name = 'bracket';
bracket10.position.set(-1.92, 2.4, -0.1386);
bracket10.rotation.set(deg(-41.3404), deg(-23.4355), deg(-19.2849));
root.add(bracket10);
const post6 = new THREE.Mesh(boxGeo, paintMat);
post6.name = 'post';
post6.position.set(-1, 1.595, 1.7321);
post6.rotation.set(0, deg(330), 0);
root.add(post6);
const postBase6 = new THREE.Mesh(boxGeo2, trimMat);
postBase6.name = 'postBase';
postBase6.position.set(-1, 0.48, 1.7321);
postBase6.rotation.set(0, deg(330), 0);
root.add(postBase6);
const topBeam6 = new THREE.Mesh(boxGeo3, paintMat);
topBeam6.name = 'topBeam';
topBeam6.position.set(0, 2.69, 1.7321);
topBeam6.rotation.set(deg(-90), 0, deg(-90));
root.add(topBeam6);
const bracket11 = new THREE.Mesh(boxGeo4, paintMat);
bracket11.name = 'bracket';
bracket11.position.set(-0.84, 2.4, 1.7321);
bracket11.rotation.set(deg(-90), deg(-52.6961), deg(-90));
root.add(bracket11);
const bracket12 = new THREE.Mesh(boxGeo4, paintMat);
bracket12.name = 'bracket';
bracket12.position.set(-1.08, 2.4, 1.5935);
bracket12.rotation.set(deg(-41.3404), deg(23.4355), deg(19.2849));
root.add(bracket12);
const handrail = new THREE.Mesh(boxGeo5, paintMat);
handrail.name = 'handrail';
handrail.position.set(1.5, 1.32, 0.866);
handrail.rotation.set(deg(-90), 0, deg(-30));
root.add(handrail);
const bottomRail = new THREE.Mesh(boxGeo6, trimMat);
bottomRail.name = 'bottomRail';
bottomRail.position.set(1.5, 0.54, 0.866);
bottomRail.rotation.set(deg(-90), 0, deg(-30));
root.add(bottomRail);
const baluster = new THREE.Mesh(boxGeo7, paintMat);
baluster.name = 'baluster';
baluster.position.set(1.1429, 0.93, 1.4846);
baluster.rotation.set(0, deg(30), 0);
root.add(baluster);
const baluster2 = new THREE.Mesh(boxGeo7, paintMat);
baluster2.name = 'baluster';
baluster2.position.set(1.2857, 0.93, 1.2372);
baluster2.rotation.set(0, deg(30), 0);
root.add(baluster2);
const baluster3 = new THREE.Mesh(boxGeo7, paintMat);
baluster3.name = 'baluster';
baluster3.position.set(1.4286, 0.93, 0.9897);
baluster3.rotation.set(0, deg(30), 0);
root.add(baluster3);
const baluster4 = new THREE.Mesh(boxGeo7, paintMat);
baluster4.name = 'baluster';
baluster4.position.set(1.5714, 0.93, 0.7423);
baluster4.rotation.set(0, deg(30), 0);
root.add(baluster4);
const baluster5 = new THREE.Mesh(boxGeo7, paintMat);
baluster5.name = 'baluster';
baluster5.position.set(1.7143, 0.93, 0.4949);
baluster5.rotation.set(0, deg(30), 0);
root.add(baluster5);
const baluster6 = new THREE.Mesh(boxGeo7, paintMat);
baluster6.name = 'baluster';
baluster6.position.set(1.8571, 0.93, 0.2474);
baluster6.rotation.set(0, deg(30), 0);
root.add(baluster6);
const handrail2 = new THREE.Mesh(boxGeo5, paintMat);
handrail2.name = 'handrail';
handrail2.position.set(1.5, 1.32, -0.866);
handrail2.rotation.set(deg(-90), 0, deg(30));
root.add(handrail2);
const bottomRail2 = new THREE.Mesh(boxGeo6, trimMat);
bottomRail2.name = 'bottomRail';
bottomRail2.position.set(1.5, 0.54, -0.866);
bottomRail2.rotation.set(deg(-90), 0, deg(30));
root.add(bottomRail2);
const baluster7 = new THREE.Mesh(boxGeo7, paintMat);
baluster7.name = 'baluster';
baluster7.position.set(1.8571, 0.93, -0.2474);
baluster7.rotation.set(0, deg(90), 0);
root.add(baluster7);
const baluster8 = new THREE.Mesh(boxGeo7, paintMat);
baluster8.name = 'baluster';
baluster8.position.set(1.7143, 0.93, -0.4949);
baluster8.rotation.set(0, deg(90), 0);
root.add(baluster8);
const baluster9 = new THREE.Mesh(boxGeo7, paintMat);
baluster9.name = 'baluster';
baluster9.position.set(1.5714, 0.93, -0.7423);
baluster9.rotation.set(0, deg(90), 0);
root.add(baluster9);
const baluster10 = new THREE.Mesh(boxGeo7, paintMat);
baluster10.name = 'baluster';
baluster10.position.set(1.4286, 0.93, -0.9897);
baluster10.rotation.set(0, deg(90), 0);
root.add(baluster10);
const baluster11 = new THREE.Mesh(boxGeo7, paintMat);
baluster11.name = 'baluster';
baluster11.position.set(1.2857, 0.93, -1.2372);
baluster11.rotation.set(0, deg(90), 0);
root.add(baluster11);
const baluster12 = new THREE.Mesh(boxGeo7, paintMat);
baluster12.name = 'baluster';
baluster12.position.set(1.1429, 0.93, -1.4846);
baluster12.rotation.set(0, deg(90), 0);
root.add(baluster12);
const handrail3 = new THREE.Mesh(boxGeo5, paintMat);
handrail3.name = 'handrail';
handrail3.position.set(0, 1.32, -1.7321);
handrail3.rotation.set(deg(-90), 0, deg(90));
root.add(handrail3);
const bottomRail3 = new THREE.Mesh(boxGeo6, trimMat);
bottomRail3.name = 'bottomRail';
bottomRail3.position.set(0, 0.54, -1.7321);
bottomRail3.rotation.set(deg(-90), 0, deg(90));
root.add(bottomRail3);
const baluster13 = new THREE.Mesh(boxGeo7, paintMat);
baluster13.name = 'baluster';
baluster13.position.set(0.7143, 0.93, -1.7321);
baluster13.rotation.set(0, deg(150), 0);
root.add(baluster13);
const baluster14 = new THREE.Mesh(boxGeo7, paintMat);
baluster14.name = 'baluster';
baluster14.position.set(0.4286, 0.93, -1.7321);
baluster14.rotation.set(0, deg(150), 0);
root.add(baluster14);
const baluster15 = new THREE.Mesh(boxGeo7, paintMat);
baluster15.name = 'baluster';
baluster15.position.set(0.1429, 0.93, -1.7321);
baluster15.rotation.set(0, deg(150), 0);
root.add(baluster15);
const baluster16 = new THREE.Mesh(boxGeo7, paintMat);
baluster16.name = 'baluster';
baluster16.position.set(-0.1429, 0.93, -1.7321);
baluster16.rotation.set(0, deg(150), 0);
root.add(baluster16);
const baluster17 = new THREE.Mesh(boxGeo7, paintMat);
baluster17.name = 'baluster';
baluster17.position.set(-0.4286, 0.93, -1.7321);
baluster17.rotation.set(0, deg(150), 0);
root.add(baluster17);
const baluster18 = new THREE.Mesh(boxGeo7, paintMat);
baluster18.name = 'baluster';
baluster18.position.set(-0.7143, 0.93, -1.7321);
baluster18.rotation.set(0, deg(150), 0);
root.add(baluster18);
const handrail4 = new THREE.Mesh(boxGeo5, paintMat);
handrail4.name = 'handrail';
handrail4.position.set(-1.5, 1.32, -0.866);
handrail4.rotation.set(deg(-90), 0, deg(150));
root.add(handrail4);
const bottomRail4 = new THREE.Mesh(boxGeo6, trimMat);
bottomRail4.name = 'bottomRail';
bottomRail4.position.set(-1.5, 0.54, -0.866);
bottomRail4.rotation.set(deg(-90), 0, deg(150));
root.add(bottomRail4);
const baluster19 = new THREE.Mesh(boxGeo7, paintMat);
baluster19.name = 'baluster';
baluster19.position.set(-1.1429, 0.93, -1.4846);
baluster19.rotation.set(0, deg(210), 0);
root.add(baluster19);
const baluster20 = new THREE.Mesh(boxGeo7, paintMat);
baluster20.name = 'baluster';
baluster20.position.set(-1.2857, 0.93, -1.2372);
baluster20.rotation.set(0, deg(210), 0);
root.add(baluster20);
const baluster21 = new THREE.Mesh(boxGeo7, paintMat);
baluster21.name = 'baluster';
baluster21.position.set(-1.4286, 0.93, -0.9897);
baluster21.rotation.set(0, deg(210), 0);
root.add(baluster21);
const baluster22 = new THREE.Mesh(boxGeo7, paintMat);
baluster22.name = 'baluster';
baluster22.position.set(-1.5714, 0.93, -0.7423);
baluster22.rotation.set(0, deg(210), 0);
root.add(baluster22);
const baluster23 = new THREE.Mesh(boxGeo7, paintMat);
baluster23.name = 'baluster';
baluster23.position.set(-1.7143, 0.93, -0.4949);
baluster23.rotation.set(0, deg(210), 0);
root.add(baluster23);
const baluster24 = new THREE.Mesh(boxGeo7, paintMat);
baluster24.name = 'baluster';
baluster24.position.set(-1.8571, 0.93, -0.2474);
baluster24.rotation.set(0, deg(210), 0);
root.add(baluster24);
const handrail5 = new THREE.Mesh(boxGeo5, paintMat);
handrail5.name = 'handrail';
handrail5.position.set(-1.5, 1.32, 0.866);
handrail5.rotation.set(deg(-90), 0, deg(-150));
root.add(handrail5);
const bottomRail5 = new THREE.Mesh(boxGeo6, trimMat);
bottomRail5.name = 'bottomRail';
bottomRail5.position.set(-1.5, 0.54, 0.866);
bottomRail5.rotation.set(deg(-90), 0, deg(-150));
root.add(bottomRail5);
const baluster25 = new THREE.Mesh(boxGeo7, paintMat);
baluster25.name = 'baluster';
baluster25.position.set(-1.8571, 0.93, 0.2474);
baluster25.rotation.set(0, deg(270), 0);
root.add(baluster25);
const baluster26 = new THREE.Mesh(boxGeo7, paintMat);
baluster26.name = 'baluster';
baluster26.position.set(-1.7143, 0.93, 0.4949);
baluster26.rotation.set(0, deg(270), 0);
root.add(baluster26);
const baluster27 = new THREE.Mesh(boxGeo7, paintMat);
baluster27.name = 'baluster';
baluster27.position.set(-1.5714, 0.93, 0.7423);
baluster27.rotation.set(0, deg(270), 0);
root.add(baluster27);
const baluster28 = new THREE.Mesh(boxGeo7, paintMat);
baluster28.name = 'baluster';
baluster28.position.set(-1.4286, 0.93, 0.9897);
baluster28.rotation.set(0, deg(270), 0);
root.add(baluster28);
const baluster29 = new THREE.Mesh(boxGeo7, paintMat);
baluster29.name = 'baluster';
baluster29.position.set(-1.2857, 0.93, 1.2372);
baluster29.rotation.set(0, deg(270), 0);
root.add(baluster29);
const baluster30 = new THREE.Mesh(boxGeo7, paintMat);
baluster30.name = 'baluster';
baluster30.position.set(-1.1429, 0.93, 1.4846);
baluster30.rotation.set(0, deg(270), 0);
root.add(baluster30);
const roof = new THREE.Mesh(lathe([[2.5, 0], [1.85, 0.3825], [1.15, 0.945], [0.5, 1.71], [0.02, 2.25]], 6, Math.PI / 6, Math.PI * 2), roofMat);
roof.name = 'roof';
roof.position.set(0, 2.81, 0);
root.add(roof);
const roofInner = new THREE.Mesh(lathe([[0.02, 2.18], [0.46, 1.64], [1.11, 0.875], [1.81, 0.3125], [2.46, -0.07]], 6, Math.PI / 6, Math.PI * 2), trimMat);
roofInner.name = 'roofInner';
roofInner.position.set(0, 2.81, 0);
root.add(roofInner);
const fascia = new THREE.Mesh(new THREE.CylinderGeometry(2.5, 2.46, 0.08, 6, 1, true, Math.PI / 6), roofDarkMat);
fascia.name = 'fascia';
fascia.position.set(0, 2.775, 0);
root.add(fascia);
const shingleCourse = new THREE.Mesh(new THREE.CylinderGeometry(2.2425, 2.535, 0.1721, 6, 1, true, Math.PI / 6), roof2Mat);
shingleCourse.name = 'shingleCourse';
shingleCourse.position.set(0, 2.9061, 0);
root.add(shingleCourse);
const shingleCourse2 = new THREE.Mesh(new THREE.CylinderGeometry(1.57, 1.885, 0.2531, 6, 1, true, Math.PI / 6), roof2Mat);
shingleCourse2.name = 'shingleCourse';
shingleCourse2.position.set(0, 3.329, 0);
root.add(shingleCourse2);
const shingleCourse3 = new THREE.Mesh(new THREE.CylinderGeometry(0.8925, 1.185, 0.3443, 6, 1, true, Math.PI / 6), roof2Mat);
shingleCourse3.name = 'shingleCourse';
shingleCourse3.position.set(0, 3.9371, 0);
root.add(shingleCourse3);
const hipRidge = new THREE.Mesh(tube([[1.26, 2.86, 2.1824], [0.935, 3.2425, 1.6195], [0.585, 3.805, 1.0132], [0.26, 4.57, 0.4503], [0, 5.08, 0]], 0.045, 5, 3), roofDarkMat);
hipRidge.name = 'hipRidge';
root.add(hipRidge);
const hipRidge2 = new THREE.Mesh(tube([[2.52, 2.86, 0], [1.87, 3.2425, 0], [1.17, 3.805, 0], [0.52, 4.57, 0], [0, 5.08, 0]], 0.045, 5, 3), roofDarkMat);
hipRidge2.name = 'hipRidge';
root.add(hipRidge2);
const hipRidge3 = new THREE.Mesh(tube([[1.26, 2.86, -2.1824], [0.935, 3.2425, -1.6195], [0.585, 3.805, -1.0132], [0.26, 4.57, -0.4503], [0, 5.08, 0]], 0.045, 5, 3), roofDarkMat);
hipRidge3.name = 'hipRidge';
root.add(hipRidge3);
const hipRidge4 = new THREE.Mesh(tube([[-1.26, 2.86, -2.1824], [-0.935, 3.2425, -1.6195], [-0.585, 3.805, -1.0132], [-0.26, 4.57, -0.4503], [0, 5.08, 0]], 0.045, 5, 3), roofDarkMat);
hipRidge4.name = 'hipRidge';
root.add(hipRidge4);
const hipRidge5 = new THREE.Mesh(tube([[-2.52, 2.86, 0], [-1.87, 3.2425, 0], [-1.17, 3.805, 0], [-0.52, 4.57, 0], [0, 5.08, 0]], 0.045, 5, 3), roofDarkMat);
hipRidge5.name = 'hipRidge';
root.add(hipRidge5);
const hipRidge6 = new THREE.Mesh(tube([[-1.26, 2.86, 2.1824], [-0.935, 3.2425, 1.6195], [-0.585, 3.805, 1.0132], [-0.26, 4.57, 0.4503], [0, 5.08, 0]], 0.045, 5, 3), roofDarkMat);
hipRidge6.name = 'hipRidge';
root.add(hipRidge6);
const finialBall = new THREE.Mesh(new THREE.SphereGeometry(0.13, 6, 4), trimMat);
finialBall.name = 'finialBall';
finialBall.position.set(0, 5.16, 0);
root.add(finialBall);
const finialSpike = new THREE.Mesh(new THREE.ConeGeometry(0.05, 0.4, 6), metalMat);
finialSpike.name = 'finialSpike';
finialSpike.position.set(0, 5.46, 0);
root.add(finialSpike);
const chain = new THREE.Mesh(new THREE.CylinderGeometry(0.008, 0.008, 1.6475, 4), metalMat);
chain.name = 'chain';
chain.position.set(0, 3.2238, 0);
root.add(chain);
const lanternCap = new THREE.Mesh(new THREE.ConeGeometry(0.13, 0.12, 6), metalMat);
lanternCap.name = 'lanternCap';
lanternCap.position.set(0, 2.38, 0);
root.add(lanternCap);
const lanternGlass = new THREE.Mesh(new THREE.CylinderGeometry(0.08, 0.07, 0.2, 6), glowMat);
lanternGlass.name = 'lanternGlass';
lanternGlass.position.set(0, 2.22, 0);
root.add(lanternGlass);
const lanternBase = new THREE.Mesh(new THREE.CylinderGeometry(0.1, 0.1, 0.03, 6), metalMat);
lanternBase.name = 'lanternBase';
lanternBase.position.set(0, 2.105, 0);
root.add(lanternBase);
const tableTop = new THREE.Mesh(new THREE.CylinderGeometry(0.5, 0.5, 0.05, 10), floorMat);
tableTop.name = 'tableTop';
tableTop.position.set(0, 1.145, 0);
root.add(tableTop);
const tableLeg = new THREE.Mesh(new THREE.CylinderGeometry(0.05, 0.06, 0.66, 6), trimMat);
tableLeg.name = 'tableLeg';
tableLeg.position.set(0, 0.79, 0);
root.add(tableLeg);
const tableFoot = new THREE.Mesh(new THREE.CylinderGeometry(0.24, 0.28, 0.05, 8), trimMat);
tableFoot.name = 'tableFoot';
tableFoot.position.set(0, 0.445, 0);
root.add(tableFoot);
root.traverse((o) => {
if (o.isMesh) {
o.castShadow = true;
o.receiveShadow = true;
}
});
return root;
}
export default createGazebo;
评分与评论
0 条评论
暂无评论。分享一下你是如何使用这个模型的,或者有哪些可以改进的地方。
相关模型
同一分类或相似标签









