Add text content to object property
Wed May 10 2023 04:15:34 GMT+0000 (Coordinated Universal Time)
Saved by @yc_lan
const poemContent = [
"<h3>The Vanishing Act</h3> The clouds that once hung overhead <br> Now fade away like dreams once dreamed <br> Their wispy forms, like fading ghosts<br> Disappear into the blue expanse",
"<h3>The Heavy Heart</h3> Grey clouds loom above like weights,<br> Heavy with sorrow and despair.<br> They mirror the heart's heavy ache <br> A burden too great to bear.",
"<h3>The Lost Wanderer</h3> The clouds are a guide for the lost,<br>A beacon in the sky's vast expanse.<br>They lead the way through storm and frost,<br>A compass for the wandering nomad.",
"<h3>The Reflection</h3> The clouds reflect the soul's turmoil,<br>A mirror of our innermost fears.<br>Their fleeting forms a constant reminder,<br>That all must pass, even our tears.",
"<h3>The Love Letter</h3> The clouds above, a love letter to the earth,<br>A tender embrace from heaven's berth.<br>Their gentle touch, a reminder of grace,<br>A promise that love never leaves its place.",
"<h3>The Hopeful</h3> The clouds above, a sign of hope,<br>A symbol of a brighter tomorrow.<br>Their fleeting nature a testament,<br>To the ever-changing nature of our sorrows.",
"<h3>The Starry Night</h3> The clouds above, a canvas of the night,<br>A backdrop for the stars' brilliant light.<br>Their fleeting forms a reminder,<br>That even the sky can change in time.",
"<h3>Mourning Skies</h3> Gray clouds drift in the sky,<br>A somber mood they imply,<br>Heavy with tears they cry,<br>A mournful melody they supply.",
"<h3>Impending Storm</h3> The clouds gather in the sky,<br> A foreboding sight up high,<br>A storm is coming I sigh,<br>A feeling of impending goodbye.<br>",
"<h3>Lonely Clouds</h3> Wispy clouds float on by,<br>A peaceful scene they imply,<br>But my heart cannot deny,<br>The loneliness I feel inside."
]
// create three kinds of cloud
for (let i = 0; i < 3; i++) {
let ClassObject = new cloud(
(Math.random() - 0.5) * 10000,
(Math.random() - 0.5) * 100 + 400,
(Math.random() - 0.5) * 8000,
scene,
);
CloudObjectArray.push(ClassObject);
}
for (let i = 0; i < 4; i++) {
let ClassObject = new cloud2(
(Math.random() - 0.5) * 10000,
(Math.random() - 0.5) * 100 + 400,
(Math.random() - 0.5) * 8000,
scene,
// camera.position
);
CloudObjectArray.push(ClassObject);
}
for (let i = 0; i < 3; i++) {
let ClassObject = new cloud3(
(Math.random() - 0.5) * 10000,
(Math.random() - 0.5) * 100 + 400,
(Math.random() - 0.5) * 8000,
scene);
CloudObjectArray.push(ClassObject);
}
CloudObjectArray.forEach( (obj,i) => { obj['name'] = poemContent[ i ]; } );



Comments