WebXR Marker Tracking Module: Difference between revisions

From WebXR Wiki
Jump to navigation Jump to search
(Add boilerplate information)
 
(Add short summary and WebIDL)
 
Line 6: Line 6:
  |group = CG
  |group = CG
}}
}}
The WebXR Marker Tracking module expands the [[WebXR Device API]] with functionality to detect 2D images from a specified set and track their poses in the real world.
==WebIDL==
<syntaxhighlight lang="idl">
dictionary XRTrackedImageInit {
  required ImageBitmap image;
  required float widthInMeters;
};
partial dictionary XRSessionInit {
  sequence<XRTrackedImageInit> trackedImages;
};
enum XRImageTrackability {
  "untrackable",
  "trackable",
};
partial interface XRSession {
  Promise<FrozenArray<XRImageTrackability>> getImageTrackability();
};
enum XRImageTrackingState {
  "untracked",
  "tracked",
  "emulated",
};
[SecureContext, Exposed=Window]
interface XRImageTrackingResult {
  [SameObject] readonly attribute XRSpace imageSpace;
  readonly attribute unsigned long index;
  readonly attribute XRImageTrackingState trackingState;
  readonly attribute float measuredWidthInMeters;
};
partial interface XRFrame {
  FrozenArray<XRImageTrackingResult> getImageTrackingResults();
};
</syntaxhighlight>


== External Links ==
== External Links ==

Latest revision as of 00:59, 1 March 2023

WebXR Marker Tracking Module
StatusCG-REPORT
Last Updated2 July 2021
Editor(s)Klaus Weidner
CG or WG?CG

The WebXR Marker Tracking module expands the WebXR Device API with functionality to detect 2D images from a specified set and track their poses in the real world.

WebIDL[edit]

dictionary XRTrackedImageInit {
  required ImageBitmap image;
  required float widthInMeters;
};

partial dictionary XRSessionInit {
  sequence<XRTrackedImageInit> trackedImages;
};

enum XRImageTrackability {
  "untrackable",
  "trackable",
};

partial interface XRSession {
  Promise<FrozenArray<XRImageTrackability>> getImageTrackability();
};

enum XRImageTrackingState {
  "untracked",
  "tracked",
  "emulated",
};

[SecureContext, Exposed=Window]
interface XRImageTrackingResult {
  [SameObject] readonly attribute XRSpace imageSpace;
  readonly attribute unsigned long index;
  readonly attribute XRImageTrackingState trackingState;
  readonly attribute float measuredWidthInMeters;
};

partial interface XRFrame {
  FrozenArray<XRImageTrackingResult> getImageTrackingResults();
};

External Links[edit]