User:Regine/Quellcode: Difference between revisions

From Medien Wiki
 
Line 38: Line 38:
== End of Semester ==
== End of Semester ==


  Snow Cannon
  Snow Cannon - Quellcode


<source lang = "java">
<source lang = "java">
Line 93: Line 93:




  White Imagination  
  White Imagination - Quellcode
 


<source lang = "java">
<source lang = "java">

Latest revision as of 22:23, 23 March 2016

Homework one

15 pieces in grid - Quellcode:

Grid1.png Grid2.png


slideshow of 9 images:

Slide1.png Slide2.png


cut tiles - Quellcode:

Collage Brueckenschloss.png


Homework two

sliced Duck - Quellcode:

Sliced duck Quellcode.png


Weimaraner brushed plaque - Quellcode:

Weimaraner Quellcode.png


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);
 }
}