lunes, 29 de octubre de 2012
CLASE 29-10-2012
EJERCICIO 2
import processing.opengl.*;
void setup(){
size(600,600,OPENGL);
noStroke();
}
void draw() {
background(0);
translate(width/2,height/2);
pointLight(150,100,0,200,0,0);
pointLight(150,100,0,-200,0,0);
rotateY(map(mouseX,0,width,0,PI));
rotateX(map(mouseY,0,height,0,PI));
box(200);
}
EJERCICIO 3
import processing.opengl.*;
PImage img;
void setup(){
size(640,360,OPENGL);
img = loadImage("zombie.jpg");
noStroke();
}
void draw(){
background(125);
translate(width/2,height/2);
rotateY(map(mouseX,0,width,-PI,PI));
beginShape();
texture(img);
vertex(-100,-100,0,0,0);
vertex(100,-100,0,100,0);
vertex(100,100,0,200,200);
vertex(-100,100,0,0,200);
endShape();
}
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario