Hello, i know about the ar.js converter to make a patt file but is there a way to make such a file from GIMP? Thanks.
Are you using AR Toolkit? If so, the markers need to be done in a particular way (using GIMP, paint etc) and then ‘trained’. See: https://www.artoolworks.com/support/library/creating_and_training_new_artoolkit_markers.html
Leonidas mentioned that to track a full colour image, you could add the black and white marker to a section of a larger colour image.
Using the AR playground project here in playcanvas then used the ar.js marker training https://jeromeetienne.github.io/AR.js/three.js/examples/marker-training/examples/generator.html to have a patt file but that page just do square markers so if there was a way to save a similar file with gimp i would have used that method…i saw it refers as ‘COLPETTO’ file, but don’t seem there’s such extension on gimp to use.
The link I posted shows the format and layout it needs to be at. I would grab a hiro marker image and import that into GIMP, change the middle to what you want it to be and use the generator you linked to to create the patt file to use in the app.
The little issue is that i don’t want the black border so have to find a different way.
JSArToolkit5 has nft (natural feature tracking), that is however not included in the pc ar starter kit. I have got it working by upgrading the artoolkit.min.js to the newest version and done some modifications as the nft markers can’t be loaded in web mode due to file path handling issues.
Oh nice, do you have a project to share with those modifications?
The black borders is a limitation of the version implemented of the project that Will made (it is a little old)
Sure, I clean up the project a bit and share it here.
I also wanted to include smoothing next as nft tracking can be a bit shaky at times.
Awesome, thanks! Look forward to it
Here we go:
While we are at it. Is there a way to get file urls without the additional query data (id and branchID) in web play mode? That’s why the modifications to artoolkit are necessary as it can’t generate the urls for the three marker files.
If you have the asset reference, there is a https://developer.playcanvas.com/en/api/pc.Asset.html#getFileUrl function that returns the path to the file.
Is that what you are looking for?
Yes that’s how i get the URL, but the URL doesn’t end with the file but additional query data, e.g.
Arrtoolkit generates the filename extensions .fset .fset3 and .iset, which is not possible with those additional data.
getFileUrl works for exported projects but not in webmode.
Ah, yes. I see what you mean now. I’m afraid it’s not possible due to the version control system.
Could you point me to the code where it’s needed please? Maybe there’s a workaround possible?
Okay thanks, I expected as much. I implemented the workaround already by modifying artoolkit.min.js functions to accept all three separate file urls as parameters. It’s just a bit dirty. Maybe there is a better solution, like writing some separate extension script for those functions.
The workaround is need for the functions loadNFTMarker and addNFTMarker in artoolkit.min.js
Now that i think about it, another solution would be to host the marker data somewhere else. But that’s not ideal either.
Ah, is this what you are referring to? https://github.com/playcanvas/playcanvas-ar/issues/6
Indeed, that’s exactly that issue.
I’m a bit loss here, i forked @Adolar13 project and i see 3 different ways to handle the image pattern, matrix and image, but i don’t get how the other two of them works. Could you explain a bit Adolar? Tnx.
Yeah, unfortunately I think that’s the best way to do it. The way PlayCanvas Editor lays out it’s directory structure, even when published doesn’t work with library’s assuming/requiring files in the same directory.