artoolkitx / jsartoolkit5

Javascript ARToolKit v5.x

Home Page:https://artoolkitx.github.io/jsartoolkit5/examples/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NFT Branch, looking for a working demo

nicolocarpignoli opened this issue · comments

Hi everybody
I think the NFT branch is very very interesting, also for things like AR.js. I'd like to try a demo. I see there is a lot of demos on it, but I tried the 'nft_threejs.html' demo file, and I found several issues, that are blocking me:

  • at some point, on artoolkit.api.js, there is a call to video.src = URL.createObjectUrl(stream). API is old and the solution is simply to do this: video.srcObject = stream instead of the above

  • FS is not defined.

I have not solved the second error. It requires FS, that is a node thing. I don't understand why it is used on an HTML file, and also, how this is working in the first place.

BTW, my answer is: is there anybody that has been able to use some of the NFT branch demo with success, in the past months? Can you point me what demos to use, or another project maybe that uses such jsartoolkit branch?

thank you so much

H @nicolocarpignoli i am working to update the nft branch see this my PR kalwalt#1 This is a work in progress, for now i don't receive errors but the nft image is not recognized ( or could be some other issue).

at some point, on artoolkit.api.js, there is a call to video.src = URL.createObjectUrl(stream). API is old and the solution is simply to do this: video.srcObject = stream instead of the above

yes the Api is a bit old, you are right but you could also try the other repository https://github.com/artoolkit/jsartoolkit5/tree/nft

FS is not defined.

it should be related ( but not sure 100%) to the last part of the artoolkit.api,

var scope;
if (typeof window !== 'undefined') {
scope = window;
} else {
scope = self;
}
/* Exports */
scope.artoolkit = artoolkit;
scope.ARController = ARController;
scope.ARCameraParam = ARCameraParam;
if (scope.Module) {
runWhenLoaded();
} else {
scope.Module = {
onRuntimeInitialized: function() {
runWhenLoaded();
}
};
}
})();

and this is in my branch:

https://github.com/kalwalt/jsartoolkit5/blob/75231140af8af7eec3b65d53221dcf2b4ce59f03/js/artoolkit.api.js#L1907-L1927

Unfortunately i have also some issue with the other type of markers, i think i am very close but i can't see where is the problem...

Great! I'm trying to run the demo, opening in a local environment https://github.com/artoolkit/jsartoolkit5/blob/nft/examples/nft_threejs.html but loading your file linked above (artoolkit.api.js).

I always get the FS is not defined error.
How do you launch examples without having this error? You launch some script/command before opening the HTML demo?

Great! I'm trying to run the demo, opening in a local environment https://github.com/artoolkit/jsartoolkit5/blob/nft/examples/nft_threejs.html but loading your file linked above (artoolkit.api.js).

I always get the FS is not defined error.
How do you launch examples without having this error? You launch some script/command before opening the HTML demo?

that's strange... no i don't run any script could you post all the log? but Are you trying to use my artoolkit.api.js version with the example?

Yes, I'm using your artoolkit.api.js on the HTML, but I got the same error of the 'original' artoolkit.api.js with the modifies about 'createObjectUrl' that I said on the first post. I have the latest Chrome on desktop (but error on mobile as well):

image

Launched on a local server under https to avoid CORS and privacy problems.
not showing camera stream as well, because the 'FS' error is blocking the app before that.

I don't know why this happens, but what happens if you use the minified version ? and also what is the result for the nft_init_test.html?

For the nft_threejs.html I got this

image

Instaed for nft_init_test.html I got:

image

have you already seen one of these?

ok, i see that are you testing my branch. For the nft_threejs.html yes i receive sometimes that error, but not with the nft_threejs example. instead this is my result for the nft_init_test.html
Schermata da 2019-06-21 16-59-08 this is in my branch.

@nicolocarpignoli wait i have other changes in my branch!

@nicolocarpignoli the FS error could be caused also by a wrong compilation of the libs: the FS Node module i think is included by the emscripten compiler in the debug lib.

eventually will be closed by: #86

there is now! :D

@nicolocarpignoli please see here on how to fix the FS error