Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Ejemplo 1:
void setup ()
{
size (200,200);
frameRate (2);
}
void draw ()
{
background (255);
stroke (0);
line (width/2, 0, width/2,height/2);
line (0, height/2, width, height/2);
rectMode (CORNER);
fill (0);
if (mouseX < width/2 && mouseY < height/2)
{
fill (random (255), random (255), random (255));
rect (0, 0, width/2, height/2);
}
else if (mouseX > width/2 && mouseY < height/2)
{
fill (random (255), random (255), random (255));
rect (width/2, 0, width/2, height/2);
}
else if (mouseX < width/2 && mouseY > height/2)
{
fill (random (255), random (255), random (255));
rect (0, height/2, width/2, height/2);
}
else
{
fill (random (255), random (255), random (255));
rect (width/2, height/2, width/2, height/2);
}
}
Ejemplo 2: