Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Cannot for the life of me mirror the output images in this code

$
0
0
I am just trying to mirror the images in this looped stopmotion. I tried using scale(-1,1), but it is not working for me, either it does nothing or the output is a black screen. Anyone know what I can do?
Thank you!!

code:



import processing.video.*;

String[] cameras = Capture.list();
Capture myCapture;

int captureFrame = 0;
int playbackFrame = 0;

int captureDelay = 0;
int stopMotionFrame = 0;

int totalFrames = 25;
PImage[] stopMotion = new PImage[totalFrames];
PImage emptyImage = createImage(1280, 480, RGB);

//boolean sketchFullScreen() {
//  return true;
//}

void setup() 
{
  frameRate(30);
  
  size(1280, 960);





println(Capture.list());
  

  


  myCapture = new Capture(this, 640, 480, 30);
  myCapture.start();


  for (int i = 0; i < totalFrames; i++){
          stopMotion[i] = emptyImage;
        }

  //myCapture.stop();
}

void captureEvent(Capture myCapture) {
  myCapture.read();
}

void draw() {

  background(0,0,0);



  image(myCapture, 0, 0, 1280, 960);
     


  // Captures a frame at a time interval.
  captureDelay++;
  if (captureDelay>15){
    captureDelay=0;
    captureFrame++;
      if (captureFrame>=totalFrames){
        captureFrame=0;
        }     
    
  stopMotion[captureFrame] = get(0,0,1280,960);
  }

  stopMotionFrame++;
  if (stopMotionFrame>=totalFrames){
    stopMotionFrame=0;
  }

  image(stopMotion[stopMotionFrame], 0, 0, 1280, 960);

}


Viewing all articles
Browse latest Browse all 1768

Trending Articles