Entradas

Mostrando entradas de diciembre, 2017

Cubo 3D

Enlace: http://www.iesrdelgado.org/web2017/web2018/manuel/cubo3d/index.html

Cuadrado que gira

float r = 0; float backR; float backG; float backB; void setup() {   size(400,400);   backR = random(0,100);   backG = random(0,100);   backB = random(0,100);     background(random(0,255),random(255),random(255));   rectMode(CENTER);     noStroke();   smooth(); } void draw() {   fill(backR, backG, 50, 50);     rect(width/2, height/2, width, height);     fill(255);   translate(mouseX, mouseY);   rotate(r);   rect(0, 0, 100, 100);     r = r + 1.5; }

Líneas random

void setup() {   background(0,0,0);   size(600,600); } void draw() {   fill(0);     stroke(random(0,255),random(255),random(255));   line(350,350,mouseX,mouseY);   }

Cuadrado con lineas

Cuadrado formado por lineas de distinto color. size(500,500); background(10,10,10); stroke(255,255,255); line(10,10,10,300); stroke(255,0,0); line(300,10,10,10); stroke(0,128,0); line(10,300,300,300); stroke(0,0,255); line(300,300,300,10);