World Tracking
World Tracking has an advanced understanding of the user's environment and thus requires an initialisation phase before users can track 3D content to their chosen point. With this tracking type, you could build a 3D model viewer that lets users walk around to view the model from different angles.
If you do not require a complex understanding of the user's environment and desire users to place content without this initialisation phase, we'd recommend using Instant World Tracking.
Creating a World Tracking experience
To create a World Tracking experience, you may customize a ready-made Project Template or add a WorldTracker
component to an existing project.
Customizing a template
When you open Mattercraft, you will be presented with a few Project Templates to help you get started.
Upon selecting a World Tracking template, your .zcomp
will display a project which includes a WorldTracker
component; as well as some simple content and basic behaviors.
You may customize any Mattercraft template like an ordinary Mattercraft project.
To learn more about getting started with Mattercraft’s templates, check out our dedicated Project Templates documentation.
Adding to an existing project
To add World Tracking to an existing project, you will first need to install a beta version of the Augmented Reality by Zappar
package from the dependencies browser if you have not already.
You can then add the WorldTracker
to your .zcomp
by using the following instructions:
- Click on the + (plus) icon in the Hierarchy (or right click on a Group Node)
- Find the
AR
component category and from here, selectWorldTracker
To use World Tracking properly, you must also add (or replace any existing camera you have in your
.zcomp
with) aZapparCamera
component. Learn more about this on our dedicated Zappar Camera article.
WorldTracker properties
The WorldTracker
has the following specific properties:
Property | Description |
---|---|
Initializing Layer Clip |
A layer clip that will be played when the world tracker is initializing; such as an animation to show the user must move their device to analyze the environment. |
Initialized Layer Clip |
A layer clip that will be played when initialization is complete and the WorldTracker is providing a valid 'ground' anchor. |
Quality Good Layer Clip |
A layer clip that will be played when the tracking quality of the WorldTracker is 'good'. In other words, there is a clear position and freedom in 3D space. |
Quality Orientation Only Layer Clip |
A layer clip that will be played when the tracking quality of the WorldTracker has reduced to 'orientation only'. In other words, it is tracking rotation only and not position in 3D space. |
Ground Anchor Group
World Trackers contain a GroundAnchorGroup
component which is used to understand and track content to a surface in your environment.
The GroundAnchorGroup
has the following specific properties:
Property | Description |
---|---|
Anchor ID |
The identifier for a particular Anchor Group. |
Show Preview At Design Time |
Show or hide the reference in the 3D Viewport. |
World Placement Group
Ground anchors should contain a World Placement Group
for the best user experience. The position of content placed in this group can be chosen by the user.
The WorldPlacementGroup
has the following specific properties:
Property | Description |
---|---|
Is Placing |
When true at runtime, the position of the contents of this component will be reset every frame to a point directly in front of the camera. |
Normalize Scale |
By default, with this parameter false the scale of the contents of this component is that of the parent component. If set to true , this component will adjust the scale based on the height of the camera above the origin. |
Face Camera |
While placing, the group will be rotated so the positive z axis points towards the camera. |
Tracking content to the environment
When your World Tracker is in the Hierarchy, you can start adding tracked content by placing components inside of the tracker's WorldPlacementGroup
.
After understanding the basics of World Tracking, you can learn more about this tracking type by exploring the following articles: