We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Here is my code:
var video; function setup() { createCanvas(320, 240); //canvas background(51); video = createCapture(VIDEO); //camera / video video.size(320, 240); video.hide(); //hides video } function draw() { //canvas image(video, 0, 0, width, height); //video on canvas, position, dimensions }
Answers
@banana -- the easiest way to reverse any image (in Processing or p5.js) is to use
scale(-1,1)
to flip the x-axis of drawing, then callimage()
.Here is a sketch that draws the video feed twice -- once normally on the left, once flipped on the right. Notice that the
image()
line is exactly the same, buttranslate()
andscale()
have changed the direction and orientation of drawing to (0,0) the second time.For reference, see
scale()
:Thanks. I will try your code.