765 tris0,64 × 0,51 × 0,54 m
Use no código
Fazer remix no editortulip-patch.js · 589 linhas
Módulo ES autocontido — depende apenas do three. Chame a factory e adicione o grupo à sua cena.
/**
* Tulip Patch — Codels 3D model library
* License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
* Triangles: 765 · Size (W × H × D): 0.64 × 0.51 × 0.54 m
*
* Usage:
* import { createTulipPatch } from './tulip-patch.js';
*
* const model = createTulipPatch();
* model.position.set(0, 0, 0);
* scene.add(model);
*/
import * as THREE from 'three';
const deg = THREE.MathUtils.degToRad;
// Deterministic vertex displacement (organic low-poly look).
function jitter(geometry, amount, seed) {
const pos = geometry.attributes.position;
const h = (a, b, c, s) => {
let x = Math.imul(a, 73856093) ^ Math.imul(b, 19349663) ^ Math.imul(c, 83492791) ^ Math.imul(s, 2654435761);
x = Math.imul(x ^ (x >>> 16), 2246822507);
x = Math.imul(x ^ (x >>> 13), 3266489909);
return ((x ^ (x >>> 16)) >>> 0) / 4294967295 - 0.5;
};
for (let i = 0; i < pos.count; i++) {
const x = pos.getX(i), y = pos.getY(i), z = pos.getZ(i);
const qx = Math.round(x * 1000), qy = Math.round(y * 1000), qz = Math.round(z * 1000);
pos.setXYZ(i, x + h(qx, qy, qz, seed) * 2 * amount, y + h(qx, qy, qz, seed + 1) * 2 * amount, z + h(qx, qy, qz, seed + 2) * 2 * amount);
}
pos.needsUpdate = true;
geometry.computeVertexNormals();
return geometry;
}
export function createTulipPatch() {
const root = new THREE.Group();
root.name = 'TulipPatch';
// Materials
const soilMat = new THREE.MeshStandardMaterial({ name: 'soil', color: 0x5c3d29, roughness: 0.95, flatShading: true });
const stemMat = new THREE.MeshStandardMaterial({ name: 'stem', color: 0x4f8f3a, roughness: 0.85, flatShading: true });
const leafMat = new THREE.MeshStandardMaterial({ name: 'leaf', color: 0x5fa046, roughness: 0.85, flatShading: true });
const petalAMat = new THREE.MeshStandardMaterial({ name: 'petalA', color: 0xe8404f, roughness: 0.6, flatShading: true });
const petalA2Mat = new THREE.MeshStandardMaterial({ name: 'petalA2', color: 0xc53643, roughness: 0.6, flatShading: true });
// Shared geometries
const octahedronGeo = new THREE.OctahedronGeometry(1, 0);
// Parts
const soil = new THREE.Mesh(jitter(new THREE.SphereGeometry(0.315, 9, 3, 0, Math.PI * 2, 0, Math.PI / 2), 0.0158, 3), soilMat);
soil.name = 'soil';
soil.position.set(0, 0.0044, 0);
soil.scale.set(1, 0.28, 0.85);
root.add(soil);
const stem1 = new THREE.Mesh(new THREE.CylinderGeometry(0.007, 0.009, 0.3288, 4), stemMat);
stem1.name = 'stem1';
stem1.position.set(0.077, 0.2356, 0.0061);
stem1.rotation.set(deg(0.537), deg(-0.0318), deg(-6.7678));
root.add(stem1);
const leaf11 = new THREE.Mesh(octahedronGeo, leafMat);
leaf11.name = 'leaf1_1';
leaf11.position.set(0.0975, 0.1811, -0.0236);
leaf11.rotation.set(deg(136.4089), deg(45.6586), deg(-145.751));
leaf11.scale.set(0.036, 0.1125, 0.006);
root.add(leaf11);
const leaf12 = new THREE.Mesh(octahedronGeo, leafMat);
leaf12.name = 'leaf1_2';
leaf12.position.set(0.0367, 0.1652, 0.0387);
leaf12.rotation.set(deg(32.84), deg(-27.294), deg(16.4874));
leaf12.scale.set(0.036, 0.0924, 0.006);
root.add(leaf12);
const tulip1 = new THREE.Group();
tulip1.name = 'tulip1';
tulip1.position.set(0.0964, 0.3908, 0.0077);
tulip1.rotation.set(deg(6.7786), deg(40.5194), deg(-9.4963));
root.add(tulip1);
const petal1 = new THREE.Mesh(octahedronGeo, petalAMat);
petal1.name = 'petal1';
petal1.position.set(0.0211, 0.0373, 0);
petal1.rotation.set(deg(90), deg(78), deg(-90));
petal1.scale.set(0.0298, 0.0422, 0.0099);
tulip1.add(petal1);
const petal2 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal2.name = 'petal2';
petal2.position.set(0.0075, 0.0422, 0.0129);
petal2.rotation.set(deg(4.6163), deg(29.9195), deg(-2.3063));
petal2.scale.set(0.0248, 0.041, 0.0099);
tulip1.add(petal2);
const petal3 = new THREE.Mesh(octahedronGeo, petalAMat);
petal3.name = 'petal3';
petal3.position.set(-0.0106, 0.0373, 0.0183);
petal3.rotation.set(deg(13.79), deg(-29.2797), deg(6.8449));
petal3.scale.set(0.0298, 0.0422, 0.0099);
tulip1.add(petal3);
const petal4 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal4.name = 'petal4';
petal4.position.set(-0.0149, 0.0422, 0);
petal4.rotation.set(deg(90), deg(-86), deg(90));
petal4.scale.set(0.0248, 0.041, 0.0099);
tulip1.add(petal4);
const petal5 = new THREE.Mesh(octahedronGeo, petalAMat);
petal5.name = 'petal5';
petal5.position.set(-0.0106, 0.0373, -0.0183);
petal5.rotation.set(deg(166.21), deg(-29.2797), deg(173.1551));
petal5.scale.set(0.0298, 0.0422, 0.0099);
tulip1.add(petal5);
const petal6 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal6.name = 'petal6';
petal6.position.set(0.0075, 0.0422, -0.0129);
petal6.rotation.set(deg(175.3837), deg(29.9195), deg(-177.6937));
petal6.scale.set(0.0248, 0.041, 0.0099);
tulip1.add(petal6);
const stem2 = new THREE.Mesh(new THREE.CylinderGeometry(0.007, 0.009, 0.2997, 4), stemMat);
stem2.name = 'stem2';
stem2.position.set(-0.0886, 0.2131, 0.0698);
stem2.rotation.set(deg(4.5377), deg(0.2285), deg(5.7623));
root.add(stem2);
const leaf21 = new THREE.Mesh(octahedronGeo, leafMat);
leaf21.name = 'leaf2_1';
leaf21.position.set(-0.0991, 0.1676, 0.0958);
leaf21.rotation.set(deg(33.5727), deg(-29.37), deg(18.0309));
leaf21.scale.set(0.036, 0.1054, 0.006);
root.add(leaf21);
const leaf22 = new THREE.Mesh(octahedronGeo, leafMat);
leaf22.name = 'leaf2_2';
leaf22.position.set(-0.054, 0.1699, 0.0152);
leaf22.rotation.set(deg(148.8304), deg(21.3913), deg(-167.5583));
leaf22.scale.set(0.036, 0.1083, 0.006);
root.add(leaf22);
const tulip2 = new THREE.Group();
tulip2.name = 'tulip2';
tulip2.position.set(-0.1037, 0.3538, 0.0817);
tulip2.rotation.set(deg(4.0799), deg(7.4319), deg(6.2244));
root.add(tulip2);
const petal12 = new THREE.Mesh(octahedronGeo, petalAMat);
petal12.name = 'petal1';
petal12.position.set(0.0209, 0.0369, 0);
petal12.rotation.set(deg(90), deg(78), deg(-90));
petal12.scale.set(0.0295, 0.0418, 0.0098);
tulip2.add(petal12);
const petal22 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal22.name = 'petal2';
petal22.position.set(0.0074, 0.0418, 0.0128);
petal22.rotation.set(deg(4.6163), deg(29.9195), deg(-2.3063));
petal22.scale.set(0.0246, 0.0406, 0.0098);
tulip2.add(petal22);
const petal32 = new THREE.Mesh(octahedronGeo, petalAMat);
petal32.name = 'petal3';
petal32.position.set(-0.0105, 0.0369, 0.0181);
petal32.rotation.set(deg(13.79), deg(-29.2797), deg(6.8449));
petal32.scale.set(0.0295, 0.0418, 0.0098);
tulip2.add(petal32);
const petal42 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal42.name = 'petal4';
petal42.position.set(-0.0148, 0.0418, 0);
petal42.rotation.set(deg(90), deg(-86), deg(90));
petal42.scale.set(0.0246, 0.0406, 0.0098);
tulip2.add(petal42);
const petal52 = new THREE.Mesh(octahedronGeo, petalAMat);
petal52.name = 'petal5';
petal52.position.set(-0.0105, 0.0369, -0.0181);
petal52.rotation.set(deg(166.21), deg(-29.2797), deg(173.1551));
petal52.scale.set(0.0295, 0.0418, 0.0098);
tulip2.add(petal52);
const petal62 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal62.name = 'petal6';
petal62.position.set(0.0074, 0.0418, -0.0128);
petal62.rotation.set(deg(175.3837), deg(29.9195), deg(-177.6937));
petal62.scale.set(0.0246, 0.0406, 0.0098);
tulip2.add(petal62);
const stem3 = new THREE.Mesh(new THREE.CylinderGeometry(0.007, 0.009, 0.3698, 4), stemMat);
stem3.name = 'stem3';
stem3.position.set(0.0023, 0.2488, -0.1232);
stem3.rotation.set(deg(-4.0749), deg(0.0027), deg(-0.0758));
root.add(stem3);
const leaf31 = new THREE.Mesh(octahedronGeo, leafMat);
leaf31.name = 'leaf3_1';
leaf31.position.set(-0.0199, 0.1588, -0.1446);
leaf31.rotation.set(deg(146.8961), deg(-28.0693), deg(162.9447));
leaf31.scale.set(0.036, 0.0943, 0.006);
root.add(leaf31);
const leaf32 = new THREE.Mesh(octahedronGeo, leafMat);
leaf32.name = 'leaf3_2';
leaf32.position.set(0.028, 0.1679, -0.0722);
leaf32.rotation.set(deg(33.6743), deg(29.6398), deg(-18.2371));
leaf32.scale.set(0.036, 0.1058, 0.006);
root.add(leaf32);
const tulip3 = new THREE.Group();
tulip3.name = 'tulip3';
tulip3.position.set(0.0025, 0.4253, -0.1363);
tulip3.rotation.set(deg(-4.289), deg(13.1196), deg(-0.0822));
root.add(tulip3);
const petal13 = new THREE.Mesh(octahedronGeo, petalAMat);
petal13.name = 'petal1';
petal13.position.set(0.0202, 0.0357, 0);
petal13.rotation.set(deg(90), deg(78), deg(-90));
petal13.scale.set(0.0285, 0.0404, 0.0095);
tulip3.add(petal13);
const petal23 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal23.name = 'petal2';
petal23.position.set(0.0071, 0.0404, 0.0124);
petal23.rotation.set(deg(4.6163), deg(29.9195), deg(-2.3063));
petal23.scale.set(0.0238, 0.0392, 0.0095);
tulip3.add(petal23);
const petal33 = new THREE.Mesh(octahedronGeo, petalAMat);
petal33.name = 'petal3';
petal33.position.set(-0.0101, 0.0357, 0.0175);
petal33.rotation.set(deg(13.79), deg(-29.2797), deg(6.8449));
petal33.scale.set(0.0285, 0.0404, 0.0095);
tulip3.add(petal33);
const petal43 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal43.name = 'petal4';
petal43.position.set(-0.0143, 0.0404, 0);
petal43.rotation.set(deg(90), deg(-86), deg(90));
petal43.scale.set(0.0238, 0.0392, 0.0095);
tulip3.add(petal43);
const petal53 = new THREE.Mesh(octahedronGeo, petalAMat);
petal53.name = 'petal5';
petal53.position.set(-0.0101, 0.0357, -0.0175);
petal53.rotation.set(deg(166.21), deg(-29.2797), deg(173.1551));
petal53.scale.set(0.0285, 0.0404, 0.0095);
tulip3.add(petal53);
const petal63 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal63.name = 'petal6';
petal63.position.set(0.0071, 0.0404, -0.0124);
petal63.rotation.set(deg(175.3837), deg(29.9195), deg(-177.6937));
petal63.scale.set(0.0238, 0.0392, 0.0095);
tulip3.add(petal63);
const stem4 = new THREE.Mesh(new THREE.CylinderGeometry(0.007, 0.009, 0.3811, 4), stemMat);
stem4.name = 'stem4';
stem4.position.set(0.0987, 0.2453, 0.1242);
stem4.rotation.set(deg(4.9004), deg(-0.1667), deg(-3.894));
root.add(stem4);
const leaf41 = new THREE.Mesh(octahedronGeo, leafMat);
leaf41.name = 'leaf4_1';
leaf41.position.set(0.1344, 0.174, 0.1313);
leaf41.rotation.set(deg(51.8024), deg(52.1773), deg(-45.1111));
leaf41.scale.set(0.036, 0.1243, 0.006);
root.add(leaf41);
const leaf42 = new THREE.Mesh(octahedronGeo, leafMat);
leaf42.name = 'leaf4_2';
leaf42.position.set(0.0456, 0.1489, 0.108);
leaf42.rotation.set(deg(89.8028), deg(-61.189), deg(89.775));
leaf42.scale.set(0.036, 0.0926, 0.006);
root.add(leaf42);
const tulip4 = new THREE.Group();
tulip4.name = 'tulip4';
tulip4.position.set(0.1117, 0.4268, 0.1405);
tulip4.rotation.set(deg(5.9966), deg(11.1677), deg(-4.188));
root.add(tulip4);
const petal14 = new THREE.Mesh(octahedronGeo, petalAMat);
petal14.name = 'petal1';
petal14.position.set(0.0208, 0.0367, 0);
petal14.rotation.set(deg(90), deg(78), deg(-90));
petal14.scale.set(0.0293, 0.0415, 0.0098);
tulip4.add(petal14);
const petal24 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal24.name = 'petal2';
petal24.position.set(0.0073, 0.0415, 0.0127);
petal24.rotation.set(deg(4.6163), deg(29.9195), deg(-2.3063));
petal24.scale.set(0.0244, 0.0403, 0.0098);
tulip4.add(petal24);
const petal34 = new THREE.Mesh(octahedronGeo, petalAMat);
petal34.name = 'petal3';
petal34.position.set(-0.0104, 0.0367, 0.018);
petal34.rotation.set(deg(13.79), deg(-29.2797), deg(6.8449));
petal34.scale.set(0.0293, 0.0415, 0.0098);
tulip4.add(petal34);
const petal44 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal44.name = 'petal4';
petal44.position.set(-0.0147, 0.0415, 0);
petal44.rotation.set(deg(90), deg(-86), deg(90));
petal44.scale.set(0.0244, 0.0403, 0.0098);
tulip4.add(petal44);
const petal54 = new THREE.Mesh(octahedronGeo, petalAMat);
petal54.name = 'petal5';
petal54.position.set(-0.0104, 0.0367, -0.018);
petal54.rotation.set(deg(166.21), deg(-29.2797), deg(173.1551));
petal54.scale.set(0.0293, 0.0415, 0.0098);
tulip4.add(petal54);
const petal64 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal64.name = 'petal6';
petal64.position.set(0.0073, 0.0415, -0.0127);
petal64.rotation.set(deg(175.3837), deg(29.9195), deg(-177.6937));
petal64.scale.set(0.0244, 0.0403, 0.0098);
tulip4.add(petal64);
const stem5 = new THREE.Mesh(new THREE.CylinderGeometry(0.007, 0.009, 0.3018, 4), stemMat);
stem5.name = 'stem5';
stem5.position.set(-0.1819, 0.2028, -0.0497);
stem5.rotation.set(deg(-1.7132), deg(-0.094), deg(6.2837));
root.add(stem5);
const leaf51 = new THREE.Mesh(octahedronGeo, leafMat);
leaf51.name = 'leaf5_1';
leaf51.position.set(-0.2073, 0.1501, -0.0381);
leaf51.rotation.set(deg(73.1224), deg(-59.7608), deg(70.6496));
leaf51.scale.set(0.036, 0.0979, 0.006);
root.add(leaf51);
const leaf52 = new THREE.Mesh(octahedronGeo, leafMat);
leaf52.name = 'leaf5_2';
leaf52.position.set(-0.1262, 0.1462, -0.0546);
leaf52.rotation.set(deg(112.9464), deg(58.4441), deg(-116.42));
leaf52.scale.set(0.036, 0.093, 0.006);
root.add(leaf52);
const tulip5 = new THREE.Group();
tulip5.name = 'tulip5';
tulip5.position.set(-0.1984, 0.3447, -0.0542);
tulip5.rotation.set(deg(-3.9246), deg(17.0842), deg(7.0405));
root.add(tulip5);
const petal15 = new THREE.Mesh(octahedronGeo, petalAMat);
petal15.name = 'petal1';
petal15.position.set(0.019, 0.0336, 0);
petal15.rotation.set(deg(90), deg(78), deg(-90));
petal15.scale.set(0.0269, 0.0381, 0.009);
tulip5.add(petal15);
const petal25 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal25.name = 'petal2';
petal25.position.set(0.0067, 0.0381, 0.0116);
petal25.rotation.set(deg(4.6163), deg(29.9195), deg(-2.3063));
petal25.scale.set(0.0224, 0.037, 0.009);
tulip5.add(petal25);
const petal35 = new THREE.Mesh(octahedronGeo, petalAMat);
petal35.name = 'petal3';
petal35.position.set(-0.0095, 0.0336, 0.0165);
petal35.rotation.set(deg(13.79), deg(-29.2797), deg(6.8449));
petal35.scale.set(0.0269, 0.0381, 0.009);
tulip5.add(petal35);
const petal45 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal45.name = 'petal4';
petal45.position.set(-0.0134, 0.0381, 0);
petal45.rotation.set(deg(90), deg(-86), deg(90));
petal45.scale.set(0.0224, 0.037, 0.009);
tulip5.add(petal45);
const petal55 = new THREE.Mesh(octahedronGeo, petalAMat);
petal55.name = 'petal5';
petal55.position.set(-0.0095, 0.0336, -0.0165);
petal55.rotation.set(deg(166.21), deg(-29.2797), deg(173.1551));
petal55.scale.set(0.0269, 0.0381, 0.009);
tulip5.add(petal55);
const petal65 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal65.name = 'petal6';
petal65.position.set(0.0067, 0.0381, -0.0116);
petal65.rotation.set(deg(175.3837), deg(29.9195), deg(-177.6937));
petal65.scale.set(0.0224, 0.037, 0.009);
tulip5.add(petal65);
const stem6 = new THREE.Mesh(new THREE.CylinderGeometry(0.007, 0.009, 0.3641, 4), stemMat);
stem6.name = 'stem6';
stem6.position.set(0.17, 0.229, -0.1066);
stem6.rotation.set(deg(-3.0449), deg(0.1292), deg(-4.8583));
root.add(stem6);
const leaf61 = new THREE.Mesh(octahedronGeo, leafMat);
leaf61.name = 'leaf6_1';
leaf61.position.set(0.1565, 0.1401, -0.1366);
leaf61.rotation.set(deg(151.1587), deg(2.5209), deg(-178.6125));
leaf61.scale.set(0.036, 0.0916, 0.006);
root.add(leaf61);
const leaf62 = new THREE.Mesh(octahedronGeo, leafMat);
leaf62.name = 'leaf6_2';
leaf62.position.set(0.1628, 0.1566, -0.0489);
leaf62.rotation.set(deg(29.1627), deg(8.5162), deg(-4.7241));
leaf62.scale.set(0.036, 0.1125, 0.006);
root.add(leaf62);
const tulip6 = new THREE.Group();
tulip6.name = 'tulip6';
tulip6.position.set(0.1854, 0.4021, -0.1163);
tulip6.rotation.set(deg(-0.7084), deg(26.101), deg(-5.7253));
root.add(tulip6);
const petal16 = new THREE.Mesh(octahedronGeo, petalAMat);
petal16.name = 'petal1';
petal16.position.set(0.021, 0.037, 0);
petal16.rotation.set(deg(90), deg(78), deg(-90));
petal16.scale.set(0.0296, 0.0419, 0.0099);
tulip6.add(petal16);
const petal26 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal26.name = 'petal2';
petal26.position.set(0.0074, 0.0419, 0.0128);
petal26.rotation.set(deg(4.6163), deg(29.9195), deg(-2.3063));
petal26.scale.set(0.0247, 0.0407, 0.0099);
tulip6.add(petal26);
const petal36 = new THREE.Mesh(octahedronGeo, petalAMat);
petal36.name = 'petal3';
petal36.position.set(-0.0105, 0.037, 0.0181);
petal36.rotation.set(deg(13.79), deg(-29.2797), deg(6.8449));
petal36.scale.set(0.0296, 0.0419, 0.0099);
tulip6.add(petal36);
const petal46 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal46.name = 'petal4';
petal46.position.set(-0.0148, 0.0419, 0);
petal46.rotation.set(deg(90), deg(-86), deg(90));
petal46.scale.set(0.0247, 0.0407, 0.0099);
tulip6.add(petal46);
const petal56 = new THREE.Mesh(octahedronGeo, petalAMat);
petal56.name = 'petal5';
petal56.position.set(-0.0105, 0.037, -0.0181);
petal56.rotation.set(deg(166.21), deg(-29.2797), deg(173.1551));
petal56.scale.set(0.0296, 0.0419, 0.0099);
tulip6.add(petal56);
const petal66 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal66.name = 'petal6';
petal66.position.set(0.0074, 0.0419, -0.0128);
petal66.rotation.set(deg(175.3837), deg(29.9195), deg(-177.6937));
petal66.scale.set(0.0247, 0.0407, 0.0099);
tulip6.add(petal66);
const stem7 = new THREE.Mesh(new THREE.CylinderGeometry(0.007, 0.009, 0.3532, 4), stemMat);
stem7.name = 'stem7';
stem7.position.set(-0.1052, 0.2198, 0.1723);
stem7.rotation.set(deg(4.787), deg(0.1222), deg(2.922));
root.add(stem7);
const leaf71 = new THREE.Mesh(octahedronGeo, leafMat);
leaf71.name = 'leaf7_1';
leaf71.position.set(-0.0923, 0.1353, 0.1965);
leaf71.rotation.set(deg(28.9323), deg(5.0226), deg(-2.7706));
leaf71.scale.set(0.036, 0.0903, 0.006);
root.add(leaf71);
const leaf72 = new THREE.Mesh(octahedronGeo, leafMat);
leaf72.name = 'leaf7_2';
leaf72.position.set(-0.1159, 0.1588, 0.1092);
leaf72.rotation.set(deg(149.2997), deg(-19.2784), deg(168.9086));
leaf72.scale.set(0.036, 0.1202, 0.006);
root.add(leaf72);
const tulip7 = new THREE.Group();
tulip7.name = 'tulip7';
tulip7.position.set(-0.1142, 0.3875, 0.187);
tulip7.rotation.set(deg(3.1263), deg(32.2307), deg(3.6614));
root.add(tulip7);
const petal17 = new THREE.Mesh(octahedronGeo, petalAMat);
petal17.name = 'petal1';
petal17.position.set(0.0211, 0.0372, 0);
petal17.rotation.set(deg(90), deg(78), deg(-90));
petal17.scale.set(0.0297, 0.0421, 0.0099);
tulip7.add(petal17);
const petal27 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal27.name = 'petal2';
petal27.position.set(0.0074, 0.0421, 0.0129);
petal27.rotation.set(deg(4.6163), deg(29.9195), deg(-2.3063));
petal27.scale.set(0.0248, 0.0409, 0.0099);
tulip7.add(petal27);
const petal37 = new THREE.Mesh(octahedronGeo, petalAMat);
petal37.name = 'petal3';
petal37.position.set(-0.0105, 0.0372, 0.0182);
petal37.rotation.set(deg(13.79), deg(-29.2797), deg(6.8449));
petal37.scale.set(0.0297, 0.0421, 0.0099);
tulip7.add(petal37);
const petal47 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal47.name = 'petal4';
petal47.position.set(-0.0149, 0.0421, 0);
petal47.rotation.set(deg(90), deg(-86), deg(90));
petal47.scale.set(0.0248, 0.0409, 0.0099);
tulip7.add(petal47);
const petal57 = new THREE.Mesh(octahedronGeo, petalAMat);
petal57.name = 'petal5';
petal57.position.set(-0.0105, 0.0372, -0.0182);
petal57.rotation.set(deg(166.21), deg(-29.2797), deg(173.1551));
petal57.scale.set(0.0297, 0.0421, 0.0099);
tulip7.add(petal57);
const petal67 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal67.name = 'petal6';
petal67.position.set(0.0074, 0.0421, -0.0129);
petal67.rotation.set(deg(175.3837), deg(29.9195), deg(-177.6937));
petal67.scale.set(0.0248, 0.0409, 0.0099);
tulip7.add(petal67);
const stem8 = new THREE.Mesh(new THREE.CylinderGeometry(0.007, 0.009, 0.2962, 4), stemMat);
stem8.name = 'stem8';
stem8.position.set(-0.1251, 0.1846, -0.1848);
stem8.rotation.set(deg(-7.5739), deg(-0.3392), deg(5.1204));
root.add(stem8);
const leaf81 = new THREE.Mesh(octahedronGeo, leafMat);
leaf81.name = 'leaf8_1';
leaf81.position.set(-0.1545, 0.151, -0.193);
leaf81.rotation.set(deg(134.7859), deg(-47.2341), deg(143.5119));
leaf81.scale.set(0.036, 0.1173, 0.006);
root.add(leaf81);
const leaf82 = new THREE.Mesh(octahedronGeo, leafMat);
leaf82.name = 'leaf8_2';
leaf82.position.set(-0.0624, 0.1484, -0.1672);
leaf82.rotation.set(deg(94.1635), deg(61.1058), deg(-94.7529));
leaf82.scale.set(0.036, 0.1141, 0.006);
root.add(leaf82);
const tulip8 = new THREE.Group();
tulip8.name = 'tulip8';
tulip8.position.set(-0.1383, 0.3228, -0.2043);
tulip8.rotation.set(deg(-11.6202), deg(32.1768), deg(6.4864));
root.add(tulip8);
const petal18 = new THREE.Mesh(octahedronGeo, petalAMat);
petal18.name = 'petal1';
petal18.position.set(0.0187, 0.0329, 0);
petal18.rotation.set(deg(90), deg(78), deg(-90));
petal18.scale.set(0.0263, 0.0373, 0.0088);
tulip8.add(petal18);
const petal28 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal28.name = 'petal2';
petal28.position.set(0.0066, 0.0373, 0.0114);
petal28.rotation.set(deg(4.6163), deg(29.9195), deg(-2.3063));
petal28.scale.set(0.022, 0.0362, 0.0088);
tulip8.add(petal28);
const petal38 = new THREE.Mesh(octahedronGeo, petalAMat);
petal38.name = 'petal3';
petal38.position.set(-0.0093, 0.0329, 0.0162);
petal38.rotation.set(deg(13.79), deg(-29.2797), deg(6.8449));
petal38.scale.set(0.0263, 0.0373, 0.0088);
tulip8.add(petal38);
const petal48 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal48.name = 'petal4';
petal48.position.set(-0.0132, 0.0373, 0);
petal48.rotation.set(deg(90), deg(-86), deg(90));
petal48.scale.set(0.022, 0.0362, 0.0088);
tulip8.add(petal48);
const petal58 = new THREE.Mesh(octahedronGeo, petalAMat);
petal58.name = 'petal5';
petal58.position.set(-0.0093, 0.0329, -0.0162);
petal58.rotation.set(deg(166.21), deg(-29.2797), deg(173.1551));
petal58.scale.set(0.0263, 0.0373, 0.0088);
tulip8.add(petal58);
const petal68 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal68.name = 'petal6';
petal68.position.set(0.0066, 0.0373, -0.0114);
petal68.rotation.set(deg(175.3837), deg(29.9195), deg(-177.6937));
petal68.scale.set(0.022, 0.0362, 0.0088);
tulip8.add(petal68);
const stem9 = new THREE.Mesh(new THREE.CylinderGeometry(0.007, 0.009, 0.3385, 4), stemMat);
stem9.name = 'stem9';
stem9.position.set(0.2427, 0.2044, 0.0785);
stem9.rotation.set(deg(2.1383), deg(-0.1238), deg(-6.6257));
root.add(stem9);
const leaf91 = new THREE.Mesh(octahedronGeo, leafMat);
leaf91.name = 'leaf9_1';
leaf91.position.set(0.2729, 0.1468, 0.0742);
leaf91.rotation.set(deg(85.6701), deg(61.099), deg(-85.057));
leaf91.scale.set(0.036, 0.1147, 0.006);
root.add(leaf91);
const leaf92 = new THREE.Mesh(octahedronGeo, leafMat);
leaf92.name = 'leaf9_2';
leaf92.position.set(0.1798, 0.1379, 0.0834);
leaf92.rotation.set(deg(65.557), deg(-58.0375), deg(61.82));
leaf92.scale.set(0.036, 0.1034, 0.006);
root.add(leaf92);
const tulip9 = new THREE.Group();
tulip9.name = 'tulip9';
tulip9.position.set(0.2622, 0.3644, 0.0848);
tulip9.rotation.set(deg(8.7271), deg(42.2384), deg(-9.5293));
root.add(tulip9);
const petal19 = new THREE.Mesh(octahedronGeo, petalAMat);
petal19.name = 'petal1';
petal19.position.set(0.0204, 0.0359, 0);
petal19.rotation.set(deg(90), deg(78), deg(-90));
petal19.scale.set(0.0287, 0.0407, 0.0096);
tulip9.add(petal19);
const petal29 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal29.name = 'petal2';
petal29.position.set(0.0072, 0.0407, 0.0124);
petal29.rotation.set(deg(4.6163), deg(29.9195), deg(-2.3063));
petal29.scale.set(0.024, 0.0395, 0.0096);
tulip9.add(petal29);
const petal39 = new THREE.Mesh(octahedronGeo, petalAMat);
petal39.name = 'petal3';
petal39.position.set(-0.0102, 0.0359, 0.0176);
petal39.rotation.set(deg(13.79), deg(-29.2797), deg(6.8449));
petal39.scale.set(0.0287, 0.0407, 0.0096);
tulip9.add(petal39);
const petal49 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal49.name = 'petal4';
petal49.position.set(-0.0144, 0.0407, 0);
petal49.rotation.set(deg(90), deg(-86), deg(90));
petal49.scale.set(0.024, 0.0395, 0.0096);
tulip9.add(petal49);
const petal59 = new THREE.Mesh(octahedronGeo, petalAMat);
petal59.name = 'petal5';
petal59.position.set(-0.0102, 0.0359, -0.0176);
petal59.rotation.set(deg(166.21), deg(-29.2797), deg(173.1551));
petal59.scale.set(0.0287, 0.0407, 0.0096);
tulip9.add(petal59);
const petal69 = new THREE.Mesh(octahedronGeo, petalA2Mat);
petal69.name = 'petal6';
petal69.position.set(0.0072, 0.0407, -0.0124);
petal69.rotation.set(deg(175.3837), deg(29.9195), deg(-177.6937));
petal69.scale.set(0.024, 0.0395, 0.0096);
tulip9.add(petal69);
root.traverse((o) => {
if (o.isMesh) {
o.castShadow = true;
o.receiveShadow = true;
}
});
return root;
}
export default createTulipPatch;
Avaliações e comentários
0 comentário
Nenhum comentário ainda. Conte como você usou este modelo ou o que poderia melhorar.
Modelos relacionados
Mesma categoria ou tags parecidas









