Assignment 2: Faux Sound Wave

Concept:

  • The idea for this assignment is to replicate the look of sound waves as they would appear in computer applications: comprised of multiple parallel vertical lines that fluctuate in length to reflect changes in volume. While it is currently beyond the scope of my coding capabilities to create something that actually responds to external sound input, it would nonetheless be a good opportunity for me to practice using for() loops to generate repetition as well as randomized elements.

Highlight:

  • I am proud of having utilized the random() function within the for() loop in order to generate rectangles that are in fixed positions but have randomized lengths that change every time the frame refreshes, replicating the look and movement of a sound wave.
for(let x=0;x <= width; x +=15){
  noStroke();
  fill(random(0,50),random(150,200),random(30,255));
  rectMode(CENTER);
  rect(x,200,10,random(20,200));
}

Sketch:

Future improvements:

  • The point of sound waves being depicted as such in computer programs is to reflect the volume of the sounds being recorded. In the future, it would be interesting to have the lines respond to various inputs such as clicking, cursor hovering, and sound.

Reading Reflection – Week 2

I found Casey Reas’ Eyeo talk to be really interesting because it gave me a new perspective on how technology can create art. Although I would consider myself a fairly creative person, recently I’ve felt surprisingly restricted by how I can use code to make art. Reas’ work, in particular the one that represented the movement of cancer cells inspired me because it showed how interpretive art can be and also the unique ways in which we can reference aspects about life to influence what we create.

I also found it interesting how Reas distinguished between pieces he deemed complete and others he did not. He labeled a few of them as rather simple or mundane but as a viewer they seemed complete to me. Although this seems rather insignificant I believe it highlights how personal the artistic experience is to an artist. This acted as a reminder for me to work with intention because once I have a goal in mind, like Reas, I believe it will be easier for me to deliberately work on my projects with creative freedom while still having goals in mind.

All in all, I enjoyed the refreshing prospective Reas provided through displaying his own work and hope to apply it to my own methods. Seeing the wide array of examples and applications has not only given me ideas for how I might approach this week’s project but also gives me more confidence to freely explore future developments.

Week 2: Loop Flowers

For inspiration, I found some online references with patterns created by combining similar shapes. Most of these combinations resulted in forms that resembled flowers.

Flower Pattern

I drew a connection between using a shape multiple times to draw a pattern and using loop in p5js. My idea is using the same shape, with elements of randomness to create a different flower every time the user interacts with the canvas.

Challenge

When creating this piece, what I found particularly challenging was using the rotate() function to position the petals around the center (the mouse cursor). However, the rotate() function in p5.js only allows rotation around the origin (0,0), so I had to use translate() to change the origin to the mouse cursor’s position. This quick fix created a problem later when I wanted the flowers to remain permanently on the canvas instead of disappearing every time the mouse was released.

For drawing the flowers, I created two functions: one to draw flowers with squares and one with ellipses. They are similar in essence except for the change in shapes used to draw.

function squareFlower(x,y,size,fcolor){
  //repeat drawing the square with the rotation of angle until the 360 degree is full
  for(let i =0; i<(360/angle); i++){
    rotate(angle);
    stroke(fcolor[0], fcolor[1],fcolor[2]);
    fill(fcolor[0], fcolor[1],fcolor[2],fcolor[3]);
    rect(x,y,size);
  }
}

Finally, I included random attributes like shape, petal size, and angle of rotation to create different flowers. I also adjusted the opacity of the shapes to create a more interesting composition. To make it look more like flowers, I implemented an increase in shape size over time when the mouse is pressed, creating a blooming effect.

Final Sketch

Reflection

After finishing the sketch, I tried to make the flower appear permanently on the screen instead of disappearing, but I couldn’t because the flowers are drawn based on their rotation around the origin (which changes for each flower). When I revisit this in the future, I want to change the drawing of the flowers from using the built-in rotate() function to using math to calculate the new coordinates. This will allow the flowers to be drawn independently of the origin’s location. Another issue is that some shapes in the flowers are overlapping, which I think stems from the calculation of the rotation angle. I will also try to improve this calculation in future sketches.

Assignment 1 Self Portrait

Concept: 

For my self portrait I wanted to do something slightly unconventional. Joan Miro is an artist that I really like and I thus decided to do my self portrait in his unorthodox surrealist style. I wanted to have fun background elements commonly seen in his artwork such as the crescent moon and a star.

Something I’m proud of:

Something I’m proud of for this assignment are the random curves across the whole portrait, and especially drawing the crescent moon. These aspects took me the longest time to figure out and are thus the ones I am most proud of.

function details() {
  
  fill(255,255,0);//drawing a crescent moon shape by drawing two intersecting circles and having one of them be the color of the background
  //this effect makes it so that the second circle cuts the first one to make the moon shape
  noStroke();
  ellipse(150,630,100,100);
  fill(240, 248, 255);
  ellipse(170,630,100,100);

  //drawing the diagonal lines for the eyebrows
  stroke(0);
  strokeWeight(4);
  line(300, 300, 450, 400);
  line(500, 400, 650, 300);

  //drawing the yellow curve around the mouth
  noFill();
  stroke(255, 215, 0);
  strokeWeight(8);
  beginShape();
  vertex(250, 550);
  bezierVertex(350, 500, 450, 700, 550, 550);
  endShape();
}

Final Product:

Reflections:

I enjoyed working on this assignment quite a lot, it was a fun experience juggling between taking inspiration from Miro and then also trying to add my own personality into the portrait so I could make something I could be truly proud of. An aspect that I would like to work on in the future is adding some sort of interactivity maybe with eye movement or some background features morphing into others to further portray the dreamlike essence of Joan Miro.

Assignment 1: Self-portrait – CATWOMAN

My concept 

  • There were two main components that I wanted to explore with this project: creating a background and creating the figure. I drew a rough sketch of what I wanted to do. I wanted to create a background of the night sky, and in the foreground I wanted the figure of a cat/woman. My end product became very different from this preliminary sketch, but I had a rough idea of what I wanted to do. But I knew I wanted to create myself as my spirit animal, by blending my physical features with that of a cat. The choice of placing myself in space is because I simply love the idea of staring into the night sky and seeing the moon and stars, and to surround myself with these objects would be symbolic of the way I enjoy wondering, imagining, and dreaming. 

Reflection 

  • I began with the background, the sky’s color, and the moon and stars. Then, I changed my mind and wanted my catwoman to be in space, so I created her planet and other planets around her. This was more time consuming than I originally thought it would be. I had to place the stars, I had to choose where to position the other planets, and I had to create the details of the main planet (the holes), which I later had to adjust because I put the catwoman on top and wanted the placement of these objects around her to look ideal. 
  • After finishing the background, I jumped into creating my catwoman. I started with her head, neck, and body. I started becoming worried, because I wasn’t sure about their orientation. But then, I started adding the details: eyes, mouth, nose, hair. This proved particularly difficult, with each component taking longer than the last. I didn’t like how my piece looked, but continued adding details: the cat ears, whiskers, eyebrows, shirt, blush, necklace, astronaut helmet. In the end, I came up with my finished product that I have grown to like. I realized that the more time and more details to put into it, the more it begins looking like something worthwhile, and I realized that slowly the piece will start to come together. It won’t be as I imagined, but will be what I was able to make given what I have learned as well as what I had researched. 

Sketch 

Code I’m proud of 

Creating the hair for my portrait took me a while. I had to layer it and I had to think about where I was able to write the code for the different layers, I had to copy-paste it into later sections so the stars/ears did not overlap. I used a circle to create the first layer of the hair. I then wanted the hair to look like a bob-cut, so I created a rectangular cut-off with the color of the planet behind the figure so that it would blend. I then added the bangs. In a later line of code, I framed the face of the figure, by creating two rectangles and placing it on the sides of the face to look as if the hair is over her face.

//hair
fill('#471706');
noStroke();
ellipse(145,277,150,150);
fill('#A3A3A3');
rect(90,330,110,30);
//head
noStroke();
fill('rgb(201,139,76)');
circle(145,270,98);
//hair bangs
fill('#471706');
noStroke();
ellipse(125,230,50,40);
ellipse(167,230,50,40);
//hair to frame face
fill('#471706');
noStroke();
rect(94.25,242,10,70)
rect(186,240,10,70)

Ideas for future work/Improvements 

  • I would really love to add animation to this work. I wasn’t sure how to do it so I looked at videos and articles online, but I did not completely understand the code for it, so I decided to leave it out for this assignment, but I look forward to implementing it in future projects. I wanted the background to not be so static, possibly with the moon phases and shooting stars, and possibly the rotation of the planets in the background. Regarding the catwoman, I’d want her to possibly wiggle her tail and move her ears. I feel like those animations would add to the portrait, by enhancing the background of outer space and the choice of a cat as my spirit animal. 

Assignment 1: Liz’s Self-Portrait

Concept:

As someone who is terrible at art and with zero experience with coding, this assignment scared me quite a lot. I wanted to keep it plain and simple while trying to keep it relatively accurate to what I look like. By using basic lines and shapes, I managed to unintentionally make a version of me that seems to have come straight out from Bob’s Burgers, which I found really funny. I’m not quite sure if I succeeded in the accuracy department, but I think it is good enough for my first time!

The Self-Portrait:

 

Highlight:

It took me a while to get used to the trial and error to create a self-portrait from basic 2D shapes, but it got better the more I practiced. However, creating the hair was an absolute nightmare with trying to rotate the arcs. The biggest highlight would have to be when I finally managed to get the hair looking somewhat decent, especially after adding some side bangs

//hair
fill(0)
arc(200,390,300,700,PI,0)
  //hair 2
fill(0)
arc(160,120,150,170)
arc(100,105,180,132,(11/6)*PI,PI/2,OPEN)

Otherwise, it would’ve looked like this egg…

Reflection:

Overall, I’m quite proud of myself for facing my coding fears and being able to create something like this in a short period of time. My brain refused to take in the information at first, but it got used to it eventually. I stuck with the simple plan I had due to time, but I would’ve loved to have been able to add my own personal touch to it and make it interactive. I was thinking of a little flashing camera or a phone on a gimbal. It would also have been cool to make the pupils both follow the cursor so that the eyeballs can move around while never looking at the same direction. Regardless, I’m still satisfied with how it turned out and I think it’s a cute first memory of my coding experience and result! It definitely wasn’t as bad as I thought it would be

Assignment 1 – Self Portrait

Concepts: 

For this assignment, my concept was a self portrait of me, wearing a NYU shirt, and a sunny and sandy background. I utilized basic shapes to construct the portrait, with the concept being me in NYUAD right now. I aimed to recreate my hairstyle as much as I could on a 2D space. Apart from the portrait of myself, I also drew the sun in the background, which I believe is an important feature of Abu Dhabi.

Portrait

Highlight

I implemented a feature where the nightsky, moon, and stars would show when you click down on the canvas. I used an if statement to detect whether a mouse button was being held down, which is detected with the function ‘mouseIsPressed’.

if (mouseIsPressed){
//nightsky
fill(40)
rect(0,0,400,250)
fill(190)
//moon
circle(0,0,250)
fill(240)
circle(30,24,30)
fill(230)
circle(16,81,15)
fill(215)
circle(48,83,20)
fill(242)
circle(87,19,15)
fill(250)
circle(70,50,30)
//stars
fill(255)
circle(294,25,2)
circle(187,42,2)
circle(361,52,2)
circle(218,9,2)
circle(276,115,2)
circle(279,70,2)
circle(355,85,2)
circle(133,91,2)
circle(215,85,2)

} 

Improvements 

For the drawing of the rays of the sun, I tediously drew the triangles one by one to achieve the way I wanted it to look. This was quite time consuming and wasn’t very efficient. In the future, I could utilize a loop to speed up this process.

Assignment 1 – Self-Portrait

I saw this assignment as an opportunity to get creative with p5.js and make something visually appealing using basic shapes, while also adding some elements of interactivity. I have had some experience with coding and I’m also really passionate about design, so overall, I really loved how this project made me think of new ideas and navigate the challenges that came up.

Main Idea

For this portrait, I wanted to create something that truly represents a part of me. As someone who absolutely loves books, I decided that a simple library setting (with a bookshelf) would perfectly capture this passion. Instead of going for a generic self-portrait, I focused on the details that define my personality, aiming to reflect my love for reading in both the visuals and interactivity of the piece.

Implementation

Creating the library scene involved several key steps, from drawing the bookshelves to the self-portrait itself. The books in the library are not just static; they come alive through interactivity, making the scene more engaging and fun. Every time you hover your mouse over a book, it bounces up and down, creating a playful effect. I’m particularly proud of the way the books bounce—implementing this took some effort, as it involved calculating the physics for a smooth jumping motion and resetting them back to their original positions. A fun surprise was discovering how, when you swipe the mouse across a row of books, it creates a wave effect, adding another layer of interaction.

Here’s a snippet of code that controls the bouncing of the books :))

// Drawing books with jumping effect
  for (let i = 0; i < books.length; i++) {
    let book = books[i];

    // Checking if the mouse is hovering over book
    if (
      mouseX > book.x &&
      mouseX < book.x + book.width &&
      mouseY > book.y &&
      mouseY < book.y + book.height &&
      !book.isJumping
    ) {
      book.isJumping = true; // book starts jumping when hovered
      book.velocity = -5; // initial jump velocity
    }

    // Handling jumping animation
    if (book.isJumping) {
      book.y += book.velocity; // updating y position based on velocity
      book.velocity += 0.4; // applying gravity effect

      // checking if the book has fallen back to its original position on the shelf
      if (book.y >= book.originalY) {
        book.y = book.originalY; // resetting position to the shelf
        book.isJumping = false; // stop jumping
        book.velocity = 0; // resetting velocity
      }
    }

 

Another feature I implemented is the colour change of the book held by the girl in the portrait. When you click on any book in the library, the book’s colour changes to match the one clicked, and I think this really adds to the interactivity of the scene and somehow just makes it seem more of a representation of my personality.

This is the code that controls the book changing colour:

function mousePressed() {
  // Checking if a book is clicked
  for (let i = 0; i < books.length; i++) {
    let book = books[i];
    if (
      mouseX > book.x &&
      mouseX < book.x + book.width &&
      mouseY > book.y &&
      mouseY < book.y + book.height
    ) {
      // Changing the girl's book color to the clicked book's color
      girlBookColor = book.color;
    }
  }
}

 

One of the most challenging parts of the drawing was the hair, which required understanding how the bezierVertex() function works. I spent time experimenting with the curves to get the right look, and I’m happy with how the hair flows in the final version. I also focused on the randomization of book sizes, spacing and colours to create a more realistic and dynamic library scene. The varied spacing between the books was particularly important because it prevented the scene from looking too uniform and added to the realistic clutter you’d expect in a real library.

Reflections and Possible Improvements

I’m proud of how the self-portrait captures a unique part of me through both the visuals and interactions. The bouncing books, the randomization of elements and the changing book colours all work together to create a portrait that isn’t just about how I look, but about what I love. The process was a great learning experience, especially in terms of coding the animations and achieving a realistic look using basic p5.js knowledge.

Possible improvements include adding more interactive features, such as having the girl’s expression change when clicking on different books or adding a subtle glow effect around the hovered book to enhance the visual feedback. Also, optimizing the code for smoother animations, especially when multiple books are interacting simultaneously, would enhance user-experience. Overall, I really enjoyed this project and look forward to exploring more of my creative potential throughout the course.

Assignment 1 | Self-Portrait (Lavish Lady)

My passion towards the art was born a long time ago and I couldn’t truly believe that I would be able to find an area, which would challenge my art skills as much as an art production using p5js. It allowed me to combine my artistic expertise and expand my knowledge of Javascript. This work was inspired by the contemporary art that I experimented a lot lately. I decided to bring in my artwork a wide pallette of colors symbolizing the diversity of human beings in terms of their character development. Combining it with nature that could be observed in the front, I wanted to depict the idea of close relationship between human and nature. Undoubtedly, we are a part of nature and it has a profound effect on our development and nurturing of essential.

I’m particularly proud of the code I wrote for the interactive eyes that follow the mouse movement and the effect of color changing lips. This adds an element of interactivity and brings the portrait to life. Here’s a snippet of the codes:

// Eye movement based on mouse position
  fill(mouseX % 255, mouseY % 255, 100, mouseY % 255); // Color changes based on mouse position
  let pupilOffsetX = constrain(map(mouseX, 0, width, -20, 10), -10, 10);
  let pupilOffsetY = constrain(map(mouseY, 0, height, -5, 5), -5, 8);
  ellipse(160 + pupilOffsetX, 280 + pupilOffsetY, 15, 15); // left pupil
  ellipse(230 + pupilOffsetX, 280 + pupilOffsetY, 15, 15); // right pupil
}
lipcol.r = random(111, 218);
  lipcol.g = random(72, 47);
  lipcol.b = random(209, 67);
  fill(lipcol.r, lipcol.g, lipcol.b);
  strokeWeight(1);
  stroke(lipcol.r, lipcol.g, lipcol.b);
  beginShape();

 

For future improvements, I’d like to:

-Enhance the interactivity by adding more elements that respond to mouse clicks or movements.

-Improve the smoothness of the animated features to make them more natural.

– Explore using different algorithms for more complex shapes and patterns, such as fractals or noise functions, to add more depth and texture to the portrait.

Working on this self-portrait allowed me to explore various aspects of my creativity through code. I learned a lot about using shapes, colors, and transformations to create a digital representation of myself. In the future, I would like to add more interactive elements, like changing colors or shapes based on user input, to make the sketch more dynamic. Additionally, I’d explore adding animations to give the portrait a lively, animated feel that captures my personality even more.

 

Reference to this genius guy from “The Coding Train”

Assignment 1- Self portrait.

Concept
A portrait of myself. I was inspired to create the portrait by the assignment and also to play around and learn how to use p5.js
Code
Coming up with the sketch was really fun and helpful in implementing what I learnt in class. It was a great way to interact with p5.js and know what I can do with it. I am proud of how I managed to incorporate what was taught in class particularly using the arc function to come up with the sketch.

Reflection
I believe that I still have room to improve the portrait. I had challenges making the hair and ears so learning how to make it more realistic would be really great. I would also like to make the portrait more lively by adding more things in the background and having more movements.