Monthly Archives: October 2023

Mini Project 6: Object Dancers – Candle Dancer

Project Title: Candle Dancer

link:https://editor.p5js.org/jl14064/sketches/nsa8tytad

Description:

The candle dances with flames.

The flames get stronger if the mouse is pressed.

Candle Dancer is inspired by Lumiere from Beauty and the Beast (1991)

Coding:

In this mini project, IMA Fellow Carrot helped me with the rotation by pointing out how to use map() in the update function. It is my first time using a map() in my project. The following code also includes sin() display(), which fulfills one of the challenging options.

update() {
// update properties here to achieve
// your dancer's desired moves and behaviour
this.angle = map(sin(frameCount * 0.03), -1, 1, -PI / 8, PI / 8);
}
.....
//candle
display() {
......
push();
translate(0, -15);
rotate(this.angle);
//tray
noStroke();
fill(251, 200, 135);
arc(0, 0, 30, 50, 0, PI);
//white candle
noStroke();
fill("white");
rect(-15, -50, 30, 50);
//melt
noStroke();
fill("black");
arc(0, -51, 30, 20, 0, PI);
//fire
fill(255, 141, 0);
noStroke();
arc(0, -51, 25, 20, 0, this.range);
triangle(-12.5, -50, 12.5, -50, 0, this.flame);
pop();
......
}

The randomness was included to create the flame effect. To make it interactive, I used the if condition to make the flames stronger by pressing the mouse.

this.flame = random(-60, -55);
this.flameside = random(-45, -35);
//make it stronger
if (mouseIsPressed) {
this.flame = random(-70, -60);
this.flameside = random(-55, -45);
}

Speaking of the arms, Professor Godoy suggested I should make the lines into “little circles” and utilize sin() to make the movement smooth. Later, I figured out that the “circles” are actually Points. 

 //arms
push();
translate(0, 15);
stroke(251, 200, 135);
strokeWeight(8);
//double
for (let i = 0; i < 2; i++) {
rotate(i * PI);
//rolling arms
for (let x = 10; x < 45; x += 0.1) {
this.arm = sin(x * 0.1 + frameCount * 0.1) * this.amp;
point(x, this.arm);
}
}
pop();

Reflections:

  • What is the benefit of your class not relying on any code outside of its own definition?
    • In my opinion, the benefit of my class not relying on any code outside of its own definition is the certainty of the module and the flexibility to be reused as a template. Since there is no code outside of its own definition, the variables change values without tedious manual adjustment. 
  • What makes it challenging to write code that has to harmonize with the code other people have written? 
    • To harmonize with the code other people have written, there are a lot of constraints such as the size and where to write the code. For this project particularly, I had to make my dancer smaller than 200×200 pixels and put all my code in the class. 
  • Describe the terms modularity and reusability using the example of your dancer class.
    • Modularity means it could be called as a whole to perform certain tasks. For instance, my dancer class could be called to display and update.
    • function setup() {
      // no adjustments in the setup function needed...
      createCanvas(windowWidth, windowHeight);
      // ...except to adjust the dancer's name on the next line:
      dancer = new Candle(width / 2, height / 2);
      }
      function draw() {
      // you don't need to make any adjustments inside the draw loop
      background(0);
      drawFloor(); // for reference only
      dancer.update();
      dancer.display();
      }

      Reusability means the convenience of being called and duplicated. In my dancer class Candle, this.x and this.y in the constructor could be changed by the parameters given to move the appearance of the candle.

    • function setup() {
      // no adjustments in the setup function needed...
      createCanvas(windowWidth, windowHeight);
      // ...except to adjust the dancer's name on the next line:
      dancer = new Candle(width / 2, height / 2);
      ......
      class Candle {
      constructor(startX, startY) {
      this.x = startX;
      this.y = startY;
      ......

Project A: Acid Leaves

Project A: Acid Leaves

https://jasonlee557.github.io/CCLab/my-first-project/

2023 

Creative Coding by Jiasheng Li (Jason)

The leaves migrate with the blowing wind to survive. The audience can press the mouse to blow a wind and release the mouse to stop the wind.

The Elevator Pitch

Not only do the animals migrate, but also the plants do! The project establishes an environment where the leaves falling are from a polluted area with acid rains and they will migrate to a sunny and safe environment with the wind blowing by the audience pressing the mouse.

Abstract

Acid Leaves is about leaves migrating from a toxic environment to a safe environment. The leaves are red by default due to the pollution from the acid rain while they will be green and healthy again after migrating to the safe zone. The project aims to create a creature and embed a narrative and interaction with the audience in it. The audience can interact with the project by pressing the mouse to blow the wind and releasing the mouse to stop the wind. It resembles the process of exhalation, pressing the mouse compared to blowing. 

Reflection

1) Process: Design and Composition

It costs you something to be here, that makes you some kind of immigrant.

– Past Lives (2023)

The concept is inspired by the line in my recent favorite movie Past Lives (2023) directed by Celine Song. Though I am not an immigrant, I thought about migration and this quotation. On the other hand, the project requires me to create a kind of creature. So, why not make plants migrate? 

In terms of visualization, I was so ambitious that I wanted to include elements from every week. I tried to create two environments, one toxic and one healthy, where the leaves falling change between polluted and healthy states due to being blown into different environments.

In my project, the core elements are trees, rain, leaves, and sun. For the trees, I drew inspiration from Nina Wang’s mini-project 1. I used her tree structure as a reference and made it iterate. During Interaction Day, I noticed Ada Chen made a meteor shower in her Space Duck draft, which influenced me to add the acid rain in the toxic environment to make the pollution explicit. 

The leave template

The interaction is mainly the wind blowing by the audience pressing the mouse. At first, the movement was too fast and not “natural”. In the later version, the movement is smoother and slower. I also cut out my plans of making syndromes such as measles, which is not practical. 

In conclusion, the overall process is a journey to make my articulation much more visualized and explicit to the audience. By establishing the background and making the effects smoother, the project became easier for the audience to understand. 

2) Process: Technical

Because this was a mid-term project, I wanted to deploy skills learned every week as much as possible. In the trees, I used function() to initialize the template and integrated the trees into the forest by constantly calling the function. The trees used the mini project1 knowledge of drawing with codes. The sun’s rays are made by angular movements, which contain a loop. For the leaves, I tried out arc.

The main problems that I encountered were the rain and the wind. 

 //toxic rain
push();
for (let i = 0; i < 500; i++) {
let rainX = random(width / 2);
let rainY = random(height);
stroke("red");
line(rainX, rainY, rainX, rainY + 20);
}
pop();

I tried out the rain in only one column with random. But later on, I turned to Ada Chen, my classmate, she told me to use a loop. Thanks for the help. 

As for the wind, Professor Godoy suggested I use Noise instead of simply changing the x. Thanks Teaching Assistant Cissy for her detailed explanation. She also pointed out the nuances between mouseIsPressed once and mouseIsPressed constantly, which impacted my project narrative. 

//falling leave
x = x + 5 * sin(ld) - 5 + noise(xoff) * 10; //noise
y = y + random(5);
ld = ld + 0.1;
arc(x, y, 100, 100, ld, ld + PI / 3);

//wind
if (mouseIsPressed) {
speedX = random(-15, 20);
x = x + speedX;
y = y + random(5);
}
3) Reflection and Future Development

