Hi, I'm kinda new to Vuforia / Unity.
I have a problem : I need my RA app to be able to be told what size is my marker.
For example, I uploaded my Target saying it's 50 units wide.
Wether I see this target printed as a 50mm wide image or a 100mm wide image, Unity will get this as being 50 units wide.
What I want is to be able to go through an input and say "now, this target is 100 units wide".
Then, wether I see this target printed as a 50mm wide image or a 100mm wide image, Unity should get this as being 100 units wide.
How can I do that?
Simple tool to see if it works properly :
I've created a mesh to create a frame around my ImageTarget. This frame is a child of my Image Target Game Object.
Attempt 1 [Failed]:
I've tried to simply scale the Image Target Game Object to have a width of 100 units, I figured that when the camera would detect the image target, it would recognize it as being 100 units wide and, as usual, draw my frame around it.
Instead of that, it drawed my frame AS IF my printed target was twice bigger.
From what I understood with that, I guessed that the initial value of 50 is stored somewhere else, but I don't know where, and I don't know if I can change it at runtime.
That would explain why, when the camera detects my printed image targets, it creates (without drawing) the Image Target Game Object twice bigger on top of it, with all it's children (that are drawn as opposed to their parent !)
Any help (or explanation if my deductions aren't on point) is welcome here :)
Well, it seems the code I found needed some foolproofing, as I'm fool enough to fall in the only trap it had for me !
Long story short, I was only checking that I was getting a null on Vuforia's virtual preview. Wich is absolutely normal : it seems the Trackers are all null when using only a preview as there is no point trying to see real items when playing my app on a pure virtual context !
I eventually ended up with "Disable Vuforia Play" checkbox unchecked (on ARCamera -> Web Cam Behaviour) after switching through a couple versions of Unity (function that I didn't know even exist !) and realized I wasn't getting a null value when using an actual camera. Since my app is designed for Android (and getting Debug.Log outputs on Android is a mess...) and since I usually get stuff working better on Unity previews than on actual Android runtime, I figured that having null on Unity couldn't lead to better luck on Android...
Anyway, if other fools like me somehow ends up here, since I have the foolproof code, I might as well share it ;)