Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFT Branch, looking for a working demo #83

Closed
nicolocarpignoli opened this issue Jun 20, 2019 · 12 comments
Closed

NFT Branch, looking for a working demo #83

nicolocarpignoli opened this issue Jun 20, 2019 · 12 comments

Comments

@nicolocarpignoli
Copy link

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

@kalwalt
Copy link

kalwalt commented Jun 21, 2019

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...

@nicolocarpignoli
Copy link
Author

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?

@kalwalt
Copy link

kalwalt commented Jun 21, 2019

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?

@nicolocarpignoli
Copy link
Author

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.

@kalwalt
Copy link

kalwalt commented Jun 21, 2019

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?

@nicolocarpignoli
Copy link
Author

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?

@kalwalt
Copy link

kalwalt commented Jun 21, 2019

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.

@kalwalt
Copy link

kalwalt commented Jun 21, 2019

@nicolocarpignoli wait i have other changes in my branch!

@kalwalt
Copy link

kalwalt commented Jun 21, 2019

@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.

@nicolocarpignoli
Copy link
Author

eventually will be closed by: #86

@nicolocarpignoli
Copy link
Author

there is now! :D

@andypotato
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants