tommasoturchi/react-three-mind

flip webcam horizontally when using face tracking ar

Opened this issue · 4 comments

Hi, All.

I'm facing one issue like below it. hiukim/mind-ar-js#333 As you know, mind-ar doesn't support flip facing mode. It make really bad user experience. So I focus on flip video and contents when user is using facingMode is user. Please let me know any good approch.

Thanks.

Hi @sewonist
I'm looking into this, and if I understood correctly the problem is flipping the camera and projections when using the front facing camera. I'll include it in the API soon, but I managed to get it working by flipping the webcam video with the css rule transform: scaleX(-1) as suggested in the first link, then I wrapped the ARFaceMesh component with a <group scale={[-1, 1, 1]}> to match the video flip. It looks like it's working, if you want to test it out and let me know, I'll include it in the api (I think it could be a "flip" property on the ARView component).
Cheers,

Tommaso

I've added this in the latest release 0.2.0 :-)

Hi @tommasoturchi
Thank you for hard work! I try to your approaching. Buy it has a problem that text modeling is flip to wrong side. So I should flip source for main-ar like sewonist/mind-ar-js@c781e87 It's very experimental. I should more test tough it's working for me.

Hi @sewonist!
Thank you for this! What do you mean with the text modeling? The anchors?! I actually haven't flipped those, good work! I'll flip those too with the same strategy and test it out. I think it's a bit less "hacky" than dealing with the inner mind-ar code, but I'll test that too. Thanks!