Ejercicio
Qué hace este código.
Digitar
A)
for (int x=-16;
x<100; x+=10) {
line(x, 0, x+15, 50);
}
strokeWeight(4);
for (int x=-8;
x<100; x+=10) {
line(x, 50, x+15, 100);
}B)
smooth();
strokeWeight(12);
strokeCap(ROUND);
line(20, 30, 80, 30);
strokeCap(SQUARE);
line(20, 50, 80, 50);
C)
void setup() {
size(250,250);
}
void draw() {
colorMode(HSB);
for (int i = 0; i < 100; i++) {
stroke(i*2.5, 255, 255);
line(i, 0,
i, 100);
}
}
D)
E)
FIGURAS
triangle(X1,
Y1, X2, Y2, X3, Y3);
rect(0,
5, 70, 30);
translate(10,
30); // Se cambia a 10 pixels a la derecha y 30 hacia abajo
rect(0, 5, 70, 30);
beginShape();
vertex(X, Y);
vertex(X1, Y1);
vertex(X2, Y2);
endShape(CLOSE);
beginShape(POINTS);
EJEMPLO
noFill();
beginShape();
vertex(30, 20);
vertex(85, 20);
vertex(85, 75);
vertex(30, 75);
endShape();
IMAGEN
PImage img;
img =
loadImage("arch.jpg");
image(img, 0, 0);
void setup(){ background(255,0,0); size(300,240); } void draw(){ PImage ldu, d; ldu = loadImage("ldu.jpg"); image(ldu, 20,20); } |
0 comentarios: