935 tris0.85 × 0.52 × 0.89 m
Use it in code
Remix in the editorflower-patch.js · 663 lines
Self-contained ES module — only depends on three. Call the factory and add the group to your scene.
/**
* Flower Patch — Codels 3D model library
* License: CC0-1.0 · Units: meters · Y-up · Front: +Z · Origin: center of the base (y = 0)
* Triangles: 935 · Size (W × H × D): 0.85 × 0.52 × 0.89 m
*
* Usage:
* import { createFlowerPatch } from './flower-patch.js';
*
* const model = createFlowerPatch();
* 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 createFlowerPatch() {
const root = new THREE.Group();
root.name = 'FlowerPatch';
// Materials
const grassMat = new THREE.MeshStandardMaterial({ name: 'grass', color: 0x55913f, roughness: 0.95, flatShading: true });
const stemMat = new THREE.MeshStandardMaterial({ name: 'stem', color: 0x3f7d33, roughness: 0.9, flatShading: true });
const heartMat = new THREE.MeshStandardMaterial({ name: 'heart', color: 0xf4c23c, roughness: 0.6, flatShading: true });
const petalAMat = new THREE.MeshStandardMaterial({ name: 'petalA', color: 0xf06b8b, roughness: 0.7, flatShading: true });
const petalBMat = new THREE.MeshStandardMaterial({ name: 'petalB', color: 0xf5d970, roughness: 0.7, flatShading: true });
const petalCMat = new THREE.MeshStandardMaterial({ name: 'petalC', color: 0xa558ee, roughness: 0.7, flatShading: true });
const petalDMat = new THREE.MeshStandardMaterial({ name: 'petalD', color: 0xfde9ee, roughness: 0.7, flatShading: true });
// Shared geometries
const octahedronGeo = new THREE.OctahedronGeometry(1, 0);
// Parts
const mound = new THREE.Mesh(jitter(new THREE.SphereGeometry(0.45, 9, 3, 0, Math.PI * 2, 0, Math.PI / 2), 0.0225, 4), grassMat);
mound.name = 'mound';
mound.position.set(0, 0.0046, 0);
mound.scale.set(1, 0.32, 1);
root.add(mound);
const blade1 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.0825, 3), stemMat);
blade1.name = 'blade1';
blade1.position.set(-0.1053, 0.1654, 0.0884);
blade1.rotation.set(deg(-0.3392), deg(15.2161), deg(-10.7091));
blade1.scale.set(1, 1, 0.4);
root.add(blade1);
const blade2 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.1224, 3), grassMat);
blade2.name = 'blade2';
blade2.position.set(0.3987, 0.0867, 0.0248);
blade2.rotation.set(deg(12.8983), deg(104.8883), deg(1.195));
blade2.scale.set(1, 1, 0.4);
root.add(blade2);
const blade3 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.119, 3), grassMat);
blade3.name = 'blade3';
blade3.position.set(0.2296, 0.1115, 0.3166);
blade3.rotation.set(deg(8.0679), deg(94.2124), deg(-9.6587));
blade3.scale.set(1, 1, 0.4);
root.add(blade3);
const blade4 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.0845, 3), stemMat);
blade4.name = 'blade4';
blade4.position.set(0.2612, 0.1088, -0.2588);
blade4.rotation.set(deg(-4.8226), deg(65.0081), deg(7.6047));
blade4.scale.set(1, 1, 0.4);
root.add(blade4);
const blade5 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.128, 3), grassMat);
blade5.name = 'blade5';
blade5.position.set(-0.1144, 0.1374, -0.3171);
blade5.rotation.set(deg(6.0813), deg(49.1873), deg(-8.1362));
blade5.scale.set(1, 1, 0.4);
root.add(blade5);
const blade6 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.0866, 3), grassMat);
blade6.name = 'blade6';
blade6.position.set(-0.2937, 0.0639, 0.303);
blade6.rotation.set(deg(12.7724), deg(104.637), deg(-3.9394));
blade6.scale.set(1, 1, 0.4);
root.add(blade6);
const blade7 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.1078, 3), stemMat);
blade7.name = 'blade7';
blade7.position.set(0.1036, 0.1542, -0.264);
blade7.rotation.set(deg(0.9368), deg(5.8827), deg(2.7624));
blade7.scale.set(1, 1, 0.4);
root.add(blade7);
const blade8 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.0807, 3), grassMat);
blade8.name = 'blade8';
blade8.position.set(-0.2267, 0.1104, 0.2885);
blade8.rotation.set(deg(9.2117), deg(34.8473), deg(5.7338));
blade8.scale.set(1, 1, 0.4);
root.add(blade8);
const blade9 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.1276, 3), grassMat);
blade9.name = 'blade9';
blade9.position.set(-0.0158, 0.1873, -0.2296);
blade9.rotation.set(deg(1.6302), deg(113.3624), deg(13.2996));
blade9.scale.set(1, 1, 0.4);
root.add(blade9);
const blade10 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.1206, 3), stemMat);
blade10.name = 'blade10';
blade10.position.set(0.3117, 0.1442, 0.0171);
blade10.rotation.set(deg(-2.4359), deg(69.8751), deg(-13.5899));
blade10.scale.set(1, 1, 0.4);
root.add(blade10);
const blade11 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.1218, 3), grassMat);
blade11.name = 'blade11';
blade11.position.set(0.3005, 0.0786, 0.2651);
blade11.rotation.set(deg(9.3836), deg(35.3938), deg(17.3414));
blade11.scale.set(1, 1, 0.4);
root.add(blade11);
const blade12 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.0925, 3), grassMat);
blade12.name = 'blade12';
blade12.position.set(-0.0546, 0.1084, -0.3664);
blade12.rotation.set(deg(16.465), deg(79.3709), deg(10.7437));
blade12.scale.set(1, 1, 0.4);
root.add(blade12);
const blade13 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.1348, 3), stemMat);
blade13.name = 'blade13';
blade13.position.set(0.3336, 0.145, 0.0653);
blade13.rotation.set(deg(-8.4536), deg(80.8951), deg(-17.2393));
blade13.scale.set(1, 1, 0.4);
root.add(blade13);
const blade14 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.1379, 3), grassMat);
blade14.name = 'blade14';
blade14.position.set(-0.1916, 0.1491, 0.2493);
blade14.rotation.set(deg(10.5939), deg(101.4318), deg(-6.5669));
blade14.scale.set(1, 1, 0.4);
root.add(blade14);
const blade15 = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.1277, 3), grassMat);
blade15.name = 'blade15';
blade15.position.set(-0.0271, 0.1766, 0.2479);
blade15.rotation.set(deg(0.2614), deg(30.973), deg(14.256));
blade15.scale.set(1, 1, 0.4);
root.add(blade15);
const stem1 = new THREE.Mesh(new THREE.CylinderGeometry(0.008, 0.011, 0.3369, 4), stemMat);
stem1.name = 'stem1';
stem1.position.set(0.1239, 0.2872, -0.0249);
stem1.rotation.set(deg(-2.0303), deg(0.1802), deg(-10.1426));
root.add(stem1);
const leaf1 = new THREE.Mesh(octahedronGeo, stemMat);
leaf1.name = 'leaf1';
leaf1.position.set(0.1339, 0.2449, 0.0048);
leaf1.rotation.set(0, deg(308.6695), deg(35));
leaf1.scale.set(0.05, 0.008, 0.018);
root.add(leaf1);
const flower1 = new THREE.Group();
flower1.name = 'flower1';
flower1.position.set(0.1536, 0.4529, -0.0309);
flower1.rotation.set(deg(38.3265), deg(44.1304), deg(-31.4884));
root.add(flower1);
const petal1 = new THREE.Mesh(octahedronGeo, petalAMat);
petal1.name = 'petal1';
petal1.position.set(0.0612, 0.004, 0);
petal1.rotation.set(0, 0, deg(14));
petal1.scale.set(0.0579, 0.0113, 0.0274);
flower1.add(petal1);
const petal2 = new THREE.Mesh(octahedronGeo, petalAMat);
petal2.name = 'petal2';
petal2.position.set(0.0381, 0.004, -0.0478);
petal2.rotation.set(0, deg(51.4286), deg(14));
petal2.scale.set(0.0579, 0.0113, 0.0274);
flower1.add(petal2);
const petal3 = new THREE.Mesh(octahedronGeo, petalAMat);
petal3.name = 'petal3';
petal3.position.set(-0.0136, 0.004, -0.0596);
petal3.rotation.set(0, deg(102.8571), deg(14));
petal3.scale.set(0.0579, 0.0113, 0.0274);
flower1.add(petal3);
const petal4 = new THREE.Mesh(octahedronGeo, petalAMat);
petal4.name = 'petal4';
petal4.position.set(-0.0551, 0.004, -0.0265);
petal4.rotation.set(0, deg(154.2857), deg(14));
petal4.scale.set(0.0579, 0.0113, 0.0274);
flower1.add(petal4);
const petal5 = new THREE.Mesh(octahedronGeo, petalAMat);
petal5.name = 'petal5';
petal5.position.set(-0.0551, 0.004, 0.0265);
petal5.rotation.set(0, deg(205.7143), deg(14));
petal5.scale.set(0.0579, 0.0113, 0.0274);
flower1.add(petal5);
const petal6 = new THREE.Mesh(octahedronGeo, petalAMat);
petal6.name = 'petal6';
petal6.position.set(-0.0136, 0.004, 0.0596);
petal6.rotation.set(0, deg(257.1429), deg(14));
petal6.scale.set(0.0579, 0.0113, 0.0274);
flower1.add(petal6);
const petal7 = new THREE.Mesh(octahedronGeo, petalAMat);
petal7.name = 'petal7';
petal7.position.set(0.0381, 0.004, 0.0478);
petal7.rotation.set(0, deg(308.5714), deg(14));
petal7.scale.set(0.0579, 0.0113, 0.0274);
flower1.add(petal7);
const center = new THREE.Mesh(new THREE.IcosahedronGeometry(0.0322, 0), heartMat);
center.name = 'center';
center.position.set(0, 0.008, 0);
center.scale.set(1, 0.6, 1);
flower1.add(center);
const stem2 = new THREE.Mesh(new THREE.CylinderGeometry(0.008, 0.011, 0.2091, 4), stemMat);
stem2.name = 'stem2';
stem2.position.set(-0.1226, 0.2147, 0.1096);
stem2.rotation.set(deg(2.7401), deg(0.0733), deg(3.064));
root.add(stem2);
const leaf2 = new THREE.Mesh(octahedronGeo, stemMat);
leaf2.name = 'leaf2';
leaf2.position.set(-0.1197, 0.197, 0.1426);
leaf2.rotation.set(0, deg(271.1922), deg(35));
leaf2.scale.set(0.05, 0.008, 0.018);
root.add(leaf2);
const flower2 = new THREE.Group();
flower2.name = 'flower2';
flower2.position.set(-0.1282, 0.319, 0.1146);
flower2.rotation.set(deg(18.8254), deg(42.6269), deg(9.1737));
root.add(flower2);
const petal12 = new THREE.Mesh(octahedronGeo, petalBMat);
petal12.name = 'petal1';
petal12.position.set(0.0587, 0.004, 0);
petal12.rotation.set(0, 0, deg(14));
petal12.scale.set(0.0556, 0.0108, 0.0263);
flower2.add(petal12);
const petal22 = new THREE.Mesh(octahedronGeo, petalBMat);
petal22.name = 'petal2';
petal22.position.set(0.0366, 0.004, -0.0459);
petal22.rotation.set(0, deg(51.4286), deg(14));
petal22.scale.set(0.0556, 0.0108, 0.0263);
flower2.add(petal22);
const petal32 = new THREE.Mesh(octahedronGeo, petalBMat);
petal32.name = 'petal3';
petal32.position.set(-0.0131, 0.004, -0.0573);
petal32.rotation.set(0, deg(102.8571), deg(14));
petal32.scale.set(0.0556, 0.0108, 0.0263);
flower2.add(petal32);
const petal42 = new THREE.Mesh(octahedronGeo, petalBMat);
petal42.name = 'petal4';
petal42.position.set(-0.0529, 0.004, -0.0255);
petal42.rotation.set(0, deg(154.2857), deg(14));
petal42.scale.set(0.0556, 0.0108, 0.0263);
flower2.add(petal42);
const petal52 = new THREE.Mesh(octahedronGeo, petalBMat);
petal52.name = 'petal5';
petal52.position.set(-0.0529, 0.004, 0.0255);
petal52.rotation.set(0, deg(205.7143), deg(14));
petal52.scale.set(0.0556, 0.0108, 0.0263);
flower2.add(petal52);
const petal62 = new THREE.Mesh(octahedronGeo, petalBMat);
petal62.name = 'petal6';
petal62.position.set(-0.0131, 0.004, 0.0573);
petal62.rotation.set(0, deg(257.1429), deg(14));
petal62.scale.set(0.0556, 0.0108, 0.0263);
flower2.add(petal62);
const petal72 = new THREE.Mesh(octahedronGeo, petalBMat);
petal72.name = 'petal7';
petal72.position.set(0.0366, 0.004, 0.0459);
petal72.rotation.set(0, deg(308.5714), deg(14));
petal72.scale.set(0.0556, 0.0108, 0.0263);
flower2.add(petal72);
const center2 = new THREE.Mesh(new THREE.IcosahedronGeometry(0.0309, 0), heartMat);
center2.name = 'center';
center2.position.set(0, 0.008, 0);
center2.scale.set(1, 0.6, 1);
flower2.add(center2);
const stem3 = new THREE.Mesh(new THREE.CylinderGeometry(0.008, 0.011, 0.2261, 4), stemMat);
stem3.name = 'stem3';
stem3.position.set(0.0057, 0.2283, -0.2149);
stem3.rotation.set(deg(-7.5676), deg(0.0132), deg(-0.1997));
root.add(stem3);
const leaf3 = new THREE.Mesh(octahedronGeo, stemMat);
leaf3.name = 'leaf3';
leaf3.position.set(0.0089, 0.2075, -0.2438);
leaf3.rotation.set(0, deg(84.4683), deg(35));
leaf3.scale.set(0.05, 0.008, 0.018);
root.add(leaf3);
const flower3 = new THREE.Group();
flower3.name = 'flower3';
flower3.position.set(0.0061, 0.3404, -0.2298);
flower3.rotation.set(deg(2.4542), deg(49.848), deg(-0.7541));
root.add(flower3);
const petal13 = new THREE.Mesh(octahedronGeo, petalCMat);
petal13.name = 'petal1';
petal13.position.set(0.0719, 0.004, 0);
petal13.rotation.set(0, 0, deg(14));
petal13.scale.set(0.0681, 0.0132, 0.0322);
flower3.add(petal13);
const petal23 = new THREE.Mesh(octahedronGeo, petalCMat);
petal23.name = 'petal2';
petal23.position.set(0.0448, 0.004, -0.0562);
petal23.rotation.set(0, deg(51.4286), deg(14));
petal23.scale.set(0.0681, 0.0132, 0.0322);
flower3.add(petal23);
const petal33 = new THREE.Mesh(octahedronGeo, petalCMat);
petal33.name = 'petal3';
petal33.position.set(-0.016, 0.004, -0.0701);
petal33.rotation.set(0, deg(102.8571), deg(14));
petal33.scale.set(0.0681, 0.0132, 0.0322);
flower3.add(petal33);
const petal43 = new THREE.Mesh(octahedronGeo, petalCMat);
petal43.name = 'petal4';
petal43.position.set(-0.0648, 0.004, -0.0312);
petal43.rotation.set(0, deg(154.2857), deg(14));
petal43.scale.set(0.0681, 0.0132, 0.0322);
flower3.add(petal43);
const petal53 = new THREE.Mesh(octahedronGeo, petalCMat);
petal53.name = 'petal5';
petal53.position.set(-0.0648, 0.004, 0.0312);
petal53.rotation.set(0, deg(205.7143), deg(14));
petal53.scale.set(0.0681, 0.0132, 0.0322);
flower3.add(petal53);
const petal63 = new THREE.Mesh(octahedronGeo, petalCMat);
petal63.name = 'petal6';
petal63.position.set(-0.016, 0.004, 0.0701);
petal63.rotation.set(0, deg(257.1429), deg(14));
petal63.scale.set(0.0681, 0.0132, 0.0322);
flower3.add(petal63);
const petal73 = new THREE.Mesh(octahedronGeo, petalCMat);
petal73.name = 'petal7';
petal73.position.set(0.0448, 0.004, 0.0562);
petal73.rotation.set(0, deg(308.5714), deg(14));
petal73.scale.set(0.0681, 0.0132, 0.0322);
flower3.add(petal73);
const center3 = new THREE.Mesh(new THREE.IcosahedronGeometry(0.0378, 0), heartMat);
center3.name = 'center';
center3.position.set(0, 0.008, 0);
center3.scale.set(1, 0.6, 1);
flower3.add(center3);
const stem4 = new THREE.Mesh(new THREE.CylinderGeometry(0.008, 0.011, 0.2301, 4), stemMat);
stem4.name = 'stem4';
stem4.position.set(0.1596, 0.21, 0.2032);
stem4.rotation.set(deg(9.0031), deg(-0.5564), deg(-7.0581));
root.add(stem4);
const leaf4 = new THREE.Mesh(octahedronGeo, stemMat);
leaf4.name = 'leaf4';
leaf4.position.set(0.1861, 0.1889, 0.1822);
leaf4.rotation.set(0, deg(23.2608), deg(35));
leaf4.scale.set(0.05, 0.008, 0.018);
root.add(leaf4);
const flower4 = new THREE.Group();
flower4.name = 'flower4';
flower4.position.set(0.1737, 0.3228, 0.2212);
flower4.rotation.set(deg(37.2747), deg(2.5675), deg(-13.6628));
root.add(flower4);
const petal14 = new THREE.Mesh(octahedronGeo, petalDMat);
petal14.name = 'petal1';
petal14.position.set(0.0641, 0.004, 0);
petal14.rotation.set(0, 0, deg(14));
petal14.scale.set(0.0608, 0.0118, 0.0287);
flower4.add(petal14);
const petal24 = new THREE.Mesh(octahedronGeo, petalDMat);
petal24.name = 'petal2';
petal24.position.set(0.04, 0.004, -0.0502);
petal24.rotation.set(0, deg(51.4286), deg(14));
petal24.scale.set(0.0608, 0.0118, 0.0287);
flower4.add(petal24);
const petal34 = new THREE.Mesh(octahedronGeo, petalDMat);
petal34.name = 'petal3';
petal34.position.set(-0.0143, 0.004, -0.0625);
petal34.rotation.set(0, deg(102.8571), deg(14));
petal34.scale.set(0.0608, 0.0118, 0.0287);
flower4.add(petal34);
const petal44 = new THREE.Mesh(octahedronGeo, petalDMat);
petal44.name = 'petal4';
petal44.position.set(-0.0578, 0.004, -0.0278);
petal44.rotation.set(0, deg(154.2857), deg(14));
petal44.scale.set(0.0608, 0.0118, 0.0287);
flower4.add(petal44);
const petal54 = new THREE.Mesh(octahedronGeo, petalDMat);
petal54.name = 'petal5';
petal54.position.set(-0.0578, 0.004, 0.0278);
petal54.rotation.set(0, deg(205.7143), deg(14));
petal54.scale.set(0.0608, 0.0118, 0.0287);
flower4.add(petal54);
const petal64 = new THREE.Mesh(octahedronGeo, petalDMat);
petal64.name = 'petal6';
petal64.position.set(-0.0143, 0.004, 0.0625);
petal64.rotation.set(0, deg(257.1429), deg(14));
petal64.scale.set(0.0608, 0.0118, 0.0287);
flower4.add(petal64);
const petal74 = new THREE.Mesh(octahedronGeo, petalDMat);
petal74.name = 'petal7';
petal74.position.set(0.04, 0.004, 0.0502);
petal74.rotation.set(0, deg(308.5714), deg(14));
petal74.scale.set(0.0608, 0.0118, 0.0287);
flower4.add(petal74);
const center4 = new THREE.Mesh(new THREE.IcosahedronGeometry(0.0338, 0), heartMat);
center4.name = 'center';
center4.position.set(0, 0.008, 0);
center4.scale.set(1, 0.6, 1);
flower4.add(center4);
const stem5 = new THREE.Mesh(new THREE.CylinderGeometry(0.008, 0.011, 0.2792, 4), stemMat);
stem5.name = 'stem5';
stem5.position.set(-0.2819, 0.226, -0.0428);
stem5.rotation.set(deg(-1.1688), deg(-0.0788), deg(7.7151));
root.add(stem5);
const leaf5 = new THREE.Mesh(octahedronGeo, stemMat);
leaf5.name = 'leaf5';
leaf5.position.set(-0.2599, 0.1947, -0.0736);
leaf5.rotation.set(0, deg(65.5715), deg(35));
leaf5.scale.set(0.05, 0.008, 0.018);
root.add(leaf5);
const flower5 = new THREE.Group();
flower5.name = 'flower5';
flower5.position.set(-0.3006, 0.3643, -0.0457);
flower5.rotation.set(deg(6.7788), deg(29.9035), deg(19.8111));
root.add(flower5);
const petal15 = new THREE.Mesh(octahedronGeo, petalAMat);
petal15.name = 'petal1';
petal15.position.set(0.0633, 0.004, 0);
petal15.rotation.set(0, 0, deg(14));
petal15.scale.set(0.0599, 0.0117, 0.0283);
flower5.add(petal15);
const petal25 = new THREE.Mesh(octahedronGeo, petalAMat);
petal25.name = 'petal2';
petal25.position.set(0.0395, 0.004, -0.0495);
petal25.rotation.set(0, deg(51.4286), deg(14));
petal25.scale.set(0.0599, 0.0117, 0.0283);
flower5.add(petal25);
const petal35 = new THREE.Mesh(octahedronGeo, petalAMat);
petal35.name = 'petal3';
petal35.position.set(-0.0141, 0.004, -0.0617);
petal35.rotation.set(0, deg(102.8571), deg(14));
petal35.scale.set(0.0599, 0.0117, 0.0283);
flower5.add(petal35);
const petal45 = new THREE.Mesh(octahedronGeo, petalAMat);
petal45.name = 'petal4';
petal45.position.set(-0.057, 0.004, -0.0275);
petal45.rotation.set(0, deg(154.2857), deg(14));
petal45.scale.set(0.0599, 0.0117, 0.0283);
flower5.add(petal45);
const petal55 = new THREE.Mesh(octahedronGeo, petalAMat);
petal55.name = 'petal5';
petal55.position.set(-0.057, 0.004, 0.0275);
petal55.rotation.set(0, deg(205.7143), deg(14));
petal55.scale.set(0.0599, 0.0117, 0.0283);
flower5.add(petal55);
const petal65 = new THREE.Mesh(octahedronGeo, petalAMat);
petal65.name = 'petal6';
petal65.position.set(-0.0141, 0.004, 0.0617);
petal65.rotation.set(0, deg(257.1429), deg(14));
petal65.scale.set(0.0599, 0.0117, 0.0283);
flower5.add(petal65);
const petal75 = new THREE.Mesh(octahedronGeo, petalAMat);
petal75.name = 'petal7';
petal75.position.set(0.0395, 0.004, 0.0495);
petal75.rotation.set(0, deg(308.5714), deg(14));
petal75.scale.set(0.0599, 0.0117, 0.0283);
flower5.add(petal75);
const center5 = new THREE.Mesh(new THREE.IcosahedronGeometry(0.0333, 0), heartMat);
center5.name = 'center';
center5.position.set(0, 0.008, 0);
center5.scale.set(1, 0.6, 1);
flower5.add(center5);
const stem6 = new THREE.Mesh(new THREE.CylinderGeometry(0.008, 0.011, 0.2279, 4), stemMat);
stem6.name = 'stem6';
stem6.position.set(0.2528, 0.1974, -0.1902);
stem6.rotation.set(deg(-6.8732), deg(0.5509), deg(-9.1545));
root.add(stem6);
const leaf6 = new THREE.Mesh(octahedronGeo, stemMat);
leaf6.name = 'leaf6';
leaf6.position.set(0.2699, 0.1767, -0.1595);
leaf6.rotation.set(0, deg(314.0266), deg(35));
leaf6.scale.set(0.05, 0.008, 0.018);
root.add(leaf6);
const flower6 = new THREE.Group();
flower6.name = 'flower6';
flower6.position.set(0.2709, 0.3091, -0.2038);
flower6.rotation.set(deg(5.5963), deg(4.9944), deg(-21.4647));
root.add(flower6);
const petal16 = new THREE.Mesh(octahedronGeo, petalBMat);
petal16.name = 'petal1';
petal16.position.set(0.0651, 0.004, 0);
petal16.rotation.set(0, 0, deg(14));
petal16.scale.set(0.0616, 0.012, 0.0291);
flower6.add(petal16);
const petal26 = new THREE.Mesh(octahedronGeo, petalBMat);
petal26.name = 'petal2';
petal26.position.set(0.0406, 0.004, -0.0509);
petal26.rotation.set(0, deg(51.4286), deg(14));
petal26.scale.set(0.0616, 0.012, 0.0291);
flower6.add(petal26);
const petal36 = new THREE.Mesh(octahedronGeo, petalBMat);
petal36.name = 'petal3';
petal36.position.set(-0.0145, 0.004, -0.0634);
petal36.rotation.set(0, deg(102.8571), deg(14));
petal36.scale.set(0.0616, 0.012, 0.0291);
flower6.add(petal36);
const petal46 = new THREE.Mesh(octahedronGeo, petalBMat);
petal46.name = 'petal4';
petal46.position.set(-0.0586, 0.004, -0.0282);
petal46.rotation.set(0, deg(154.2857), deg(14));
petal46.scale.set(0.0616, 0.012, 0.0291);
flower6.add(petal46);
const petal56 = new THREE.Mesh(octahedronGeo, petalBMat);
petal56.name = 'petal5';
petal56.position.set(-0.0586, 0.004, 0.0282);
petal56.rotation.set(0, deg(205.7143), deg(14));
petal56.scale.set(0.0616, 0.012, 0.0291);
flower6.add(petal56);
const petal66 = new THREE.Mesh(octahedronGeo, petalBMat);
petal66.name = 'petal6';
petal66.position.set(-0.0145, 0.004, 0.0634);
petal66.rotation.set(0, deg(257.1429), deg(14));
petal66.scale.set(0.0616, 0.012, 0.0291);
flower6.add(petal66);
const petal76 = new THREE.Mesh(octahedronGeo, petalBMat);
petal76.name = 'petal7';
petal76.position.set(0.0406, 0.004, 0.0509);
petal76.rotation.set(0, deg(308.5714), deg(14));
petal76.scale.set(0.0616, 0.012, 0.0291);
flower6.add(petal76);
const center6 = new THREE.Mesh(new THREE.IcosahedronGeometry(0.0342, 0), heartMat);
center6.name = 'center';
center6.position.set(0, 0.008, 0);
center6.scale.set(1, 0.6, 1);
flower6.add(center6);
const stem7 = new THREE.Mesh(new THREE.CylinderGeometry(0.008, 0.011, 0.2671, 4), stemMat);
stem7.name = 'stem7';
stem7.position.set(-0.0423, 0.2125, 0.337);
stem7.rotation.set(deg(8.9179), deg(0.0868), deg(1.1135));
root.add(stem7);
const leaf7 = new THREE.Mesh(octahedronGeo, stemMat);
leaf7.name = 'leaf7';
leaf7.position.set(-0.0206, 0.1838, 0.3571);
leaf7.rotation.set(0, deg(306.0726), deg(35));
leaf7.scale.set(0.05, 0.008, 0.018);
root.add(leaf7);
const flower7 = new THREE.Group();
flower7.name = 'flower7';
flower7.position.set(-0.0448, 0.3445, 0.3577);
flower7.rotation.set(deg(35.3443), deg(18.7493), deg(2.2892));
root.add(flower7);
const petal17 = new THREE.Mesh(octahedronGeo, petalCMat);
petal17.name = 'petal1';
petal17.position.set(0.064, 0.004, 0);
petal17.rotation.set(0, 0, deg(14));
petal17.scale.set(0.0607, 0.0118, 0.0287);
flower7.add(petal17);
const petal27 = new THREE.Mesh(octahedronGeo, petalCMat);
petal27.name = 'petal2';
petal27.position.set(0.0399, 0.004, -0.0501);
petal27.rotation.set(0, deg(51.4286), deg(14));
petal27.scale.set(0.0607, 0.0118, 0.0287);
flower7.add(petal27);
const petal37 = new THREE.Mesh(octahedronGeo, petalCMat);
petal37.name = 'petal3';
petal37.position.set(-0.0143, 0.004, -0.0624);
petal37.rotation.set(0, deg(102.8571), deg(14));
petal37.scale.set(0.0607, 0.0118, 0.0287);
flower7.add(petal37);
const petal47 = new THREE.Mesh(octahedronGeo, petalCMat);
petal47.name = 'petal4';
petal47.position.set(-0.0577, 0.004, -0.0278);
petal47.rotation.set(0, deg(154.2857), deg(14));
petal47.scale.set(0.0607, 0.0118, 0.0287);
flower7.add(petal47);
const petal57 = new THREE.Mesh(octahedronGeo, petalCMat);
petal57.name = 'petal5';
petal57.position.set(-0.0577, 0.004, 0.0278);
petal57.rotation.set(0, deg(205.7143), deg(14));
petal57.scale.set(0.0607, 0.0118, 0.0287);
flower7.add(petal57);
const petal67 = new THREE.Mesh(octahedronGeo, petalCMat);
petal67.name = 'petal6';
petal67.position.set(-0.0143, 0.004, 0.0624);
petal67.rotation.set(0, deg(257.1429), deg(14));
petal67.scale.set(0.0607, 0.0118, 0.0287);
flower7.add(petal67);
const petal77 = new THREE.Mesh(octahedronGeo, petalCMat);
petal77.name = 'petal7';
petal77.position.set(0.0399, 0.004, 0.0501);
petal77.rotation.set(0, deg(308.5714), deg(14));
petal77.scale.set(0.0607, 0.0118, 0.0287);
flower7.add(petal77);
const center7 = new THREE.Mesh(new THREE.IcosahedronGeometry(0.0337, 0), heartMat);
center7.name = 'center';
center7.position.set(0, 0.008, 0);
center7.scale.set(1, 0.6, 1);
flower7.add(center7);
const stem8 = new THREE.Mesh(new THREE.CylinderGeometry(0.008, 0.011, 0.2462, 4), stemMat);
stem8.name = 'stem8';
stem8.position.set(-0.1802, 0.1803, -0.3086);
stem8.rotation.set(deg(-6.1498), deg(-0.1928), deg(3.587));
root.add(stem8);
const leaf8 = new THREE.Mesh(octahedronGeo, stemMat);
leaf8.name = 'leaf8';
leaf8.position.set(-0.1803, 0.1554, -0.2684);
leaf8.rotation.set(0, deg(264.9616), deg(35));
leaf8.scale.set(0.05, 0.008, 0.018);
root.add(leaf8);
const flower8 = new THREE.Group();
flower8.name = 'flower8';
flower8.position.set(-0.1879, 0.3024, -0.3218);
flower8.rotation.set(deg(2.9847), deg(15.6536), deg(8.8859));
root.add(flower8);
const petal18 = new THREE.Mesh(octahedronGeo, petalDMat);
petal18.name = 'petal1';
petal18.position.set(0.0571, 0.004, 0);
petal18.rotation.set(0, 0, deg(14));
petal18.scale.set(0.0541, 0.0105, 0.0256);
flower8.add(petal18);
const petal28 = new THREE.Mesh(octahedronGeo, petalDMat);
petal28.name = 'petal2';
petal28.position.set(0.0356, 0.004, -0.0447);
petal28.rotation.set(0, deg(51.4286), deg(14));
petal28.scale.set(0.0541, 0.0105, 0.0256);
flower8.add(petal28);
const petal38 = new THREE.Mesh(octahedronGeo, petalDMat);
petal38.name = 'petal3';
petal38.position.set(-0.0127, 0.004, -0.0557);
petal38.rotation.set(0, deg(102.8571), deg(14));
petal38.scale.set(0.0541, 0.0105, 0.0256);
flower8.add(petal38);
const petal48 = new THREE.Mesh(octahedronGeo, petalDMat);
petal48.name = 'petal4';
petal48.position.set(-0.0515, 0.004, -0.0248);
petal48.rotation.set(0, deg(154.2857), deg(14));
petal48.scale.set(0.0541, 0.0105, 0.0256);
flower8.add(petal48);
const petal58 = new THREE.Mesh(octahedronGeo, petalDMat);
petal58.name = 'petal5';
petal58.position.set(-0.0515, 0.004, 0.0248);
petal58.rotation.set(0, deg(205.7143), deg(14));
petal58.scale.set(0.0541, 0.0105, 0.0256);
flower8.add(petal58);
const petal68 = new THREE.Mesh(octahedronGeo, petalDMat);
petal68.name = 'petal6';
petal68.position.set(-0.0127, 0.004, 0.0557);
petal68.rotation.set(0, deg(257.1429), deg(14));
petal68.scale.set(0.0541, 0.0105, 0.0256);
flower8.add(petal68);
const petal78 = new THREE.Mesh(octahedronGeo, petalDMat);
petal78.name = 'petal7';
petal78.position.set(0.0356, 0.004, 0.0447);
petal78.rotation.set(0, deg(308.5714), deg(14));
petal78.scale.set(0.0541, 0.0105, 0.0256);
flower8.add(petal78);
const center8 = new THREE.Mesh(new THREE.IcosahedronGeometry(0.0301, 0), heartMat);
center8.name = 'center';
center8.position.set(0, 0.008, 0);
center8.scale.set(1, 0.6, 1);
flower8.add(center8);
root.traverse((o) => {
if (o.isMesh) {
o.castShadow = true;
o.receiveShadow = true;
}
});
return root;
}
export default createFlowerPatch;
Ratings & comments
0 comments
No comments yet. Share how you used this model or what could be better.
Related models
Same category or similar tags









