Aktionen

Niels: Unterschied zwischen den Versionen

Aus exmediawiki

(Die Seite wurde neu angelegt: „HIIII“)
 
Zeile 1: Zeile 1:
HIIII
+
==Hallo==
 +
 
 +
Hier sind meine
 +
=<span style="color:red">Hausaufgaben</span>=
 +
 
 +
[https://editor.p5js.org/nielope/full/vnmVGTOqp9 hier auch als link]
 +
 
 +
<syntaxhighlight lang="javascript" line>
 +
//Rotations, 2024
 +
 
 +
function setup() {
 +
  createCanvas(600, 600);
 +
  angleMode(DEGREES);
 +
  rectMode(CENTER);
 +
}
 +
 
 +
function draw() {
 +
  translate(width / 2, height / 2);
 +
  background(250, 250, 20);
 +
 
 +
 +
  //amount of shapes
 +
  let nShape = 13;
 +
 
 +
  //ring of shapes:
 +
  //square separately, because the corners overlap
 +
  for (let q = 0; q < nShape; q = q + 1) {
 +
    push();
 +
    rotate((360 / nShape) * q);
 +
    fill(80, 200, 50);
 +
    square(0, 0, 50);
 +
    pop();
 +
  }
 +
 
 +
  //rest of the shapes all in one
 +
  for (let q = 0; q < nShape; q = q + 1) {
 +
    push();
 +
    rotate((360 / nShape) * q);
 +
    fill(254, 0, 0);
 +
    circle(50, 20, 10);
 +
    fill(10, 90, 90);
 +
    circle(29, 68, 8);
 +
    fill(170, 60, 80);
 +
    triangle(34, 250, 34, 44, 48, 72);
 +
    noFill();
 +
    triangle(22, 130, 70, 40, 60, 72);
 +
    triangle(5, 5, 10, 20, 20, 72);
 +
    circle(170, 30, 10);
 +
    line(155, 40, 189, 20);
 +
    line(102, 100, 175, 7);
 +
    triangle(27, 37, 21, 10, 14, 340);
 +
    pop();
 +
  }
 +
 
 +
</syntaxhighlight>

Version vom 26. Mai 2024, 18:46 Uhr

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   }