fffiloni commited on
Commit
b11a2b4
1 Parent(s): 83e7fcc

do not mirror if rearcam active

Browse files
Files changed (1) hide show
  1. public/sketch.js +7 -5
public/sketch.js CHANGED
@@ -226,11 +226,13 @@ function draw() {
226
  text('turn on your webcam', width/2, height/2);
227
 
228
  if(capture != undefined){
229
- //move image by the width of image to the left
230
- translate(capture.width, 0);
231
- //then scale it by -1 in the x-axis
232
- //to flip the image
233
- scale(-1, 1);
 
 
234
  image(capture, 0, 0)
235
  }
236
  }
 
226
  text('turn on your webcam', width/2, height/2);
227
 
228
  if(capture != undefined){
229
+ if(!active_rearcam){
230
+ //move image by the width of image to the left
231
+ translate(capture.width, 0);
232
+ //then scale it by -1 in the x-axis
233
+ //to flip the image
234
+ scale(-1, 1);
235
+ }
236
  image(capture, 0, 0)
237
  }
238
  }