Procházet zdrojové kódy

Add question to the FAQ

customisations
alemart před 1 měsícem
rodič
revize
d932cc5f19
2 změnil soubory, kde provedl 18 přidání a 1 odebrání
  1. 1
    1
      docs/api/image-tracker.md
  2. 17
    0
      docs/faq.md

+ 1
- 1
docs/api/image-tracker.md Zobrazit soubor

@@ -28,7 +28,7 @@ A new image tracker.
28 28
 **Example**
29 29
 
30 30
 ```js
31
-const imageTracker = AR.Tracker.Image({
31
+const tracker = AR.Tracker.Image({
32 32
     resolution: "sm"
33 33
 });
34 34
 ```

+ 17
- 0
docs/faq.md Zobrazit soubor

@@ -45,6 +45,23 @@ encantar.js uses a right-handed coordinate system with the Z-axis pointing "up".
45 45
 
46 46
 Yes. You can increase the [resolution of the tracker](api/image-tracker.md#instantiation), as well as the [resolution of the camera](api/camera-source.md#instantiation), using the API. You can also increase the resolution of the rendered virtual scene by setting the [resolution of the viewport](api/viewport.md#instantiation). Performance is affected by various factors such as upload times (GPU). Test your AR experience on your target devices to find a good balance between performance and increased resolution.
47 47
 
48
+## How do I know which image is detected?
49
+
50
+Add an [event listener](api/image-tracker.md#targetfound) to the Image Tracker, as in the example:
51
+
52
+```js
53
+const tracker = AR.Tracker.Image();
54
+
55
+// ...
56
+
57
+tracker.addEventListener('targetfound', event => {
58
+
59
+    // print the name of the Reference Image
60
+    console.log('Found target: ' + event.referenceImage.name);
61
+
62
+});
63
+```
64
+
48 65
 ## Any recommendations?
49 66
 
50 67
 Refer to the [recommendations](./recommendations.md).

Načítá se…
Zrušit
Uložit