Week 2: Random Faces

For this project, I got inspired by an animation of random skulls and so I decided to create random smiling faces since I find that using the arc function is somewhat of a challenge and I wanted to practice.The design is generated dynamically with each frame using random values for color and size to create a unique variation every time. The face is composed of basic shapes, including an ellipse for the head, a rectangle for the neck, and circles for the eyes.

My favorite part of this project was using variables to link the eyes and neck to the face so that they automatically adjust to the face’s size and position.

ellipse(skullX, skullY, skullW, skullH)
let neckX = skullX - skullW/4
let neckY = skullY + skullH/4
let neckW = skullW/2
let neckH = skullH/2
rect(neckX, neckY, neckW, neckH)
let eye1X= neckX
let eye2X = neckX +neckW
let eyeY = skullY - skullH/4

One challenge I faced was making the smile look natural. While the arc function works, I’d like to experiment with other approaches to create a more natural expression.

Things I’d like to improve is  adjusting the background colour. Since, it is  randomized, it sometimes blends too much with the skull, making it less visible. So refining how colors are assigned could enhance the contrast and visibility of the design. Also, I’d like to create random facial expressions instead of just a smile.

Week 2: Reading Response

Casey Reas’ talk about randomness, the intersection between chaos and order, and how art is a form of manifest result made me rethink my definition of what I consider art. I used to see art as paintings where an artist would express his thoughts using shapes or colours, or music where the musician expresses his feelings through notes. To me, art had to be a byproduct of human expression, random and never perfect. As a result I never thought of anything digital as art simply because there is no human aspect to it. However, Casey Reas’ talk about making something artificial have an organic quality made me reconsider. If we just apply natural randomness or disorder, we can make digital creations count as art. The way I plan to do that is by using human expression as inspiration for randomness, the same way buildings and body tissues were used in Reas’ talk. For example, I’d love to maybe use voice frequencies, heart rhythms or random patterns of brain activity to experiment and incorporate randomness into my work to create expressive digital paintings. 

I feel like the optimum balance between total randomness and complete control is somewhere in between. While randomness introduces unpredictability, making a piece feel organic and alive, control ensures coherence and intentionality. By setting parameters, we can guide the chaos in a way that still reflects human intent. As Casey Reas mentions we are the creators of the code and we can implement constraints even with randomness. 

Week 2 – Reading

How are you planning to incorporate random elements into your work?

One way is to think about making it human. Because of the elements of human error especially compared to something like a computer, I feel like  using more of what the human user gives you is a good way to incorporate randomness. Another way is chance. For example, the current games that I play still rely on simulated coin flips that give 50-50 odds. Imprecision is also a great way. It still allows the work to retain its qualities and recognizability, but at the same time, it allows the work to take on a new character and uniqueness.

Where do you feel is the optimum balance between total randomness and complete control?

It is definitely somewhere in the middle; but too little is preferable to too much. Introducing too much chaos and randomness removes from what the work actually is and as the world tends towards chaos, removes the work from being art. However, too much perfection and too much control runs the risk of the same occuring. Things that are too perfect seem to remove themselves from the world of humanity, and in an AI-generated type of way, is very easy for us to spot that it is not real.

Week 3 – Reading

What do you consider to be the characteristics of a strongly interactive system?

I think it is the ability to render meaningful change as a result of the conveyance of meaning coming from the user. If we were to conceptualize a very weak interactive system, it would not change at all as a result of user input. This would be like conversing with someone who did not listen to what you had to say and as soon as you were done speaking, reply with “Yes, anyways…” and just continue speaking on whatever they had to say, not making meaning of your input. If we take that the reversal of this would be a strong interactive system, we can consider that a strong system would make meaningful change as a result of user input. Like a conversationalist that actively listens and asks questions pertaining to the content of your input, a good system would have the ability to register meaning in the user’s input effectively, then use the input to meaningfully “reply.”

What ideas do you have for improving the degree of user interaction in your p5 sketches?

Because we are limited, generally, to the hardware of a laptop running the p5 website, the keyboard and mouse are going to be the primary, most accessible methods of input which the basis of user interaction will be built upon. Because of this, trying to at least make the user interact by moving and clicking the mouse is a good idea. Because of how we are trying to increase user interaction, using the keyboard, which is much easier for users to assign meaning to inputs to is also a great idea. Chatbots are the pinnacle of this, where they can assign meaning to the user’s textual inputs and generate a response after “reading” what you wrote.

Object-oriented programming – Week 3

Reflection: Floating Bubbles

This artwork is inspired by the simple joy of blowing soap bubbles we used to do as kids. Just like real bubbles, the circles appear wherever you click, float around randomly, and slowly fade away or pop. I wanted each click to feel like blowing a new batch of bubbles, watching them drift and disappear. The way they change color and move in different directions makes them feel alive, conveying the playful nature of real soap bubbles.

Structure

The Circle class manages each individual bubble’s movement, opacity, and lifespan, ensuring that they appear and disappear naturally over time. Functions like setup(), draw(), and mousePressed() organize different parts of the code, keeping it easy to understand and modify.

Challenges

One issue was finding the right balance between movement and fading, so that that bubbles did not disappear too quickly while still feeling transient. Another challenge was making the interaction feel engaging, which I solved by adjusting the number of bubbles created per click and giving them different speeds and directions. Additionally, I had to optimize performance to prevent the sketch from slowing down over time, so circles are now removed once their lifespan ends.

Overall, I appreciate how this piece captures the lighthearted  beauty of soap bubbles in a digital form. To make it more realistic, I’d try to make the direction that bubbles take more random and add the effect of abrupt popping.

// Array to store circles
let circles = [];
let circleSize = 50;
let numCirclesPerClick = 5; // Number of circles generated per mouse click

function setup() {
  createCanvas(windowWidth, windowHeight);
  noFill(); // No fill for circles, only stroke
}

function draw() {
  background(20, 20, 30, 50); 
  
  // Loop through circles in reverse order 
  for (let i = circles.length - 1; i >= 0; i--) {
    circles[i].update(); 
    circles[i].display(); 
    
    // Remove circle when its lifespan reaches zero
    if (circles[i].lifespan <= 0) {
      circles.splice(i, 1);
    }
  }
}

// Circle class (individual moving and fading circles)
class Circle {
  constructor(x, y, size) {
    this.x = x;
    this.y = y;
    this.vx = random(-2, 2); // Assign random speed in x direction
    this.vy = random(-2, 2); // Assign random speed in y direction
    this.baseSize = size;
    this.size = size;
    this.opacity = random(100, 200); 
    this.growthSpeed = random(0.5, 2); 
    this.color = color(random(255), random(255), random(255)); 
    this.lifespan = 200; // Circle disappears after a set time
  }

  // Update circle properties (position, size, opacity, lifespan)
  update() {
    this.x += this.vx; 
    this.y += this.vy; 
    this.size = this.baseSize + sin(frameCount * 0.05) * 10; // Oscillating size effect
    this.opacity -= 2; 
    this.lifespan -= 2; 
  }

  // Display the objects
  display() {
    stroke(this.color);
    strokeWeight(2);
    fill(this.color.levels[0], this.color.levels[1], this.color.levels[2], this.opacity); // fading effect
    ellipse(this.x, this.y, this.size, this.size);
  }
}

// generates multiple circles at the mouse click location
function mousePressed() {
  for (let i = 0; i < numCirclesPerClick; i++) {
    circles.push(new Circle(mouseX, mouseY, circleSize));
  }
}

 

Week 3 – Reading Response

When Crawford mentions at the beginning of the chapter, “The term interactivity is overused and underunderstood” (3), it surprised me as I always believed interactivity involves physically engaging with technology and allowing them to respond to input. However, Crawford makes it clear with his definition being a “conversation,” since to him, a system isn’t truly interactive if it only delivers what it is supposed to respond; it has to listen, think and speak in a way that adapts over time. Additionally, as he asks questions, and even asked one, “Is interactivity utterly subjective?” It really made opened my perspective on what is interactivity, it suggests to me what feels interactive to one person might not feel that way to another, since it depends on their expectations and prior experiences. As a result, it made me realize that with some of my p5.js sketches and exercises, while technically reactive, it isn’t truly interactive.

With my sketches, they don’t have any aspect of interactivity, but they’re rather responsive, especially my previous assignment (for week 2 on loops), since within the sketch, hitting “Enter” would cause my sketch to go from a monochrome grayscale to random, simultaneous pops of color. With that, I aim for future projects to apply similar aspects of interactivity, rather than having them being responsive to user input.

Reading Response – Week 3

I believe that interactivity is like a conversation. It’s alive, reciprocal, and unpredictable. It thrives on an ongoing exchange where both parties listen, process, exchange ideas. Yet sometimes, we tend to mistake reaction for interaction. Imagine a fridge light turning on when you open the door – that’s a reaction. In this context, a true interaction requires intention, curiosity, and a sense of the unexpected.

