This is generally a feature called “Extended Tracking” and is something we’re working on bringing to Studio soon through an easy-to-use subsymbol to sit alongside the ground placement one.
It’s not quite ready yet, but as you asked so nicely here’s a zapcode that shows it in action (as a PDF so it can definitely be printed at 100% scale) and the zpp that I published to it:
extended-demo-75mm.pdf (7.7 KB)
ZapcodeExtendedTracking-Demo.zpp (780.9 KB)
This demo uses zapcode tracking, with an assumption the code is horizontal. Zapcode tracking is convenient for the extended tracking use case as detection can work when the code is much smaller in the camera view than an image tracked target. You can go into the symbol and delete the circle-likely-horiz.zpt file and train your own tracking image if you want (you’ll then get a red squiggly underline in the targetFinder script that shows where you’ll need to swap the zpt path for your target).
It’s important to set the
Target Scale referenced property in the parent symbol. This should is the size in meters of 1 target unit (half the target height). For the demo PDF the zapcode is 75mm in diameter, so this is set to 0.0375 in the demo scene.
You can also set the
Target Identifier referenced property to lock tracking to a particular zapcode. If this is blank it will lock on to the first code it sees (and show in the debug log the identifier for that code).
Essentially this uses a
TriggerRegion to identify the position of the target in relative to the camera (why it is important to set the scale correctly so the distance to the target is measured in meters). It updates a world tracking anchor whenever the target is seen, along with applying some additional smoothing. The “up” direction is always from the world tracker, so will be vertical. The rotation around that “up” axis is driven by the target though - the content group’s X axis will be aligned with the target X axis (again with some more smoothing).
There are 3 different ways the tracking can work:
- Full world-tracking devices: Updates a custom anchor in a
Z.WorldTracker, allows full movement when the target is not seen.
- Gyro-devices: Still updates a custom anchor in a world tracker, but when target is not seen only the orientation of the device (driven by the gyro) will be updated.
- Non-gyro devices (low-end android phones): Doesn’t use a world tracker at all, just uses visual tracking. Does add some additional smoothing though. When target is lost it will just remain on the screen at the last seen position.
The subsymbol should manage all this complexity for you, and just exposes a single state for the tracking quality. If this is
not_seen then you probably want to fade out the content group and ask the user to point back towards the target.
There are some app-level changes that will improve how well this works in the next Zappar app update; the details aren’t massively important but it is certainly a use-case we have in mind and are trying to optimise for.
Happy experimenting, and let us know how you get on!