Concept:
For this assignment, I did some research on generative artworks in p5js. After browsing some of the published work on the blogs found here, I got inspired to create an artwork which will pay homage to old computers, or, more specifically the green letters on black background found in retro devices. This way I was able to connect two different levels of the computer evolution which itself is evidence of our progress.
Code and realization:
As a person with little experience in coding, this assignment was a great challenge, especially trying to avoid getting stuck into infinite loops as in my case I used an if loop inside of the for loop. The past classes on loops and basic shapes helped me create the grid of lines which are then altered as the mouse cursor moves over them.
Here’s a segment of the code I am especially proud of as it took me several trials and a lot of debugging to get it working:
for (let y = spacing/2; y < height; y += spacing) { let offset = map(mouseY, 0, height, -spacing/4, spacing/4); if (abs(y - mouseY) < spacing/2) { offset = offset * 2; }
This part of my program controls how the lines react to the mouse movement, especially if the y coordinate of the line is less than the y coordinate of the mouse.
Final Product:
Reflection:
This assignment was a great way to express our creativity and thought process. While I managed to get the program to work and be interactive, I feel like I can improve its interactivity and add more elements in the future.