ARCoreImageTracker
- Last UpdatedDec 07, 2023
- 3 minute read
The ARCoreImageTracker node determines 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. ARCoreImageTracker 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 are 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.
The ARCoreImageTracker node needs an ARCoreManager node to have active ARSession to track images.
Platform support
This node is supported on Android only. Since this node is based on Android ARCore SDK, devices that support ARCore by Google Play Store or by separate downloadable Google Play Services for AR (Android China devices) support this node also.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
No support |
No support |
No support |
Full support |
No support |
|
|
|
|
|
|
Code example
This is a code example for the ARCoreImageTracker node.
< ARCoreImageTracker name="ar_marker_0” active="true" imagePath="image.jpg” mesh="meshName” imageWidthInMeters="0.2"/>
Fields
These are the fields for the ARCoreImageTracker node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > ARCoreImageTracker
|
Field |
Type |
Use |
Default |
Description |
|---|---|---|---|---|
|
active |
sbool |
Optional |
false |
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. |
|
enabled |
sbool |
Optional |
true |
If enabled, the matrices for the tracked image position and orientation are updated. |
|
imagePath |
sstring |
Mandatory |
The path to the file that will be tracked in the real world. |
|
|
imageWidthInMeters |
sfloat |
Optional |
0 |
The real-world dimensions, in meters, of the image. |
|
localMatrix |
smatrix |
Readonly |
Internally calculated |
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 |
Specifies the name of 3D object (dummy) that is transformed on the tracked image. |
|
|
offsetMatrix |
smatrix |
Optional |
Identity Matrix |
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 |
Readonly |
Internally calculated |
Indicates whether the reference image is visible in the real world or not. |