tommasoturchi / react-three-mind

MindAR components for @react-three/fiber
37 stars 12 forks source link

Projected item moving left and right, rotates #14

Closed r3s closed 1 year ago

r3s commented 1 year ago

This is not an issue with this module, but would be great if you could help out nonetheless. Feel free to close it as off-topic if you feel so.

I tried out this module and everything works when running the image target example. But the moment I start using it in my project, even with the same code as in the example, the projected plane starts moving left and right. If I move the camera left, the plane moves right and vice-versa. Top-down motion does not seem to have this issue. Attaching a video demonstrating the issue. In the video, I was testing out with an image but this happens with the bare react example code here as well.

Help is really appreciated

https://user-images.githubusercontent.com/920688/234107186-e9447976-4cf2-4610-b867-ff24b0e6f29a.mp4

tommasoturchi commented 1 year ago

Hi @r3s ! Uhm this is weird. It might be due to the image mirroring performed on mobile with the selfie cam (even though from the video it looks like it's the rear camera). I'll check better that part of the code, I put it together quickly and might have made some mistake 😅

r3s commented 1 year ago

Hey @tommasoturchi Thanks for checking. You are right that this is using the rear camera.

r3s commented 1 year ago

Quick update @tommasoturchi

When you said it might be related to the front facing camera, I took another look. And it looks like if you don't set flipUserCamera to false explicitly, the default is true. I set it to false and everything just started working fine.

https://user-images.githubusercontent.com/920688/234382854-017a1128-e60d-481d-b1b6-b0a14a5e6706.mp4

I'll put burden of closing this ticket on you in case you want to change the default value to false initially and reference this issue in the commit.