Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n;
- float t = 0;
- void setup() {
- size(480, 480);
- smooth();
- n = 500;
- }
- void draw() {
- noStroke();
- fill(25,25,25);
- float radius = height / 3;
- float angle = 0;
- float angleStep = 0.005;
- float freq = 6;
- float amp = 20;
- background(255);
- cerchio(angle, radius, freq, amp, angleStep, t);
- t = t + 0.07;
- }
- void cerchio(float angle, float radius, float freq, float amp, float angleStep, float t) {
- while (angle <= TWO_PI) {
- float dx = (width / 2) + (radius + sin(angle * freq) * (amp * sin(t))) * cos(angle);
- float dy = (height / 2) + (radius + sin(angle * freq) * (amp * sin(t))) * sin(angle);
- ellipse(dx, dy, 2, 2);
- float dw = (width / 2) + radius * cos(angle);
- float dz = (height / 2) + radius * sin(angle);
- angle += angleStep;
- ellipse(dw, dz, 2, 2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement