Skip to content

Commit

Permalink
createCapture flipped property in WEBGL fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
MuktiMishra committed Oct 6, 2024
1 parent 7d393ec commit 2dcdaa7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/empty-example/sketch.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
let video;
function setup() {
// put setup code here
createCanvas(640, 480, WEBGL);
video = createCapture(VIDEO, { flipped: true });
video.hide();
}

function draw() {
// put drawing code here
translate(-width / 2, -height / 2);
scale(-1, 1); //added scale for horizontal flip
image(video, -width, 0); //here used -width that shifts the video back into view from the opposite side
}

0 comments on commit 2dcdaa7

Please sign in to comment.