webarkit / ARnft-threejs

A rendering package for https://github.com/webarkit/ARnft
GNU General Public License v3.0
22 stars 7 forks source link

Can I get marker's 3d position data? #27

Open kezmanh opened 2 years ago

kezmanh commented 2 years ago

I want to display a 3d model after scanned an image marker. I tried the example one but I want to try update the model with my own code.

May I know if it is possible for me to build my own three js 3d world and hide the models. Then I use the callback from ARnft to display the object and update its position to the marker?

kalwalt commented 2 years ago

If i understood right you want to hide and unhide your model. At the moment it is possible only to decide to hide or not at the creation, when you add the model/mesh. See the objVisilbility option https://github.com/webarkit/ARnft-threejs/blob/16543652f7c2f01fe546b4709b8aa105fcadcab7/src/markermedia/NFTaddTJS.ts#L63 used inside the event listener https://github.com/webarkit/ARnft-threejs/blob/16543652f7c2f01fe546b4709b8aa105fcadcab7/src/markermedia/NFTaddTJS.ts#L80-L83 so you can decide if it visible or not after tracking is lost. But you can't change this after, at least for now. But i think we can add this feature.