Aktionen

Niels: Unterschied zwischen den Versionen

Aus exmediawiki

Niels (Diskussion | Beiträge)
Die Seite wurde neu angelegt: „HIIII“
 
Niels (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
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, 17:46 Uhr

Hallo

Hier sind meine

Hausaufgaben

hier auch als link

//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();
  }