Aktionen

Niels

Aus exmediawiki

Hallo

Hier sind meine

Hausaufgaben

hier auch als link

 1 //Rotations, 2024
 2 
 3 function setup() {
 4   createCanvas(600, 600);
 5   angleMode(DEGREES);
 6   rectMode(CENTER);
 7 }
 8 
 9 function draw() {
10   translate(width / 2, height / 2);
11   background(250, 250, 20);
12 
13  
14   //amount of shapes
15   let nShape = 13;
16   
17   //ring of shapes:
18   //square separately, because the corners overlap
19   for (let q = 0; q < nShape; q = q + 1) {
20     push();
21     rotate((360 / nShape) * q);
22     fill(80, 200, 50);
23     square(0, 0, 50);
24     pop();
25   }
26 
27   //rest of the shapes all in one
28   for (let q = 0; q < nShape; q = q + 1) {
29     push();
30     rotate((360 / nShape) * q);
31     fill(254, 0, 0);
32     circle(50, 20, 10);
33     fill(10, 90, 90);
34     circle(29, 68, 8);
35     fill(170, 60, 80);
36     triangle(34, 250, 34, 44, 48, 72);
37     noFill();
38     triangle(22, 130, 70, 40, 60, 72);
39     triangle(5, 5, 10, 20, 20, 72);
40     circle(170, 30, 10);
41     line(155, 40, 189, 20);
42     line(102, 100, 175, 7);
43     triangle(27, 37, 21, 10, 14, 340);
44     pop();
45   }