When designing for interactivity, I want to create projects that thrive on engagement, not just response. In my p5.js sketches, I want to move beyond the input-output relationships and create something that listens and adapts to what the audience feeds to the “artwork”. This may mean making the visuals morph in response to prolonged interaction or rewarding users for exploration rather than just reacting to a single click. In any case, I want each person who interacts with my projects to have a unique experience.

To sum up, I think that a truly interactive system should feel like a dynamic exchange, where the user isn’t just playing with the system but within it. That’s the kind of interactivity I want to create—something more like a meaningful conversation and less like a fridge light turning on and off.

Week 3 : Generative Art

Concept and Inspiration

For this week’s assignment, I drew inspiration from spirals and circles, as symmetry has always intrigued me. The goal was to create a generative artwork, and after reading about interaction in this week’s reading, I wanted to give the viewer creative freedom over the composition. To achieve this, I incorporated keyboard controls for selecting different color gradients and allowed users to click anywhere on the canvas to generate a spiral at that point. Additionally, the canvas can be cleared to provide users with a blank canvas.


IMP : Read before creating ART
Color Scheme (click to choose) –

  • Rainbow: ‘R’ or ‘r’
  • Blues: ‘B’ or ‘b’
  • Blue-Green: ‘G’ or ‘g’
  • Pink-Purple: ‘P’ or ‘p’
  • Yellow-Orange-Red: ‘O’ or ‘o’
  • Purple-Red: ‘S’ or ‘s’
  • Clear Canvas: C or ‘c’

The biggest challenge I faced during this project was related to the creation and positioning of the spiral. I had to make sure that the circles followed the spiral’s curve closely, without leaving gaps between them. Initially, the gaps were too large, and the spiral looked disjointed. I spent a lot of time figuring out how to make the circles remain close together as they moved outward  and to ensure they were placed one after another in a way that created a continuous, tightly packed spiral.

The part I’m most proud of is the creating the spirals. Initially, my spirals weren’t very pretty, as the circles grew apart too much and it didn’t even look like a spiral. It took some time to figure out how to position the circles in a way that made the spiral look smooth and cohesive. After lots of tweaking, I managed to figure out the conditions where the circles would be placed in a way that created an organized spiral.

// Creates Spiral class, which acts as a template to print all spirals
class Spiral {
  constructor(x, y, max_radius, num_circles, color_palette) {
    this.x = x;
    this.y = y;
    this.max_radius = max_radius;
    this.num_circles = num_circles;
    this.current_circle = 0;
    this.angle_increment = 10;  // Places individual circles closer depending on value
    this.radius_increment = 0.3;  // Reduces outward distance between concentric circles of spiral depending on value
    this.color_palette = color_palette;
  }

  // creates new mini circle each time function is called in draw function
  update() {
    if (this.current_circle < this.num_circles) {
      this.current_circle += 1;
    }
  }

  // prints spiral on canvas 
  display() {
    push();
    translate(this.x, this.y);

    for (let i = 0; i < this.current_circle; i++) {
      let angle = i * this.angle_increment;
      let radius = i * this.radius_increment;
      // to control transition of colors for diff color palettes
      let gradient_factor = map(i, 0, this.num_circles, 0, 1);
      
      // defining color gradient for each transition
      let col;
      if (this.color_palette === "rainbow") {
        // Full rainbow transition
        if (gradient_factor < 0.25) {
          col = lerpColor(color(255, 0, 0), color(255, 255, 0), map(gradient_factor, 0, 0.25, 0, 1)); // Red → Yellow
        } else if (gradient_factor < 0.5) {
          col = lerpColor(color(255, 255, 0), color(0, 255, 0), map(gradient_factor, 0.25, 0.5, 0, 1)); // Yellow → Green
        } else if (gradient_factor < 0.75) {
          col = lerpColor(color(0, 255, 0), color(0, 0, 255), map(gradient_factor, 0.5, 0.75, 0, 1)); // Green → Blue
        } else {
          col = lerpColor(color(0, 0, 255), color(255, 0, 255), map(gradient_factor, 0.75, 1, 0, 1)); // Blue → Purple
        }
      } else if (this.color_palette === "blueGreen") {
        col = lerpColor(color(0, 0, 255), color(0, 255, 0), gradient_factor); // Blue → Green
      } else if (this.color_palette === "orangeRedYellow") {
        col = lerpColor(color(255, 255, 0), color(255, 0, 0), gradient_factor); // Orange → Red
      } else if (this.color_palette === "pinkPurple") {
        col = lerpColor(color(255, 105, 180), color(96, 15, 156), gradient_factor); // Pink → Purple
      } else if (this.color_palette === "purpleRed") {
        col = lerpColor(color(128, 0, 128), color(255, 69, 0), gradient_factor); // Purple → Orange → Red
      } else if (this.color_palette === "Blues") {
        col = lerpColor(color(0, 0, 139), color(0, 255, 255), gradient_factor); // Deep Blue → Cyan
      }
      
      // prints each circle with chosen color after calculating positions
      fill(col);
      noStroke();
      let x = cos(angle) * radius;
      let y = sin(angle) * radius;
      ellipse(x, y, 8);
    }

    pop();
  }
}

 

Reflections and Future Improvements
Looking back, I’m happy with how everything turned out, and I especially like that so many different variations can be generated based on user interactions from such simplicity. However, I feel there’s still room to improve the spiral’s look. I want to learn how to adjust the spacing between circles so that they grow proportionally as they move outward, filling the space more evenly. Additionally, I would love to experiment with making the spiral tighter and more closely packed. Also I want to figure out a different ending for the spiral, maybe something like it keeps growing and takes over the whole screen, since right now it just stops adding circles to the spiral.

One thing I loved was how much easier my life became using OOP. Using a class to create a template for the spirals allowed me to generate as many spirals as I wanted without much effort. It’s fascinating to see how simple code structures can support more dynamic and complex artistic ideas, and I’m excited to keep refining my approach to generative art.

Week 3- reading

A strongly interactive system is one that supports an ongoing exchange between the user and the system, rather than a simple cause-and-effect response. , Crawford emphasizes that true interactivity requires a two-way conversation where the system not only responds to user input but does so in a way that is meaningful, engaging, and adaptable. It should be responsive, intuitive, and immersive; the users should have a good feeling about their actions being effective and that the system responds organically. One of the most critical aspects of interactivity is real-time feedback. When users interact with a system, they should immediately see or feel the consequences of their actions. This could be through visual changes, such as color shifts, animations, or movement, or through sensory feedback like sound effects and vibrations. The more immediate and natural the response, the more engaging the experience becomes.

To enhance the degree of user interaction in my p5.js sketches, I’d like to further develop more dynamic and reactive elements. For example, objects could be made to react to cursor movement through changes in shape, speed, or transparency, making it more alive. Another idea could be to utilize randomness to provide variety, where each interaction results in slightly different outcomes, allowing the artwork to feel organic instead of predictable.

I am interested in the use of multi-layered interactions where, with one input from a user, a chain reaction occurs rather than a single event. For instance, the click of one element may cause another object to move, change color, or fire off another animation sequence. Incorporating this will allow for a richer experience where users can be drawn into the artwork and experiment with how they interact with it.

My long-term aim is to create interactive sketches that are alive and responsive, creating an encouragement to experiment and discover unexpected outcomes. This refinement of how the system responds to the input provided smoothes out the interaction, thus making it much more immersive and engaging rather than just a number of responses with my generative artwork.

 

Week 3- car

Concept
This will be a generative artwork of a dynamic cityscape in which cars move along a busy street; the colors of buildings will change over time. The rhythmic movement within an urban setting will be simulated using programmed randomness and structured object-oriented programming. It also lets users interact with the scene-for instance, causing the cars to crash by clicking on them. A bright yellow flash to mark the moment of collision adds engagement and surprise.

Development Process.

This project deals with the work of OOP principles on such elements as cars, buildings, and road features.Arrays are used to hold these objects and then manipulated for flexibility in animation. The cars move continuously across the screen, resetting at their edges, and the buildings keep slight variations in height and color to give it a more organic feel as if from a real city. Introduction of clickability on the cars introduces user interaction, an important aspect of making the artwork from a simple, passive, visual display into an active system. Challenges and Refinements Among these, one major problem was getting the cars to glide smoothly across the road, which kept floating above it, out of alignment with the street. Changing some positions and managing more realistic layering helped improve that aspect. The second aspect was embedding the collision effect impressively while managing the aesthetics of the overall scene. The crash effect turned out much better with just fine-tuned timing and changes in opacity of the yellow flash, not to overwhelm it.

Future Improvements
There are several possible ways to take this project even further. One could add in environmental elements such as weather effects, changing times of day, or a richer soundscape for added realism and interaction. Implementing more complex behaviors for the cars, like random stops or variable speeds, would also increase the depth of the simulation. Finally, making the user be able to reset or change the scene dynamically within the artwork will make it far more engaging and replayable.

Code im am proud of is this specially

 }

  crash() {
    this.isCrashed = true; // Car stops moving
    this.speed = 0; // Set speed to 0 for a realistic stop
  }
}

where I figured out how to make the car stop to seem like it crashed