FLORA YANTING ZHOU

DAY N NIGHT

Time: Sep. 2021
Course: Creative Technology 1
Instructor: Maxim Safioulline

Create a simple signle-channel controller that would allow you to change one parameter in a Processing program by applying a value received from ESP32 via serial communication. You can use any sensor to generate that value.

Tools: Arduino, Processing, photocell sensor

DESIGN PROCESS

Physical Input

I decided to make a day and night shifting simulation pattern, so after testing sensors I chose the photocell. It is a two feet sensor so after reading the instruction on its website I connected one side to power and other side to an analog pin, and with a 10k resistor to from that analog pin to ground.

The code are from the class. First I checked the pin number I am using on the ESP32, and change that number in line 2. After that the code works well. The numbers from 0 to 4095 appears just right in the serial monitor. 

Serial Graphic Control

At the beginning I downloaded various apps using LIDAR to experiment with different inputs and outputs. There are 3Dscanner using rear camera to create low poly model and ScandyPro using front camera to create delicate model. After comparing and analyzing I chose the latter for its intimacy.

I created large amount of models using my face, hands and other body parts and also tried to render them in different modes like monochrome, wireframes and normals.

First is the sky background, I searched for the mehod to creat gradient and I found lerpColor(). 

Here I created a function to save the method.



By adjusting the axis, I got a rough sky that looks like is changing color but actually is just the Y axis position of gradient changing.

Then I feel just two color is not ample enough for day night shifting, so I created one more gradient and make them connect to each other by doing math on their position. By the way, I laid a monocolor rectangle under the connecting point for there was a narrow white glitching there.

Now is the sun and moon. Initially I want them to do rotation, but I found they could not rotate continuously because the serial exported a range, so their rotation angle only can change within the range.

I changed my approach. Instead of rotation, I made the sun and moon rise and fall in linear by controlling value of positionY.






I originally want to draw a cityscape, but I found the sea level is more suitable with the linear motion of sun and moon.

So I searched for the sine wave. I want the waves to be the water. Lucily I found Daniel Shiffman's example, so I used for() loop to duplicate the waves, and adjusting the amplitude and period of the pattern.

I also made the color of the wave cotrolled by the serial exported value to made them looks coordinate upon different background.

Now all the color is beautiful but the sun and moon are a bit stiff, so I tried to change its opacity and color by mapping the value.

In this project I export the value to long list of varialbles to get the I effect I want.

Working in Progress 

More Works from Creative Technology