Assignment 4: Generative Text

For this project, I was inspired by the windows at the Louvre Abu Dhabi that have quotes on them. I’ve always thought that poetry is incredibly beautiful powerful, and something that could have a section in a museum to inspire those that want to read it. Therefore, for my project, I decided to create what I call the “The Museum of Poems”. The concept involves a museum scene with a frame in the very center that displays a random quote about love or life for the person to see. My hope is that whatever they read, although short, inspires them or motivates them in some way. I gathered 2-line poems from various reddit posts, online blogs, quora posts, and even ChatGPT, and put them all into a giant list for the program to pick and display at random. My museum ended up looking like this:

The hardest part of this project was that after I initially finished, I accidentally clicked refresh and lost the entire project. I thought I had saved it, but turns out I hadn’t, and there was no way to recover it. Luckily, there was a point where I asked ChatGPT to help me solve a problem I was running into and gave it all my code, so I could copy that back. However, this was still in the earlier stage of my project, and I had to redo a lot of it from scratch including importing all my fonts and images again, putting in all the poems in the list, the gradient background, the wood flooring, etc. Speaking of the gradient background, that part along with the wood flooring is the part of the code I am most proud of. I had to learn how to use the lerpColor function, mapping properly, as well as using an image in repetition to create a pattern. The result can be seen here:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
//Creates the entire background and floor of the museum
function drawMuseum() {
//Draws the gradient background
for (let i = 0; i <= height - 100; i++) {
let inter = map(i, 0, height - 100, 0, 1);
let wallColor = lerpColor(color('#ECC2EC'), color('#DCB5A5'), inter);
stroke(wallColor);
line(0, i, width, i);
}
// Creates the wood texture on the floor
for (let i = 0; i < width + 50; i += 100) {
// Draw the first set of wood planks
image(wood, i, height - 100, 100, 50);
image(wood, i - 50, height - 50, 100, 50);
// Adds borders around each plank
stroke('#BC7C64');
noFill();
rect(i, height - 100, 100, 50);
rect(i - 50, height - 50, 100, 50);
}
}
//Creates the entire background and floor of the museum function drawMuseum() { //Draws the gradient background for (let i = 0; i <= height - 100; i++) { let inter = map(i, 0, height - 100, 0, 1); let wallColor = lerpColor(color('#ECC2EC'), color('#DCB5A5'), inter); stroke(wallColor); line(0, i, width, i); } // Creates the wood texture on the floor for (let i = 0; i < width + 50; i += 100) { // Draw the first set of wood planks image(wood, i, height - 100, 100, 50); image(wood, i - 50, height - 50, 100, 50); // Adds borders around each plank stroke('#BC7C64'); noFill(); rect(i, height - 100, 100, 50); rect(i - 50, height - 50, 100, 50); } }
//Creates the entire background and floor of the museum
function drawMuseum() {

  //Draws the gradient background
  for (let i = 0; i <= height - 100; i++) {
    let inter = map(i, 0, height - 100, 0, 1);
    let wallColor = lerpColor(color('#ECC2EC'), color('#DCB5A5'), inter);
    stroke(wallColor);
    line(0, i, width, i); 
  }
  
 // Creates the wood texture on the floor
  for (let i = 0; i < width + 50; i += 100) {
    // Draw the first set of wood planks
    image(wood, i, height - 100, 100, 50); 
    image(wood, i - 50, height - 50, 100, 50);
    
  // Adds borders around each plank
    stroke('#BC7C64');
    noFill();
    rect(i, height - 100, 100, 50);
    rect(i - 50, height - 50, 100, 50);
  }
}

Overall, I am really proud of how the “The Museum of Poems” turned out. I wish though, that I could make it somehow look more realistic. I feel like the wall and the flooring has a pretty big contrast in terms of aesthetic which is something to consider for the future.

 

One thought on “Assignment 4: Generative Text”

  1. Time permitting we’re going to be looking at GitHub soon, which is a great place to store versions of your code so if anything is accidentally changed it’s easy to go back.

Leave a Reply