week3–generative artwork

Concept

 I often find myself wondering: beneath all the sleek design and high-definition media, what is the internet really made of? At its core, it’s nothing more than basic lines of text, numbers, and code.

This project is my exploration of that idea. By using basic alphanumeric characters (a-z, 0-9,@#%?&) as the fundamental “atoms” of my digital canvas, I let them generate randomly while using code to keep them organized and separated. It’s my way of turning raw, invisible data into a visual piece of art.

How this was made?

One problem I met at first is how to prevent the letters from overlap.instead of writing super long and confusing if statements to prevent letters from crashing into each other, I used a  return;. If a new letter gets too close to an old one, the code just stops right away and tries again next time. It’s super simple and keeps the code clean.

for (let i = 0; i < charCount; i = i + 1) {
    let c = chars[i];
    let d = dist(x, y, c.x, c.y); 
    if (d < (size + c.size) * 0.45) {
      return; 
    }
  }

I didn’t just store the letter itself in the array. I packed its X/Y positions, size, letter type, and RGB colors together into one object. This makes it super easy later—my drawCharacter() function knows exactly how to paint it.

chars.push({
    x: x,
    y: y,
    char: symbol,
    size: size,
    r: rgb[0],  
    g: rgb[1],  
    b: rgb[2]
  })

When I was setting up the object properties, my instinct was to write something simple like “color:rgb” or directly grab an entry from color palette  I thought, “Why can’t I just store the whole color array together and hand it to fill()?” But when I tried that, p5.js didn’t handle the color array the way I expected inside fill(). I was so confused until I realized I had to unpack the array and store the RGB values as three separate properties (r, g, b) inside each object so fill(c.r, c.g, c.b) could read them smoothly.

Reflection

To be completely honest, my code went wrong a million times before it finally worked. Going into this project, I knew using an array was a strict requirement, but I didn’t actually have a deep understanding of how arrays function under the hood.

I spent a huge amount of time just trying to wrap my head around one fundamental question: Why couldn’t I just pick a random letter and a position inside AddCharacter() and paint it right onto the screen? Why did I have to save everything into an array first, and then write a completely separate for loop inside draw() just to repaint it every single frame? Wrestling with this concept and breaking down p5.js’s frame-by-frame rendering loop was easily the biggest learning curve for me.

Looking back, there are definitely things I wish I could have added: I wanted to experiment with cooler typography effects, like adding soft ghosting or motion shadows behind the characters, but it felt a bit too complex for my current skill level, so I decided to keep the visuals simple for now.And  I’d love to explore adding interactivity in future versions—such as letting users click anywhere on the canvas to spawn specific words, using mouse clicks to control the generation order, or adding a click-to-clear button to reset the canvas and start over.

week3–reading reflection

Based on Chris Crawford’s reading, string interaction acts like a two way conversation that needs solid listening, thinking and responding, and one weak part can break the whole experience.Beyond this idea,I also believe a good interactive system should feel approachable for regular users and give them room to experiment without breaking everything.human comfort also shaped the interaction.Even if a system completes the input-process-output loop, it stills fails as interactive work if users feel worrying they will crash the sketch etc.It should also meet users halfway:it does not demand expert knowledge to participate.New users can find satisfying results with simple actions, while people who dig deeper can still find more complex effects.there should not only be one “correct” way to interact.Multiple different user choice can all lead to interesting outcomes, rather than forcing users to follow one intended path.

For my own p5 sketch, I can make general improvements across Crawford’s three interaction stages. For better listening,  I can try to out some music ,or built some interactions that allow users to record their own voice.For better thinking, I can let the system remember past user activity so responses build over time, instead of always triggering the same fixed outcome. For better speaking, I can add clear feedback so users can tell how their actions affect what they see.

 

Week2–Generative art

My concept

After watching the video, I wanted to experiment with randomness in my artwork and discover what visual possibilities it could create.
I realised that the effect of chance would not be very clear within just one static image. For this reason, I used ‘mousePressed’ as an interactive feature: every click reruns all the random values and generates a brand‑new composition. This allows the viewer to see the wide variety of outcomes produced by one single system.
I chose two simple forms: bezier curves and circles of varying sizes. I defined their general shape, boundaries and direction, while letting random() decide their exact position, size and colour. Rather than placing each curve and circle by hand, I let the code produce unexpected arrangements. My aim is to observe the balances and relationships between curves and circles.

How this was made?

for (let i = 0; i < 10; i++) {
    let circleX = random(30, width - 30);
    let circleY = random(30, height - 30);
    let diameter = random(15, 90);
    noStroke();
    fill(random(255), random(255), random(255));
    circle(circleX, circleY, diameter);
  }

For the random circles I used a for‑loop. I wanted ten circles in total. Their coordinates are random, and so are their diameters. However, I set rough limits for these values: a range for their size and another for their position. Their colours are also random.

for (let m = 0; m < 8; m++) {
    drawCurve();
  }
function drawCurve() {
  let x1 = random(-20, width + 20);
  let y1 = random(-20, 0);
  for(let i = 0; i < 8; i++){
    let cx1 = x1 + random(-75,75);
    let cy1 = y1 + random(-65,65);
    let cx2 = x1 + random(-75,75);
    let cy2 = y1 + random(35,95);
    let x2 = x1 + random(-55,55);
    let y2 = y1 + random(65,115);

    bezier(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
    x1 = x2;
    y1 = y2;
  }
}

For the lines, I was not sure at first which shape to use. After checking the p5.js reference page, I found that the bezier curve worked best for my idea. I then briefly learned how its coordinates function and how to control them, and started to build my curves.
I discovered that without startX = endX and startY = endY, all the segments would cluster near the top of the canvas and would not connect together. This created a problem. Once I noticed this issue, I adjusted my code and asked AI to help me understand why it was happening.

Reflection

I have realised that creating artwork with random() saves a lot of time. Unlike my self‑portrait project, where I had to carefully refine every single detail, randomness can unexpectedly produce really appealing patterns. I feel I could use randomness more often in my future artworks. I really enjoyed this creative process and kept experimenting throughout. Right now I have only used curves and circles, which are still quite basic and simple. I hope in the future I can use randomness to generate more complex forms.

Week2–video reflection

For me, I feel that every artwork needs to represent something that the artist wants to express. An artwork should communicate an idea or feeling.Therefore, I do not want randomness to decide what my work is trying to express. Instead, I want randomness to help me decide what my work looks like.

For example, when I am creating a project, I can first decide what I want to express and what kind of overall atmosphere I want the work to have. Then, I can use randomness to control certain elements, such as shapes, lines, or color. In this way, randomness is not replacing my creative decisions. Instead, it helps me discover forms that I might not have thought of on my own.

As for the optimal balance between randomness and control, I think it is difficult to define. I do not think a 50/50 balance is necessarily the best one. It depends on the final form of the artwork and on how much randomness the artist wants to allow. In other words, I think the important question is not how much randomness we use, but how much of the final result we are willing to give up control over.

I also think randomness can help us discover things we did not know we liked. randomness can produce a result that we did not  choose at first. When we see that unexpected result, we might actually like it. In this sense, randomness expands the possibilities we can choose from.

 

Week1–self portrait

My concept

My goal was to represent not only my appearance, but also some aspects of my personality that are important to me.

Before this assignment, I had no experience with programming or p5.js. Since I wanted to do a good job on my first assignment, I spent a lot of time learning the basics, experimenting with the code, and using different resources, including AI, to help me solve problems and develop my ideas.

I realized that simply drawing myself could not fully represent my personality. Therefore, I added an interactive element using words that are related to me. Through these interactions, I wanted to give the audience more information about my personality and make the representation of myself more complete.

How this was made?

interactive–words

//Chinese
  if(mouseIsPressed && dist(mouseX,mouseY,100,120)<40){
    text("Chinese",72,125);}
  
  //Creative
  if(mouseIsPressed && dist(mouseX,mouseY,60,250)<40){
    text("Creative",32,255);}
  
  //Hungry
  if(mouseIsPressed && dist(mouseX,mouseY,60,400)<40){
    text("Hungry",34,405);}

My goal was to make some words describing my personality appear when I press the mouse over the circles. Since I did not know how to create this interaction, I used AI to help me figure it out. Through this process, I learned how to use an if statement with mouseIsPressed and the distance between the mouse and the circle to control when the text appears. I also understood the logic behind this type of interaction, rather than just using the code without knowing how it works.

Color

For the colors, I used a website called Color Picker. I could adjust the color using its color wheel and get the corresponding RGB values. I then used these RGB values in my p5.js code to choose the colors for my project.

Shapes

For the shapes, I also used AI to help me understand how to use coordinates to control the position of different shapes. One of the most useful things I learned was how to create an arc. I learned that, besides defining its position and size, I also need to specify its start and end angles to control the direction of the arc. I found this part quite interesting.

Reflection and ideas

Reflection

I enjoyed working on this project, but it also took me a lot of time. One part that took especially long was designing the hair. Originally, I wanted to make it look more like my actual hair, with bangs and a round shape on top. I tried to use curves to create this shape, but I realized that I did not fully understand how curves work. I did not want to use code that I did not understand, so I decided to use two quarter circles instead. However, this made the top of the head look more square, and I am not completely satisfied with the result. In the future, I would like to learn how to use curves better so that I can create more complex shapes.

Another thing I noticed was that I spent a lot of time adjusting the coordinates of different elements. I often had to move them little by little and guess where they should be. For example, if an element was slightly too high or too low, I would have to keep changing its coordinates until it was in the position I wanted. I would like to learn a more efficient way to locate and adjust positions in the future.

Overall, I think this project gave me a good starting point for learning programming, and I hope that I can use these skills to create more interesting and interactive projects in the future.