» codelab : http://codelab.fr/accueil » Forum : Processing : http://codelab.fr/processing » Aide création d'un petit programme : http://codelab.fr/6073 Ceci est la version imprimable d'un sujet du forum, pour retourner à la version complète : Aide création d'un petit programme |
p0ip0i — 2016-01-06 10:25:50 |
Bonjour! |
Mushussu — 2016-01-06 14:29:10 |
Bonjour, PImage image1, image2; void setup() { size(600, 600); image1 = loadImage("image1.jpg"); image2 = loadImage("image2.jpg"); } void draw() { pushMatrix(); translate(100, 100); scale(0.5); image(image1, 0, 0); popMatrix(); translate(200, 200); rotate(-PI / 6); scale(0.6); image(image2, 0, 0); } |
p0ip0i — 2016-01-14 14:44:54 |
Bonjour! PImage titre, cadre, date, cercle ; float scatterX = random(30, 670); float scatterY = random(30, 345); int spin = int(random(360)); int angle = int(random(360)); void setup() { size(585, 827); background(#ffffff); imageMode(CENTER); titre = loadImage("titre.png"); // load image titre.resize(0, 400); //shrink image size cadre = loadImage("cadre.png"); // load image cadre.resize(0, 400); //shrink image size date = loadImage("date.png"); // load image date.resize(0, 400); //shrink image size cercle = loadImage("cercle.png"); // load image cercle.resize(0, 400); //shrink image size frameRate(30); noLoop(); } void draw() { for (int counter = 0; counter < 1; counter++) { if (frameCount % MAX_FRAME_NB == 0) // 1000 { saveFrame( "image-###" ); // Add params InitSketch(); { pushMatrix(); translate(scatterX, scatterY); rotate(radians(angle)); //rotate image random amount of degrees image(titre, random(100), random(100)); // put image at random location image(cadre, random(100), random(100)); image(date, random(100), random(100)); image(cercle, random(100), random(100)); popMatrix(); counter++; // add to count scatterX = random(30, 670); //get new X position scatterY = random(30, 345); // get new Y position } |
Pilou — 2016-01-14 16:44:57 |
Du point de vue de la syntaxe, dans la partie void draw() |
p0ip0i — 2016-01-14 23:17:52 |
merci beaucoup! |