fffiloni commited on
Commit
f1103cb
1 Parent(s): 9814640

flip capture

Browse files
Files changed (1) hide show
  1. public/sketch.js +12 -7
public/sketch.js CHANGED
@@ -4,7 +4,6 @@ let current_points = []
4
  let t_size
5
  let button
6
  let isOnCanvas = false;
7
- let hf_tkn;
8
  let socket;
9
  let live = false;
10
  let timer;
@@ -148,12 +147,18 @@ function setup() {
148
  }
149
 
150
  function draw() {
151
- background(220);
152
- textAlign(CENTER);
153
- text('turn on your webcam', width/2, height/2);
154
- if(capture != undefined){
155
- image(capture, 0, 0)
156
- }
 
 
 
 
 
 
157
  }
158
 
159
  function display_messages(){
 
4
  let t_size
5
  let button
6
  let isOnCanvas = false;
 
7
  let socket;
8
  let live = false;
9
  let timer;
 
147
  }
148
 
149
  function draw() {
150
+ background(220);
151
+ textAlign(CENTER);
152
+ text('turn on your webcam', width/2, height/2);
153
+
154
+ if(capture != undefined){
155
+ //move image by the width of image to the left
156
+ translate(capture.width, 0);
157
+ //then scale it by -1 in the x-axis
158
+ //to flip the image
159
+ scale(-1, 1);
160
+ image(capture, 0, 0)
161
+ }
162
  }
163
 
164
  function display_messages(){