Spaces:
Sleeping
Sleeping
flip capture
Browse files- 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 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 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(){
|