@srsergio/taptapp-ar 1.0.50 β 1.0.52
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.
- package/README.md +8 -105
- package/package.json +17 -2
package/README.md
CHANGED
|
@@ -83,110 +83,8 @@ const binaryBuffer = compiler.exportData();
|
|
|
83
83
|
|
|
84
84
|
## π₯ Runtime Usage (AR Tracking)
|
|
85
85
|
|
|
86
|
-
### 1.
|
|
87
|
-
The
|
|
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:
|
|
103
|
-
|
|
104
|
-
```javascript
|
|
105
|
-
import { TaarThree } from '@srsergio/taptapp-ar';
|
|
106
|
-
|
|
107
|
-
const taarThree = new TaarThree({
|
|
108
|
-
container: document.querySelector("#container"),
|
|
109
|
-
imageTargetSrc: './targets.taar',
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
const {renderer, scene, camera} = taarThree;
|
|
113
|
-
|
|
114
|
-
const anchor = taarThree.addAnchor(0);
|
|
115
|
-
// Add your 3D models to anchor.group
|
|
116
|
-
|
|
117
|
-
await taarThree.start();
|
|
118
|
-
renderer.setAnimationLoop(() => {
|
|
119
|
-
renderer.render(scene, camera);
|
|
120
|
-
});
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### 3. Raw Controller (Advanced & Custom Engines)
|
|
124
|
-
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
|
-
|
|
126
|
-
#### βοΈ Controller Configuration
|
|
127
|
-
| Property | Default | Description |
|
|
128
|
-
| :--- | :--- | :--- |
|
|
129
|
-
| `inputWidth` | **Required** | The width of the video or image source. |
|
|
130
|
-
| `inputHeight` | **Required** | The height of the video or image source. |
|
|
131
|
-
| `maxTrack` | `1` | Max number of images to track simultaneously. |
|
|
132
|
-
| `warmupTolerance` | `5` | Frames of consistent detection needed to "lock" a target. |
|
|
133
|
-
| `missTolerance` | `5` | Frames of missed detection before considering the target "lost". |
|
|
134
|
-
| `filterMinCF` | `0.001` | Min cutoff frequency for the OneEuroFilter (reduces jitter). |
|
|
135
|
-
| `filterBeta` | `1000` | Filter beta parameter (higher = more responsive, lower = smoother). |
|
|
136
|
-
| `onUpdate` | `null` | Callback for tracking events (Found, Lost, ProcessDone). |
|
|
137
|
-
| `debugMode` | `false` | If true, returns extra debug data (cropped images, feature points). |
|
|
138
|
-
| `worker` | `null` | Pass a custom worker instance if using a specialized environment. |
|
|
139
|
-
|
|
140
|
-
#### π Example: Tracking a Video Stream
|
|
141
|
-
Ideal for real-time AR apps in the browser:
|
|
142
|
-
|
|
143
|
-
```javascript
|
|
144
|
-
import { Controller } from '@srsergio/taptapp-ar';
|
|
145
|
-
|
|
146
|
-
const controller = new Controller({
|
|
147
|
-
inputWidth: video.videoWidth,
|
|
148
|
-
inputHeight: video.videoHeight,
|
|
149
|
-
onUpdate: (data) => {
|
|
150
|
-
if (data.type === 'updateMatrix') {
|
|
151
|
-
const { targetIndex, worldMatrix } = data;
|
|
152
|
-
if (worldMatrix) {
|
|
153
|
-
console.log(`Target ${targetIndex} detected! Matrix:`, worldMatrix);
|
|
154
|
-
// Apply worldMatrix (Float32Array[16]) to your 3D object
|
|
155
|
-
} else {
|
|
156
|
-
console.log(`Target ${targetIndex} lost.`);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
// Single target
|
|
163
|
-
await controller.addImageTargets('./targets.taar');
|
|
164
|
-
|
|
165
|
-
// OR multiple targets from different .taar files
|
|
166
|
-
await controller.addImageTargets(['./target1.taar', './target2.taar', './target3.taar']);
|
|
167
|
-
controller.processVideo(videoElement); // Starts the internal RAF loop
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
#### πΈ Example: One-shot Image Matching
|
|
171
|
-
Use this for "Snap and Detect" features without a continuous video loop:
|
|
172
|
-
|
|
173
|
-
```javascript
|
|
174
|
-
const controller = new Controller({ inputWidth: 1024, inputHeight: 1024 });
|
|
175
|
-
await controller.addImageTargets('./targets.taar');
|
|
176
|
-
|
|
177
|
-
// 1. Detect features in a static image
|
|
178
|
-
const { featurePoints } = await controller.detect(canvasElement);
|
|
179
|
-
|
|
180
|
-
// 2. Attempt to match against a specific target index
|
|
181
|
-
const { targetIndex, modelViewTransform } = await controller.match(featurePoints, 0);
|
|
182
|
-
|
|
183
|
-
if (targetIndex !== -1) {
|
|
184
|
-
// Found a match! Use modelViewTransform for initial pose estimation
|
|
185
|
-
}
|
|
186
|
-
```
|
|
187
|
-
|
|
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.
|
|
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.
|
|
190
88
|
|
|
191
89
|
```javascript
|
|
192
90
|
import { SimpleAR } from '@srsergio/taptapp-ar';
|
|
@@ -205,7 +103,7 @@ await ar.start();
|
|
|
205
103
|
ar.stop();
|
|
206
104
|
```
|
|
207
105
|
|
|
208
|
-
#### π Minimal HTML
|
|
106
|
+
#### π Minimal HTML Example
|
|
209
107
|
```html
|
|
210
108
|
<div id="ar-container" style="width: 100vw; height: 100vh;">
|
|
211
109
|
<img id="my-overlay" src="./overlay.png"
|
|
@@ -238,6 +136,11 @@ ar.stop();
|
|
|
238
136
|
|
|
239
137
|
---
|
|
240
138
|
|
|
139
|
+
### π Advanced Usage
|
|
140
|
+
For **A-Frame**, **Three.js**, or **Raw Controller** usage, please refer to the [Advanced Usage Documentation](./docs/advanced-usage.md).
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
241
144
|
## ποΈ Protocol V7 (Moonshot Packed Format)
|
|
242
145
|
TapTapp AR uses a proprietary **Moonshot Vision Codec** that is significantly more efficient than standard AR formats.
|
|
243
146
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@srsergio/taptapp-ar",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.52",
|
|
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
|
+
"keywords": [
|
|
6
|
+
"web-ar",
|
|
7
|
+
"augmented-reality",
|
|
8
|
+
"image-tracking",
|
|
9
|
+
"ar-compiler",
|
|
10
|
+
"computer-vision",
|
|
11
|
+
"three-js",
|
|
12
|
+
"react-ar",
|
|
13
|
+
"a-frame",
|
|
14
|
+
"mind-ar",
|
|
15
|
+
"offline-ar",
|
|
16
|
+
"webgl",
|
|
17
|
+
"markerless-tracking",
|
|
18
|
+
"taptapp"
|
|
19
|
+
],
|
|
5
20
|
"repository": {
|
|
6
21
|
"type": "git",
|
|
7
22
|
"url": "git+https://github.com/srsergiolazaro/taptapp-ar.git"
|