@srsergio/taptapp-ar 1.0.10 โ 1.0.11
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 +74 -49
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# @srsergio/taptapp-ar
|
|
2
2
|
|
|
3
|
-
๐ **TapTapp AR** is a high-performance Augmented Reality (AR)
|
|
3
|
+
๐ **TapTapp AR** is a high-performance Augmented Reality (AR) toolkit for **Node.js** and **Browser** environments. It provides an ultra-fast offline compiler and a lightweight runtime for image tracking.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**100% Pure JavaScript**: This package is now completely independent of **TensorFlow.js** for both compilation and real-time tracking, resulting in massive performance gains and zero-latency initialization.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## ๐ Key Features
|
|
10
10
|
|
|
11
|
-
- ๐ผ๏ธ **
|
|
12
|
-
- โก **
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
- ๐ฆ **
|
|
11
|
+
- ๐ผ๏ธ **Hyper-Fast Compiler**: Pure JavaScript compiler that generates `.mind` files in **< 0.9s per image**.
|
|
12
|
+
- โก **No TensorFlow Dependency**: No TFJS at all. Works natively in any JS environment (Node, Browser, Workers).
|
|
13
|
+
- ๐ **Protocol V3 (Columnar Binary)**: Zero-copy loading with 80%+ smaller files and CPU-cache alignment.
|
|
14
|
+
- ๐งต **Optimized Runtime**: Tracking engine with **Buffer Recycling** and **Zero-Copy** for smooth 60fps AR on low-end devices.
|
|
15
|
+
- ๐ฆ **Framework Agnostic**: Includes wrappers for **A-Frame**, **Three.js**, and a raw **Controller** for custom engines.
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
@@ -22,79 +22,104 @@ Built with performance in mind, this package features a **pure JavaScript offlin
|
|
|
22
22
|
npm install @srsergio/taptapp-ar
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
### ๐ฆ Optional Dependencies
|
|
26
|
-
|
|
27
|
-
> **Note:** TensorFlow is **NOT required** for the offline compiler. It only uses pure JavaScript.
|
|
28
|
-
|
|
29
25
|
---
|
|
30
26
|
|
|
31
|
-
##
|
|
32
|
-
|
|
33
|
-
TaptApp AR features the industry's most advanced **pure JavaScript** offline compiler. With the introduction of **Protocol V3 (Columnar Binary Format)**, it sets a new standard for AR asset management.
|
|
27
|
+
## ๐ Industry-Leading Benchmarks (v3)
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
| Metric | Official MindAR | TapTapp AR (v3) | Improvement |
|
|
29
|
+
| Metric | Official MindAR | TapTapp AR | Improvement |
|
|
38
30
|
| :--- | :--- | :--- | :--- |
|
|
39
|
-
| **Compilation Time** | ~23.50s | **~
|
|
31
|
+
| **Compilation Time** | ~23.50s | **~0.89s** | ๐ **26x Faster** |
|
|
40
32
|
| **Output Size (.mind)** | ~770 KB | **~127 KB** | ๐ **83.5% Smaller** |
|
|
41
|
-
| **
|
|
42
|
-
| **
|
|
43
|
-
|
|
44
|
-
> *Tested on 1024x1024 high-detail image target.*
|
|
45
|
-
|
|
46
|
-
### ๐ Key Technical Breakthroughs
|
|
33
|
+
| **Tracking Latency** | Variable (TFJS) | **Constant (Pure JS)** | โก **Stable 60fps** |
|
|
34
|
+
| **Dependency Size** | ~20MB (TFJS) | **< 100KB** | ๐ฆ **99% Smaller Bundle** |
|
|
47
35
|
|
|
48
|
-
|
|
49
|
-
- **Zero-Copy Loading**: The runtime reads directly from the binary buffer. Initialization is now virtualy instant.
|
|
50
|
-
- **Aggressive Matching Optimization**: Tree-based hierarchical clustering compacted into a flattened binary format.
|
|
51
|
-
- **No Dependencies**: Works in Node.js and Browser with zero external requirements for the compilation core.
|
|
36
|
+
---
|
|
52
37
|
|
|
53
|
-
|
|
38
|
+
## ๐ผ๏ธ Compiler Usage (Node.js & Web)
|
|
54
39
|
|
|
55
|
-
|
|
40
|
+
The compiler is designed to run in workers (Node.js or Browser) for maximum performance.
|
|
56
41
|
|
|
57
42
|
```javascript
|
|
58
43
|
import { OfflineCompiler } from '@srsergio/taptapp-ar';
|
|
59
44
|
|
|
60
45
|
const compiler = new OfflineCompiler();
|
|
61
46
|
|
|
62
|
-
// Compile target image
|
|
63
|
-
|
|
47
|
+
// Compile target image (provide grayscale pixel data)
|
|
48
|
+
await compiler.compileImageTargets(
|
|
64
49
|
[{ width, height, data: grayscaleUint8Array }],
|
|
65
50
|
(progress) => console.log(`Compiling: ${progress}%`)
|
|
66
51
|
);
|
|
67
52
|
|
|
68
|
-
// Export to
|
|
69
|
-
const binaryBuffer = compiler.exportData();
|
|
53
|
+
// Export to high-efficiency binary format
|
|
54
|
+
const binaryBuffer = compiler.exportData();
|
|
70
55
|
```
|
|
71
56
|
|
|
72
|
-
|
|
57
|
+
---
|
|
73
58
|
|
|
74
|
-
|
|
75
|
-
import { OfflineCompiler } from '@srsergio/taptapp-ar';
|
|
59
|
+
## ๐ฅ Runtime Usage (AR Tracking)
|
|
76
60
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
61
|
+
### 1. Simple A-Frame Integration
|
|
62
|
+
The easiest way to use TapTapp AR in a web app:
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
|
|
66
|
+
<script src="path/to/@srsergio/taptapp-ar/dist/index.js"></script>
|
|
67
|
+
|
|
68
|
+
<a-scene mindar-image="imageTargetSrc: ./targets.mind;">
|
|
69
|
+
<a-camera position="0 0 0" look-controls="enabled: false"></a-camera>
|
|
70
|
+
<a-entity mindar-image-target="targetIndex: 0">
|
|
71
|
+
<a-plane position="0 0 0" height="0.552" width="1"></a-plane>
|
|
72
|
+
</a-entity>
|
|
73
|
+
</a-scene>
|
|
80
74
|
```
|
|
81
75
|
|
|
82
|
-
|
|
76
|
+
### 2. High-Performance Three.js Wrapper
|
|
77
|
+
For custom Three.js applications:
|
|
83
78
|
|
|
84
|
-
|
|
79
|
+
```javascript
|
|
80
|
+
import { MindARThree } from '@srsergio/taptapp-ar';
|
|
85
81
|
|
|
86
|
-
|
|
87
|
-
#
|
|
88
|
-
|
|
82
|
+
const mindarThree = new MindARThree({
|
|
83
|
+
container: document.querySelector("#container"),
|
|
84
|
+
imageTargetSrc: './targets.mind',
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const {renderer, scene, camera} = mindarThree;
|
|
89
88
|
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
const anchor = mindarThree.addAnchor(0);
|
|
90
|
+
// Add your 3D models to anchor.group
|
|
91
|
+
|
|
92
|
+
await mindarThree.start();
|
|
93
|
+
renderer.setAnimationLoop(() => {
|
|
94
|
+
renderer.render(scene, camera);
|
|
95
|
+
});
|
|
92
96
|
```
|
|
93
97
|
|
|
94
|
-
|
|
98
|
+
### 3. Raw Controller (Custom Logic)
|
|
99
|
+
Use the `Controller` directly for maximum control:
|
|
100
|
+
|
|
101
|
+
```javascript
|
|
102
|
+
import { Controller } from '@srsergio/taptapp-ar';
|
|
103
|
+
|
|
104
|
+
const controller = new Controller({
|
|
105
|
+
inputWidth: 640,
|
|
106
|
+
inputHeight: 480,
|
|
107
|
+
onUpdate: (data) => {
|
|
108
|
+
if (data.type === 'updateMatrix') {
|
|
109
|
+
// worldMatrix found! Apply to your 3D engine
|
|
110
|
+
const { targetIndex, worldMatrix } = data;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
await controller.addImageTargets('./targets.mind');
|
|
116
|
+
controller.processVideo(videoElement);
|
|
117
|
+
```
|
|
95
118
|
|
|
96
119
|
---
|
|
97
120
|
|
|
98
|
-
## ๐ License
|
|
121
|
+
## ๐ License & Credits
|
|
99
122
|
|
|
100
123
|
MIT ยฉ [srsergiolazaro](https://github.com/srsergiolazaro)
|
|
124
|
+
|
|
125
|
+
Based on the core research of MindAR, but completely re-written for high-performance binary processing and JS-only execution.
|