Processing web Test display
/* @pjs preload="si.jpg"; */ // preload pour le Web
PImage art; // declaration variable image
float rValue = 0; // variable float pour la valeur de rotation qui commence a 0
void setup(){
size(900, 600);
art = loadImage("si.jpg"); //initialisation et/ou load
imageMode(CENTER);
background(0);
}
// la rotation s'effectue depuis le pt origine x=0, y=0
// On utilise donc translate pour le déplacer au centre
void draw(){
rValue = rValue + .8;
translate(width/2, height/2); // Translate, deplace le pt de rotation (au centre)
rotate(radians(rValue)); // la rotation se place avant la boucle
for(int i=0; i<10; i++){
image(art, 50+i*40, 0, 40, 30);
}
}
/* @pjs preload="si.jpg"; */
int amount = 50;
PImage art; // declaration des variables image
float rValue = 0; // variable float pour la valeur
//de rotation qui commence a 0
void setup(){
size(900, 600, P3D);
background(0);
art = loadImage("si.jpg"); //initialisation et/ou load
imageMode(CENTER);
noFill();
stroke(0, 255, 0);
strokeWeight(1);
}
void draw(){
rValue = rValue + .8;
translate(width/2, height/2); // Translate, deplace le pt de rotation (au centre)
rotate(radians(rValue)); // la rotation se place avant la boucle
for(int i=0; i<8; i++){
image(art, 50+i*40, 0, 40, 30);
}
fill(0, 3);
rect(0, 0, 900, 600);
noFill();
stroke(0, 250, 0);
rotateZ(frameCount / 50.0);
for (int j=0; j