Assignment 4: Clock

For this assignment I decided to make a clock. I was inspired by my wallpaper which has a pretty cool moving clock.

Then I looked for a cool font online and found one called Roboto on Font Squirrel. I then added the .ttf file to my sketch and loaded the font using loadFont.

I used the hour(), minute() and second() functions inside the text() function with textAlign(CENTER) to print out the time on the screen. I also messed around with if statements to gradually change the color of the time and give it a breathing effect.

Then I used the textBounds() and textToPoints functions to create the points using the font and store it in an array to display the word Clock on the screen similarly to the Circles example we looked at in class.
My final product was pretty simple and didn’t come out nearly as cool as my wallpaper but I had fun working with text.

Kashyapa Generative Artwork

I started by looking at images of other generative artwork on Google images but I found nothing really interesting so I brainstormed and played around with different functions and shapes on P5Js until I decided to incorporate a ball with trails to create some form of design.

Of course, I looked at Professor Aaron’s trailing ball example from class to do this by replacing the background with a black rectangle instead. I also used the blend mode LIGHTEST to make the ball trails look better when they are blended together. Also I made an array to hold all the objects to be used and used a for loop in the draw function to continuously draw all the balls.

Then I wanted to incorporate some interactive elements into the art so I used the mouseClicked() function to initialize two objects of the Ball class with random radii on each side of the canvas each time a mouse button is pressed.

The Ball class consisted of a few variables to determine the features of each ball generated, and two functions, one to draw the balls and one to update their location, using the X speed and Y speed variables. I used the millis() function to record the timestamp when each ball was created and find the difference with the current time to cause the balls to accelerate downwards to make it look like they are falling.

In the end, repeatedly clicking at different heights on the canvas creates a pattern on the screen which is somewhat symmetrical.

Kashyapa Week 2

For this assignment I picked the following image to recreate.

I decided to start by using a for loop to draw the long thin vertical lines first. I noticed that some lines were shorter than others and their starting positions on the y-axis slightly varied. Also, they were slightly to the right and the distance between each one of them was also slightly different for each line. To achieve these parts of the image, I used a for loop using i to change where the lines appear and also used the random function a number of times.
Then I used a lot more for loops to make the blocks of lines appearing in the image. Finally I used rect to generate the black rectangles seen in the image.

This is what my recreation looked like:

Kashyapa Self Portrait

I started off by taking a photograph of myself so I would be able to take a good look at myself and see what I look like. I then paid very close attention to the different shapes I could spot on my face, like the eyes being ellipses for example. By the time I was done with this I had a pretty good idea as to how I would make the self portrait. When I started however, I realized that some aspects of my face would not consist of only one primitive shape and that I would have to combine different shapes.
One of the most challenging parts of this assignment was figuring out how to draw my nose since noses are very oddly shaped. I first wanted to use a combination of arcs but I then decided after browsing through the reference page that using a Bezier curve to draw the side view of the nose would be a lot simpler and would not sacrifice the quality of the portrait. Also, I used a for loop to generate small ellipses in my hair to make it look slightly curly.
Overall, I think this assignment helped me get comfortable with 2D primitive shapes as I often found myself playing around with values to see what would pop up on the screen even though I could have improved certain aspects of like the realism and robustness.
Here is my portrait: