ARKitImageTracker
- Last UpdatedDec 07, 2023
- 3 minute read
The ARKitImageTracker node finds out the position and the orientation of a 2D image in the real world. This requires pre-processed data and knowledge about the image and its real world dimension. ARKitImageTracker also has the capability to render a mesh at the detected location of the image in the real world. The position and the orientation of the mesh is updated automatically based on the position and the orientation of the detected reference image.
Multiple images can be tracked simultaneously. The reference images that need to be tracked must be copied to the module’s assets path.
Platform support
This node is supported on iOS platform only. Since this node is based on the Apple’s ARKit APIs it has the same restrictions as Apple ARKit. ARKit is only available on devices running A9 and more-powerful processors: essentially iPhone 6S and newer, iPad Pros, and iPads released no earlier than 2017.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
No support |
No support |
Full support |
No support |
No support |
|
|
|
|
|
|
Code example
This is a code example for the ARKitImageTracker node.
< ARKitImageTracker name="ar_marker_0” active="true" imagePath="image.jpg” mesh="meshName” imageWidthInMeters="0.2"/>
Fields
These are the fields for the ARKitImageTracker node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > ARKitImageTracker
|
Fields |
Type |
Use |
Default |
Description |
|---|---|---|---|---|
|
active |
sbool |
If active, the image is added to the list of images that are being tracked. If not active, the image is removed from the list of images that are currently being tracked. |
||
|
anchorIdentifier |
sstring |
Read only |
A unique identifier for the anchor. This value is assigned automatically by ARKit when an anchor is created. |
|
|
enabled |
sbool |
Optional |
true |
If enabled, the matrices for the tracked image position and orientation is updated. |
|
imagePath |
sstring |
The path to the file that will be tracked in the real world. |
||
|
imageWidthInMeters |
sfloat |
The real-world dimensions, in meters, of the image. |
||
|
localMatrix |
smatrix |
Read only |
This matrix is automatically updated by the engine. The value is set based on the position and orientation of the image and the offset matrix provided by the user. |
|
|
mesh |
sstring |
Optional |
The name of the mesh that will be rendered at the position and with the orientation of the tracked image. |
|
|
object |
sstring |
Optional |
The name of the 3D object (dummy) that will be rendered at the position and with the orientation of the tracked image. |
|
|
offsetMatrix |
smatrix |
The offset that will be applied to the mesh. This is used if the mesh has to be rendered at an offset from the tracked position or orientation of the image. |
||
|
visible |
sbool |
Read only |
Indicates whether the reference image is visible in the real world or not. |