|
|
Line 146: |
Line 146: |
| <br style="clear:both;"> | | <br style="clear:both;"> |
|
| |
|
| Processing v3.0.0 Quellcode:
| | [http://www.uni-weimar.de/medien/wiki/index.php5?title=GMU:Processing_im_Park/Dirk_Wäsch/Code_Hausaufgabe_III Processing v3.0.0 Quellcode] |
| <source lang="java">
| |
| int n = 10;
| |
| | |
| // list of flickr urls, containing my images
| |
| String[] urls = {
| |
| "https://c1.staticflickr.com/1/583/23143686064_f334ac29d3_c.jpg",
| |
| "https://c1.staticflickr.com/1/744/23145048033_5e4ca63da7_c.jpg",
| |
| "https://c1.staticflickr.com/6/5774/23771836845_a9bfd0e883_c.jpg",
| |
| "https://c1.staticflickr.com/6/5715/23403900079_6d7e2fbd96_c.jpg",
| |
| "https://c1.staticflickr.com/6/5815/23663367172_c647395930_c.jpg",
| |
| "https://c1.staticflickr.com/1/721/23663365892_fa35e2156a_c.jpg",
| |
| "https://c1.staticflickr.com/6/5654/23476155410_dfaa2d34e5_c.jpg",
| |
| "https://c1.staticflickr.com/1/781/23689409061_eb23a1cfd3_c.jpg",
| |
| "https://c1.staticflickr.com/1/614/23403891279_54d675d8db_c.jpg",
| |
| "https://c1.staticflickr.com/6/5695/23403888729_3caefaf24a_c.jpg"
| |
| };
| |
| | |
| | |
| PImage[] images = new PImage[n];
| |
|
| |
| // offset to the reference point
| |
| int dx = 100;
| |
| int dy = 200;
| |
|
| |
| // factor to slow our animation down
| |
| int slowdown = 4;
| |
|
| |
| // zoom factor for our image
| |
| float zoom = 0.25;
| |
|
| |
| // speed of rotation
| |
| float speed = 0.005;
| |
|
| |
|
| |
| void setup() {
| |
|
| |
| // canvas size
| |
| size(600, 400);
| |
|
| |
| // start out with a white background
| |
| background(255);
| |
|
| |
| // load images into the array using a loop
| |
| for(int i=0; i < n; i++) {
| |
|
| |
| // load the image
| |
| images[i] = loadImage(urls[i]);
| |
|
| |
| // Use the brightness of the image as its own alpha channel)
| |
| images[i].mask(images[i]);
| |
|
| |
| noCursor();
| |
|
| |
| }
| |
|
| |
| }
| |
|
| |
|
| |
| void draw() {
| |
| // let's set a transparent tint, for extra effect
| |
| tint(255, 35);
| |
|
| |
| // save the current transformation matrix
| |
| pushMatrix();
| |
|
| |
| // restore the previous transformation matrix
| |
| popMatrix();
| |
|
| |
| // pick the index of an image
| |
| int pick = (frameCount / slowdown) % n;
| |
|
| |
| // move to the mouse position
| |
| translate(mouseX , mouseY);
| |
|
| |
| // scale the image
| |
| scale(zoom);
| |
|
| |
| // move to the reference point
| |
| translate(-dx, -dy);
| |
|
| |
| // get image from the array and display it
| |
| image(images[pick], 0, 0);
| |
|
| |
| }
| |
| </source> <br>
| |
|
| |
|
| == Ausflug - Schlosspark Belvedere == | | == Ausflug - Schlosspark Belvedere == |