GMU:Processing im Park/Maike Effenberg/HW3

From Medien Wiki
< GMU:Processing im Park‎ | Maike Effenberg
Revision as of 22:03, 13 January 2016 by Bhgvt (talk | contribs) (Created page with "== Code - Homework 3.1 == <source lang = "java"> PImage Schwarni; PImage alpha; int dx =50 ; int dy =100; int dschwarni = 75; float speed = 0.01; void setup() { background...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Code - Homework 3.1

PImage Schwarni;
PImage alpha;

int dx =50 ;
int dy =100;

int dschwarni = 75;
float speed = 0.01;

void setup() {
  background (180);
  size (600,600);
  
  Schwarni = loadImage ("schwarn01.jpg");
  alpha = loadImage ("schwarn01blurry.jpg");
  Schwarni.mask (alpha);
  
  
}

void draw () {
  // beeinflusst die farbe,sowie die transperenz von bildern.
  tint(255,10);
 
  translate(mouseX,mouseY);
  
  
  pushMatrix();
  
  rotate(frameCount * speed);
  
  image(Schwarni,-dx,-dy);
  
  
  popMatrix();
  
  if(mousePressed) {
    rotate(frameCount * speed * 2);
    translate(dschwarni,0);
    rotate(frameCount * speed);
    image (Schwarni, -dx, -dy);
    
  }
  
  
}