We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
second window (Read 949 times)
second window
May 20th, 2010, 2:32am
 
hi:)
i would like to write in processing the second window that responded only to the panorama wiev(8cams)
i make two squares that move left and right and in the background are 8 cams......
can anybody help me,.....
thankss;)
ther is the code:


import processing.video.*;
import processing.serial.*;
Capture A;
Capture B;
Capture T;
Capture E;
//PImage bg;


PImage C;
PImage D;

float offset;

//serial
Serial port;
int baudrate = 9600;
int value = 0;

void setup()
{
 //size(1500,150);
 //bg = loadImage("1klein.jpg");
 //serial connection
 println("list serial ports: "+Serial.list()[1]); // testausgabe vom portname
 port = new Serial(this, Serial.list()[1], baudrate);

 size(900,300);

 A = new Capture(this, width, height, 30);
 B = new Capture(this, width, height, 30);
 T = new Capture(this, width, height, 30);
 E = new Capture(this, width, height, 30);

 C = loadImage("crno.jpg");
 D = loadImage("belo.jpg");


}
void captureEvent(Capture myCapture) {
 myCapture.read();
}
void draw() {
 //background(A);

//camera
 //image(bg, 0+value, 0);
 image(A, 0, 0);
 image(B, 300, 0);
 image(T, 600, 0);
 image(E, 900, 0);


 //sensor data moving black rectangles
 while(port.available() > 0){
   value = port.read();
   float temp = value * 9.6;
   value = (int)temp;
   
   println("yes there is data: "+value);

  //float offsetTarget = map(value, 100, width,-C. width/2 - width/2, 0);
  // offset += (offsetTarget-offset)*0.05;

  // tint(255,225,225);
   //image(C, offset, 0);
   //image(D,offset, 0);
 }
 
 image(C,value-30-1500,0);
 image(D,value+10,0);


 /* move rect with mouse
  float offsetTarget = map(mouseX, 100, width,-C. width/2 - width/2, 0);
  offset += (offsetTarget-offset)*0.05;
 
  tint(255,225,225);
  //image(C, offset, 0);
  //image(D,offset, 0);
 
  image(C,mouseX-50-1500,0);
  image(D,mouseX+150,0);
  println("mouseX: "+mouseX);
  */
}

Page Index Toggle Pages: 1