You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example demonstrates how to load and track a pattern marker using the ARToolKit plugin.
4
+
5
+
## Setup Instructions
6
+
7
+
### 1. Install Dependencies
8
+
9
+
From the repository root, install the dependencies:
10
+
11
+
```bash
12
+
npm install
13
+
```
14
+
15
+
### 2. Serve the Example
16
+
17
+
You need to serve the example through a local web server because the Worker and ES modules require proper MIME types. You can use any static file server. Here are a few options:
18
+
19
+
#### Option A: Using Python (if installed)
20
+
21
+
```bash
22
+
# From repository root
23
+
python3 -m http.server 8080
24
+
```
25
+
26
+
Then open: http://localhost:8080/examples/simple-marker/index.html
27
+
28
+
#### Option B: Using Node.js http-server
29
+
30
+
```bash
31
+
# Install http-server globally if not already installed
32
+
npm install -g http-server
33
+
34
+
# From repository root
35
+
http-server -p 8080
36
+
```
37
+
38
+
Then open: http://localhost:8080/examples/simple-marker/index.html
39
+
40
+
#### Option C: Using VS Code Live Server
41
+
42
+
If you're using VS Code with the Live Server extension:
43
+
1. Right-click on `index.html`
44
+
2. Select "Open with Live Server"
45
+
46
+
### 3. Using the Example
47
+
48
+
1. Once the page loads, you'll see "Initializing..." status
49
+
2. Wait for the worker to be ready (status will change to "Worker ready")
50
+
3. Click the "Load Marker" button to load the Hiro pattern marker
51
+
4. Watch the event log to see the marker loading process
52
+
53
+
## What's Happening
54
+
55
+
The example demonstrates:
56
+
57
+
1.**Plugin Initialization**: Creating and initializing the ArtoolkitPlugin
58
+
2.**Worker Communication**: The plugin starts a Web Worker for marker detection
59
+
3.**Pattern Loading**: When you click "Load Marker", it calls `plugin.loadMarker()` with:
0 commit comments