My world
I consider it as my world. The white circle with a face is me, which stays unchanged and motionless in my world since I use myself as a reference. The road I’m taking is not moving in reality while I sometimes taking detours. But I am the center of my world, so for me what’s moving is the road. There’re also many people and other things around me always changing. They might get both close to me and away from me.
I did not use many kinds of maths functions. Mostly I just used the sine function and cosine function.
x = x + 20;
y = height / 2 + sin(x * 0.003) * 100;
X = X + 10;
Y = height / 2 + cos(x * 0.01) * 100;
fill(ranRed, ranGreen, ranBlue);
circle(x, y, 30);
circle(X, Y, 50);
if (x > 400) {
x = 0;
}
if (X > 400) {
X = 0;
}
Other motions and change of color are done by variables including “random()” and frameCount. They actually made me a little confused because I can hardly remember meanings of different value in sine and cosine function. All I did is adjusting the values little by little.
stroke(frameCount, 255,100)
ranRed = random(0,255);
ranGreen = random(0, 255);
ranBlue = random(0, 255);
let shape = frameCount;
recX = random(250, 330);
recY = random(30, 140);
r = frameCount/6;
Here’s one thing I especially like. This makes the circles arcs rotating with different rates.
arc(200, 200, 140, 140, QUARTER_PI + R * PI, TWO_PI + R * PI);
arc(200, 200, 120, 120, PI + QUARTER_PI + d * PI, PI + d * PI);
There are also other motions as well, including zooming and rotating when moving.
I tried to use map() to adjust the motions. But I got confused since there are many different functions and I really paid a lot more efforts on Gif recording(stuggled!!!)
Though I didn’t use sine and cosine functions to finish a circular movement, I found it interesting that the vertical and horizontal coordinates of a point moving in a circle are the sine and cosine functions
I realized that I’m still not that familiar with the use of frameCount and frameRate(). At first I use frameRate() to make it slower but then I found there seems to be a conflict between frameRate() and setupGif(). The image was still. So I rewrite many functions with frameCount.