This class provides methods to query the status of a trackable surface. Anchors are attached to a trackable.
A unique string ID for the trackable.
It returns the pose matrix associated to this trackable.
Applies the pose matrix to the scene.
Returns the list of points [x0, z0, x1, z1...] defining the current boundary of the trackable (it can change from frame to frame).
Returns the total extent of the trackable along X.
Returns the total extent of the trackable along Y
Returns the total extent of the trackable along Z
Returns true if the trackable is selected.
Returns true if this is a trackable detected in the last frame.
Returns true if the trackable is being tracked.
Returns true if the tracking of this trackable is currently paused.
Returns true if the tracking of this trackable is stopped, if so, the trackable will be automatically removed in the next frame.
Returns true if the trackable is a plane.
Returns true if the trackable is a point cloud.
Returns true if the trackable is a floor plane.
Returns true if the trackable is a ceiling plane.
Returns true if the trackable is a wall plane.
import processing.ar.*;
ARTracker tracker;
void setup() {
fullScreen(AR);
tracker = new ARTracker(this);
tracker.start();
}
void draw() {
lights();
// Draw trackable planes
for (int i = 0; i < tracker.count(); i++) {
ARTrackable trackable = tracker.get(i);
if (!trackable.isTracking()) continue;
pushMatrix();
trackable.transform();
if (mousePressed && trackable.isSelected(mouseX, mouseY)) {
fill(255, 0, 0, 100);
} else {
fill(255, 100);
}
beginShape(QUADS);
float lx = trackable.lengthX();
float lz = trackable.lengthZ();
vertex(-lx/2, 0, -lz/2);
vertex(-lx/2, 0, +lz/2);
vertex(+lx/2, 0, +lz/2);
vertex(+lx/2, 0, -lz/2);
endShape();
popMatrix();
}
}