tommasoturchi / react-three-mind

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

Questiions #22

Open maxrpark opened 6 months ago

maxrpark commented 6 months ago

Hello, I am trying to build an app where the user could toggle between the AR seccion and a normal three.js scene. I had done something like that using vanilla MindAr but i am not sure how to implement with react-three-mind

So I have a couple of questions.

1 - What is ref.current.switchCamera()?? The comment says // Switches between environment and user camera. What is enviroment camera?? I tried calling that function on desktop and it did not do much so I guess is about front and back camera for the smartphone ? 2- if I want to have a "normal" R3F do I need to create a new Canvas? or it is posible to somehow use the one for the AR session? I wish there could be a way to stop the AR session. Because if I use the stopTracking the camera still on.

Probably there is a simple solution that I can not think right now, so I thought I could ask for help.

Thank you!

Darkensses commented 5 months ago

Hey @maxrpark let me give you my best effort on this:

  1. Your guess is correct. Switch camera is really useful on smartphones. The enviroment camera is the expected one to use the back camera on the smartphones.
  2. Maybe you should check this discussion here https://github.com/tommasoturchi/react-three-mind/pull/18#issuecomment-1902481345 If you want to stop the camera you need to use the correct function for the webcam. stopTracking is just for deactivating the tracking of markers/images.

I hope these answers are helpful even you asked them a month before lol also if you have a repo of you mind-ar vanilla project, it would be useful for me to check it out a bit ;)