@srsergio/taptapp-ar 1.0.51 β†’ 1.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +47 -79
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -83,44 +83,60 @@ const binaryBuffer = compiler.exportData();
83
83
 
84
84
  ## πŸŽ₯ Runtime Usage (AR Tracking)
85
85
 
86
- ### 1. Simple A-Frame Integration
87
- The easiest way to use TapTapp AR in a web app:
88
-
89
- ```html
90
- <script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
91
- <script src="path/to/@srsergio/taptapp-ar/dist/index.js"></script>
92
-
93
- <a-scene taar-image="imageTargetSrc: ./targets.taar;">
94
- <a-camera position="0 0 0" look-controls="enabled: false"></a-camera>
95
- <a-entity taar-image-target="targetIndex: 0">
96
- <a-plane position="0 0 0" height="0.552" width="1"></a-plane>
97
- </a-entity>
98
- </a-scene>
99
- ```
100
-
101
- ### 2. High-Performance Three.js Wrapper
102
- For custom Three.js applications:
86
+ ### 1. SimpleAR (Recommended) 🍦
87
+ The **simplest way** to use ARβ€”no Three.js or A-Frame required. Just overlay an HTML element on the tracked target.
103
88
 
104
89
  ```javascript
105
- import { TaarThree } from '@srsergio/taptapp-ar';
90
+ import { SimpleAR } from '@srsergio/taptapp-ar';
106
91
 
107
- const taarThree = new TaarThree({
108
- container: document.querySelector("#container"),
109
- imageTargetSrc: './targets.taar',
92
+ const ar = new SimpleAR({
93
+ container: document.getElementById('ar-container'),
94
+ targetSrc: './my-target.taar', // Single URL or array: ['./a.taar', './b.taar']
95
+ overlay: document.getElementById('my-overlay'),
96
+ onFound: ({ targetIndex }) => console.log(`Target ${targetIndex} detected! 🎯`),
97
+ onLost: ({ targetIndex }) => console.log(`Target ${targetIndex} lost πŸ‘‹`)
110
98
  });
111
99
 
112
- const {renderer, scene, camera} = taarThree;
100
+ await ar.start();
101
+
102
+ // When done:
103
+ ar.stop();
104
+ ```
113
105
 
114
- const anchor = taarThree.addAnchor(0);
115
- // Add your 3D models to anchor.group
106
+ #### πŸ“ Minimal HTML Example
107
+ ```html
108
+ <div id="ar-container" style="width: 100vw; height: 100vh;">
109
+ <img id="my-overlay" src="./overlay.png"
110
+ style="opacity: 0; z-index: 1; width: 200px; transition: opacity 0.3s;" />
111
+ </div>
116
112
 
117
- await taarThree.start();
118
- renderer.setAnimationLoop(() => {
119
- renderer.render(scene, camera);
120
- });
113
+ <script type="module">
114
+ import { SimpleAR } from '@srsergio/taptapp-ar';
115
+
116
+ const ar = new SimpleAR({
117
+ container: document.getElementById('ar-container'),
118
+ targetSrc: './targets.taar',
119
+ overlay: document.getElementById('my-overlay'),
120
+ });
121
+
122
+ ar.start();
123
+ </script>
121
124
  ```
122
125
 
123
- ### 3. Raw Controller (Advanced & Custom Engines)
126
+ #### βš™οΈ SimpleAR Options
127
+ | Option | Required | Description |
128
+ | :--- | :--- | :--- |
129
+ | `container` | βœ… | DOM element where video + overlay render |
130
+ | `targetSrc` | βœ… | URL to your `.taar` file |
131
+ | `overlay` | βœ… | DOM element to position on the target |
132
+ | `onFound` | ❌ | Callback when target is detected |
133
+ | `onLost` | ❌ | Callback when target is lost |
134
+ | `onUpdate` | ❌ | Called each frame with `{ targetIndex, worldMatrix }` |
135
+ | `cameraConfig` | ❌ | Camera constraints (default: `{ facingMode: 'environment', width: 1280, height: 720 }`) |
136
+
137
+ ---
138
+
139
+ ### 2. Raw Controller (Advanced & Custom Engines)
124
140
  The `Controller` is the core engine of TapTapp AR. You can use it to build your own AR components or integrate tracking into custom 3D engines.
125
141
 
126
142
  #### βš™οΈ Controller Configuration
@@ -185,56 +201,8 @@ if (targetIndex !== -1) {
185
201
  }
186
202
  ```
187
203
 
188
- ### 4. Vanilla JS (No Framework) 🍦
189
- The **simplest way** to use ARβ€”no Three.js, no A-Frame. Just overlay an image on the tracked target.
190
-
191
- ```javascript
192
- import { SimpleAR } from '@srsergio/taptapp-ar';
193
-
194
- const ar = new SimpleAR({
195
- container: document.getElementById('ar-container'),
196
- targetSrc: './my-target.taar', // Single URL or array: ['./a.taar', './b.taar']
197
- overlay: document.getElementById('my-overlay'),
198
- onFound: ({ targetIndex }) => console.log(`Target ${targetIndex} detected! 🎯`),
199
- onLost: ({ targetIndex }) => console.log(`Target ${targetIndex} lost πŸ‘‹`)
200
- });
201
-
202
- await ar.start();
203
-
204
- // When done:
205
- ar.stop();
206
- ```
207
-
208
- #### πŸ“ Minimal HTML
209
- ```html
210
- <div id="ar-container" style="width: 100vw; height: 100vh;">
211
- <img id="my-overlay" src="./overlay.png"
212
- style="opacity: 0; z-index: 1; width: 200px; transition: opacity 0.3s;" />
213
- </div>
214
-
215
- <script type="module">
216
- import { SimpleAR } from '@srsergio/taptapp-ar';
217
-
218
- const ar = new SimpleAR({
219
- container: document.getElementById('ar-container'),
220
- targetSrc: './targets.taar',
221
- overlay: document.getElementById('my-overlay'),
222
- });
223
-
224
- ar.start();
225
- </script>
226
- ```
227
-
228
- #### βš™οΈ SimpleAR Options
229
- | Option | Required | Description |
230
- | :--- | :--- | :--- |
231
- | `container` | βœ… | DOM element where video + overlay render |
232
- | `targetSrc` | βœ… | URL to your `.taar` file |
233
- | `overlay` | βœ… | DOM element to position on the target |
234
- | `onFound` | ❌ | Callback when target is detected |
235
- | `onLost` | ❌ | Callback when target is lost |
236
- | `onUpdate` | ❌ | Called each frame with `{ targetIndex, worldMatrix }` |
237
- | `cameraConfig` | ❌ | Camera constraints (default: `{ facingMode: 'environment', width: 1280, height: 720 }`) |
204
+ ### πŸ“š Legacy Usage
205
+ For **A-Frame** or **Three.js** wrappers, please refer to the [Advanced Usage Documentation](./docs/advanced-usage.md).
238
206
 
239
207
  ---
240
208
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@srsergio/taptapp-ar",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
4
4
  "description": "Ultra-fast, lightweight Augmented Reality Image Tracking SDK for the web. Features an optimized offline compiler, React components, and compatibility with Three.js/A-Frame. No heavy ML frameworks required.",
5
5
  "keywords": [
6
6
  "web-ar",