GMU:Processing im Park/Emilio Aguas/sample code test01: Difference between revisions

From Medien Wiki
(Created page with "hola")
 
No edit summary
 
Line 1: Line 1:
hola
====--- Processing3.0 Code--- ====
 
<source lang="java">
 
//Movie library
import processing.video.*;
 
//Declare movie object
Movie Ilm_Vid, Ilm_Vid01;
 
void setup() {
  //Keep the aspect ratio 16:9
  size(800, 450);
  //Max values for hue, sturation, brightness and alpha
  colorMode(HSB, 360, 100, 100, 100);
  background(50, 75, 93);
 
  //Initiaize and loop video
  Ilm_Vid= new Movie(this, "Ilm_vid01.m4v");
  Ilm_Vid01= new Movie(this, "Ilm_vid02.m4v");
  Ilm_Vid.loop();
  Ilm_Vid01.loop();
}
 
void draw() {
  //remaping saturation values to the size of the screen
  float sat =map(mouseX, 0, width, 0, 100);
  //dispalying videos changing saturation
  tint(130, sat/2, 100, 10);
  image(Ilm_Vid, 0, 0, width/2, height/2);
  tint(130, sat, 100, 20);
  image(Ilm_Vid01, width/2, 0, width/2, height/2);
 
}
 
void movieEvent(Movie Ilm){
  Ilm.read();
}
 
</source>

Latest revision as of 14:37, 1 April 2016

--- Processing3.0 Code---

//Movie library
import processing.video.*;

//Declare movie object
Movie Ilm_Vid, Ilm_Vid01;

void setup() {
  //Keep the aspect ratio 16:9
  size(800, 450);
  //Max values for hue, sturation, brightness and alpha
  colorMode(HSB, 360, 100, 100, 100);
  background(50, 75, 93);

  //Initiaize and loop video
  Ilm_Vid= new Movie(this, "Ilm_vid01.m4v");
  Ilm_Vid01= new Movie(this, "Ilm_vid02.m4v");
  Ilm_Vid.loop();
  Ilm_Vid01.loop();
}

void draw() {
  //remaping saturation values to the size of the screen
  float sat =map(mouseX, 0, width, 0, 100);
  //dispalying videos changing saturation
  tint(130, sat/2, 100, 10);
  image(Ilm_Vid, 0, 0, width/2, height/2);
  tint(130, sat, 100, 20);
  image(Ilm_Vid01, width/2, 0, width/2, height/2);
  
}

void movieEvent(Movie Ilm){
  Ilm.read();
}