j-era / react-three-arnft

Image tracking with jsartoolkit-nft and react-three-fiber.
GNU Lesser General Public License v3.0
12 stars 5 forks source link

How to use the onLost and onFound hooks and get the position of the marker? #4

Open Zaniyar opened 1 year ago

Zaniyar commented 1 year ago

I see you log the messages:

lost {type: 'lost'} or found {type: 'found', index: '0', matrixGL_RH: '[1.0426520743196028,0.13655717738457288,0.04756109…33636608,-74.88481076460363,-577.9151391163712,1]'} how do I communicate to the worker?

Like this: <NFTMarker onMarkerFound={()=>{console.log("found")}} onMarkerLost={()=>console.log('lost')} url={["../data/marker/pinball.fset", "../data/marker/pinball.fset3", "../data/marker/pinball.iset"]}>

Artkoch commented 1 year ago

Hi, I've faced similar issue. I forwarded the props. You can check my fork https://github.com/Artkoch/react-three-arnft-artkoch. I hope that helps

Zaniyar commented 1 year ago

Hi, perfect. You did put the onMarkerFound and Lost on the not on the ... I guess multi-Marker is anyways not possible (didn't test) so that it does not make sense to handle those events for each Marker...

A pitty this repo is not maintained.