AR.js icon indicating copy to clipboard operation
AR.js copied to clipboard

Import ar-threex on angular app

Open naonvl opened this issue 2 years ago • 5 comments

Do you want to request a feature or report a bug? Question

What is the current behavior? I'm trying to use ar-threex.js on my angular app, i've added on index.html but still can't access THREEx If the current behavior is a bug, please provide the steps to reproduce. inside index.html

  <script src="./assets/three.module.js" type="module"></script>
  <script src="./assets/ar-threex.js  " type="module"></script>

Please mention other relevant information such as the browser version, Operating System and Device Name iOS, android, desktop What is the expected behavior? Is there any typescript way to import ar.js with three.js ? aframe version is working but the performance was better using threex IMO. If this is a feature request, what is motivation or use case for changing the behavior?

naonvl avatar May 24 '22 10:05 naonvl

Hi @naonvl i think that import ar-threex.js in that way is not allowed and at the moment there are not type definitions for the libs. I haven't tested on Angular so i can't say so much. Sorry maybe other developers has some hints or better ideas to help.

kalwalt avatar May 24 '22 20:05 kalwalt

Hi, I've tried again and it's working, both three and threex is accessible, but didn't quite working as expected. Still working on that for my future project. but for current solution for angular, what a better way to add AR then? do u have any suggestion? currently i use library called THREEAR, but it's not actively maintained so it's not for a long term solution.

naonvl avatar May 25 '22 05:05 naonvl

You can try to use the npm version of Arjs - https://www.npmjs.com/package/@ar-js-org/ar.js I already used it in a project and it basically works with the three.js approach.

FireDragonGameStudio avatar Oct 05 '22 07:10 FireDragonGameStudio

For anyone interested, i'm working to add Typescript support to AR.js follow the discussion in this issue #509.

kalwalt avatar Jan 30 '23 21:01 kalwalt

Hi, have you tried our experimental AR.js-threejs project?, it is the Typescript version of the code from AR.js, only code from three.js folder that is THREEx and ARjs namespaces.

kalwalt avatar Sep 30 '23 19:09 kalwalt