1

I've been tinkering with ARToolKit and their sample Android Studio Projects to see which one I can modify for my purpose. I opened the nftBookProj, it's the one using the pinball.jpg and then places an animated propeller plane along with a 3D axis in the origin of the image.

I noticed that the nftBookProj/nftBook/src/main/assets/DataNFT/ directory had pinball.iset, pinball.fset, and pinball.fset3 files. I then made my own image (with definite features, high resolution, high dpi and all) and then using the methods specified in this tutorial, I created my own set of reference_1.iset, reference_1.fset, reference_1.fset3 files. I then placed those 3 files in the same folder where the pinball files are.

I then checked all the activites and classes to find out the lines I have to change to make the app reference my own reference files instead of the pinball ones. It wasn't in any of the classes but I found markers.dat file under the /assets/Data/ folder and it looked like this:

# Number of markers
1

# Entries for each marker. Format is:
#
# Name of pattern file (relative to this file)
# Marker type (SINGLE)
# Marker width in millimetres (floating point number)
# Optional tokens:
#     FILTER [x]   Enable pose estimate filtering for the preceding marker
#                  x (optional) specifies the cutoff frequency. Default
#                  value is AR_FILTER_TRANS_MAT_CUTOFF_FREQ_DEFAULT, which
#                  at time of writing, equals 5.0.
# A blank line

../DataNFT/pinball
NFT
FILTER 15.0

I then changed ../DataNFT/pinball to ../DataNFT/reference_1, compiled the project, ran it on my tablet.

However, when I ran the code, it wasn't reacting to the image I made and when I checked with the pinball image, it worked. This means that I wasn't able to fully change the image it would refer to.

I then triple checked all the classes I could but I couldn't see where it indicates there that the pinball image should be used. This dead end stumps me because I no longer know where to look.

Has anyone had luck in changing the reference image in ARToolKits NFTBookProj for Android?

halfer
  • 19,824
  • 17
  • 99
  • 186
Razgriz
  • 7,179
  • 17
  • 78
  • 150

1 Answers1

1

Found it. In the nftBookApplication class, it says there that if the file(s) in the assets folder get changed, you should update the assets folder, you should also update the version code in the Manifest.

If you aren't going to upload the app to the google play store, you can just update the one on the manifest AND remove the versionCode and versionName lines in the build gradle file. If you don't, the version info in the gradle file will always override the one in the manifest. Well you can also use the version codes in the gradle file if you're okay with spending a minute or two over when you have to sync it.

Razgriz
  • 7,179
  • 17
  • 78
  • 150
  • What also helps is to remove the app from the phone after you made changes to assets directory. That causes it to be deployed completely. – Thor_Bux Nov 13 '16 at 21:01
  • Well, it might be faster during development than to change the version code every time. Also, you might not want to increase your version number each time you add a new marker but only once when you are finished with your specific feature. – Thor_Bux Nov 14 '16 at 01:46
  • If you're only changing the version code in the manifest, it's way faster than uninstalling the application. If you were changing the version code in gradle then I'd understand if you'd want to uninstall instead. – Razgriz Nov 14 '16 at 02:53
  • Got it :). I always use the gradle version path – Thor_Bux Nov 14 '16 at 03:03