jsartoolkit5 icon indicating copy to clipboard operation
jsartoolkit5 copied to clipboard

Trying to use jsartoolkit in a new library

Open JamesLMilner opened this issue 6 years ago • 3 comments

Hey there, firstly thanks for your great library and hard work it's really appreciated.

I've been writing a little library that tries to bring together jartoolkit and ar.js under one roof using TypeScript and webpack. I feel like I've made a good start, and have vendored your latest build of artoolkit.debug.js with some minor alterations (exported it to be an ES6 module, and a few other minor changes to make it work with Webpack correctly). Unfortunately I've hit a brick wall trying to get the AR markers to register. getMarkerNum() is always returning zero (see https://github.com/JamesMilnerUK/THREEAR/blob/cb73d376286e6a0e79b1ef776663ba43e463a938/src/ARController.ts#L149), even when pointing directly at a basic hiro marker, but I'm struggling to figure out why. Most of the code is verbatim the same, just organized slightly differently as TypeScript files.

You can checkout the repo here: https://github.com/JamesMilnerUK/THREEAR and if you run a web server and try and open the basic demo (point your webcamera at: https://jeromeetienne.github.io/AR.js/data/images/HIRO.jpg) you'll see that the marker never appears as per https://github.com/jeromeetienne/AR.js/blob/master/three.js/examples/default.html. There are no error messages or warnings in the console.

Of course I have no expectations here, but if you happen to know why the markers are not being acknowledged, I'd be very appreciative. Happy to answer any additional questions anyone might have.

JamesLMilner avatar Feb 20 '19 00:02 JamesLMilner

@JamesMilnerUK Thank you for share this! I will try it when i have a bit of time...

kalwalt avatar Feb 20 '19 09:02 kalwalt

@kalwalt no worries! Thanks for your reply. Just a heads up, I got this working last night using (a slightly modified) version of the jsartoolkit build that is used in ar.js. It looks like it hasn't been updated in two years however. Anyway, using that build the markers appear correctly for the scenario explained above. I wonder what the difference is between the two? It would be nice to use an updated version :) I might look into building it myself!

JamesLMilner avatar Feb 20 '19 09:02 JamesLMilner

That's super @JamesMilnerUK ! if you want an updated version take note of this: i had an issue compiling the jsartoolkit lib see this https://github.com/artoolkitx/jsartoolkit5/issues/78 and https://github.com/artoolkitx/jsartoolkit5/issues/40 not sure if it happens in all OS scenario. Eventually i filed also a pull request https://github.com/artoolkitx/jsartoolkit5/pull/79, maybe it can be useful for you. There is a NFT branch in jsartoolkit, that's why i started to dig in this library...

kalwalt avatar Feb 20 '19 12:02 kalwalt