Diferencia entre revisiones de «Discusión:Imagen Escrita 2019»
De Casiopea
(Página creada con «====Paula Retamal==== * [https://editor.p5js.org/paulita.ee.pr/sketches/I9qlMMtX4 primer intento] </div> <div class='listado'>») |
Sin resumen de edición |
||
(No se muestran 2 ediciones intermedias de 2 usuarios) | |||
Línea 1: | Línea 1: | ||
<pre> | |||
</ | function setup() { | ||
< | createCanvas(500, 500); | ||
cursor(CROSS); | |||
strokeWeight(); | |||
} | |||
function draw() { | |||
background(220, 300, 500); | |||
rect(0, 300, 500, 100); | |||
fill(0, 0, 255, 100); | |||
rect(0, 300, 500, 200); | |||
fill(0, 0, 255, 100); | |||
rect(0, 300, 500, 20); | |||
fill(0, 0, 255, 100); | |||
arc(250, 300, 80, 80, PI, TWO_PI); | |||
fill(255, 117, 20, 100); | |||
arc(250, 300, 90, 85, PI, TWO_PI); | |||
fill(255, 117, 20, 100); | |||
arc(250, 300, 100, 90, PI, TWO_PI); | |||
//translate(mouseX, mouseY); | |||
strokeWeight(1); | |||
if(mouseIsPressed){ | |||
rayos(width/2, height/1.75, 1380, 11);} | |||
} | |||
function rayos(x, y, tam, n) { | |||
stroke(255, 100); | |||
push(); | |||
translate(x, y); | |||
rotate(millis()/1900); | |||
let s = tam / n; | |||
for (let y = 0; y < n; y++) { | |||
for (let x = 0; x < n; x++) { | |||
let xpos = -tam / 2 + x * s; | |||
let ypos = -tam / 2 + y * s; | |||
line(xpos, ypos, 0, 0); | |||
} | |||
} | |||
} | |||
</pre> |
Revisión actual - 16:32 16 sep 2019
function setup() { createCanvas(500, 500); cursor(CROSS); strokeWeight(); } function draw() { background(220, 300, 500); rect(0, 300, 500, 100); fill(0, 0, 255, 100); rect(0, 300, 500, 200); fill(0, 0, 255, 100); rect(0, 300, 500, 20); fill(0, 0, 255, 100); arc(250, 300, 80, 80, PI, TWO_PI); fill(255, 117, 20, 100); arc(250, 300, 90, 85, PI, TWO_PI); fill(255, 117, 20, 100); arc(250, 300, 100, 90, PI, TWO_PI); //translate(mouseX, mouseY); strokeWeight(1); if(mouseIsPressed){ rayos(width/2, height/1.75, 1380, 11);} } function rayos(x, y, tam, n) { stroke(255, 100); push(); translate(x, y); rotate(millis()/1900); let s = tam / n; for (let y = 0; y < n; y++) { for (let x = 0; x < n; x++) { let xpos = -tam / 2 + x * s; let ypos = -tam / 2 + y * s; line(xpos, ypos, 0, 0); } } }