ZapWorks Studio supports Zappar's best-in-class image tracking algorithms. This makes it possible to create fully-fledged augmented reality experiences where content appears "attached" to an image as it moves around in a camera view. Images that are tracked by the app are known as targets.
Using Tracking Images
While we recommend you give this article a good read through you may also like to check out our in-depth video tutorial on Tracking Images.
Training an Image
Before an image can be tracked by the app it must be trained. During the automated training process the image is analysed from multiple angles and a target file produced. This target file contains everything the app needs to track the image.
Images can be trained from the + button on the Media Library panel. Training may take a minute or so - once complete the target file will be added to the Media Library.
Most images track well however images lacking contrast or that have rotational symmetry may not track as expected. For more information see - What makes a good tracking image?
Using a Target
Once trained, a target can be dragged into the Hierarchy.
Once in the hierarchy a preview of the target will appear in the 3D view. The icons at the bottom right of the screen can be used to move the target in the view, just as if it were being physically moved in a camera view.
Targets in the Hierarchy act like groups. Content placed inside a target will appear attached to it in the 3D view and when viewed in the app.
Targets fire events when they come into view - "seen" - and when they leave the view - "notseen".
Handlers for these events can be created by right-clicking on a target and selecting New > Script and then the event.
These events can be used to trigger animations or on-screen instructions when the user points the device away from a target image.
In this example the target content is hidden (by calling
visible(false)) when it leaves the view, and shown again when it returns.
While this is the easiest way to hide and show content, we suggest that for more polished experiences you move between visible and non-visible states with a controller as mentioned in the previous section Controllers and States. This will help to ease the transition of content gaining and losing visibility, and reduce flickering.
Zappar exposes a number of 3D coordinate systems for placing content onto target images, or the screen. The next article introduces the various 3D spaces available and demonstrates how to move content between them.