In retrospect, I am really satisfied with the structure, the variety of coding and the narrative while I think certain effects after the interaction and variety of situations could be more developed. My presentation had a nice reaction from the audience which showed my narrative went well. 

During the feedback session, IMA fellows and my classmates suggested I improve the details and the interaction. Joey Yang was confused by the shape of the leaves as if they were pizza, which she recommended be changed by using curves. Professor Godoy advice me to think more about the time it took for the leaves to recover instead of making them cured instantly after crossing the border. Professor Eric Jiang commented that the wind was “not natural enough” for the reappearance of the leaves from the same position. He also suggested the background transition could be less apparent. Fatima Kazim proposed that the wind could impact the rain as well. 

I appreciate all these suggestions and I do think they are all valid. In the future, I think I should continue to draw inspiration from nature. As for the coding, the interaction and the effects after the interaction could be more complexed. I was only limited to the mindset that one interaction could only have one outcome. I should make the outcome more vibrant and colorful. 

Reading 2. Long Live The Web

In Long Live The Web, the author mentioned the beneficial and “ill effects”. From my own experience on the web, one of the beneficial effects is that a lot of data are shared so I can find the information that I need in most cases; the most reflected “ill effects” is that people would argue online fiercely online about some tricky social issues and it would eventually be taken over by trolls, which would make the divergence larger. 

Universality means that the web allows the users to have access to it no matter what kind of hardware, software, network connection, disability, or language they use. Isolation means that this kind of distribution is limited to certain hardware, software, network connection, ability or language. Universality is mostly related to the egalitarian ideal while isolation is about specific priorities and superiority. 

Open Standards refers to free, without certain restrictions and no need to pay, access for the experts to explore and design. Closed Worlds refers to a virtual community that is limited within that area with a certain entrance cost. Open Standards empower various experts to get into the construction of the web while Closed Worlds prevent the constructions from being altered by any John Doe. 

The Web is an application that runs on the Internet. The Internet is an electronic network that links a lot of information and distributes them into diverse media. The Web is a layer of the Internet. In other words, the Web is just a small combination of certain information while the Internet is a vast field of connections. From my experience, I use the webs individually when necessary while I also use them interactively with the Internet.

The author envisions the future of the web with four trends: open data, social machines, web science and free bandwidth. A decade after the article was published, we can witness a lot of realizations. Open data is widely used as getting information is much easier, especially with ChatGPT. In addition, it is also becoming a social machine for people to connect with each other and promote social justice with social media, ranking apps, and hashtags such as #metoo. Furthermore, Web science is around the corner when people start to realize the web can do more than just mimic the real world, especially during the hype of the metaverse. 

Unfortunately, the free bandwidth is more difficult than before. As artificial intelligence costs more resources and finance, the divergence between developed and developing countries is becoming wider. Other problems such as violation of privacy also arose during the COVID era when people moved a lot of life online. They are mentioned in the author’s articulation as side effects that should be taken into account.