User:Regine/Quellcode

From Medien Wiki

Homework one

15 pieces in grid - Quellcode:

   


slideshow of 9 images:

   


cut tiles - Quellcode:

 


Homework two

sliced Duck - Quellcode:

 


Weimaraner brushed plaque - Quellcode:

 


Parkhöhle - Quellcode:

File:Code Parkhöhle a.png File:Code Parkhöhle b.png


End of Semester

Snow Cannon - Quellcode
PImage img;
int m = 200;
int p = 30;
color c;
int value = 0;
int q;
int a;
int j;
 
import processing.sound.*;
SoundFile file;

void setup() {
  size(640, 465);
  img=loadImage("Schneekanone1.jpg");
  image(img, 0, 0);
  
  file = new SoundFile(this, "Spruehschnee.mp3");
  
}
 
void draw() {
 
  loadPixels();
  for (int w=0; w<000; w++) {
    q = int(random(pixels.length));
    a = int(random(a, pixels.length));
  }
 
}
void mouseReleased() {
    file.play();
  for (int w=0; w<2000; w++) {
    q = int(random(pixels.length));
    a = int(random(q, pixels.length));
    j = int(random(pixels.length));
    if ( a<pixels.length && j<pixels.length || pixels[m] < pixels[p] ) {
      c = pixels[q];
      pixels[q] = c;
      pixels[a] = c;
      pixels[j] = c;
    
    }
  }
  updatePixels();
  }


White Imagination  - Quellcode
PImage img;
PImage sourceImage;
 
void setup(){
 size(640, 480);
 
 sourceImage = loadImage ("Alpenblick2.png");
 image (sourceImage, 0, 0, 640, 480);
 
}
 
void draw(){
 img = loadImage ("Alpenblick5.png");
 int x = 10;
 int width = 550;
 int height = 8;
 img.resize(640, 460);
 
 for (int i = 20; i < 480; i = i +25) {
   copy(img, x, i, width, height, x, i, width, height);
 }
}