|
@@ -2,119 +2,60 @@
|
2
|
2
|
title: WebAR Demo gallery
|
3
|
3
|
---
|
4
|
4
|
|
5
|
|
-<style>
|
6
|
|
-.gallery-grid {
|
7
|
|
- display: flex;
|
8
|
|
- flex-direction: row;
|
9
|
|
- flex-wrap: wrap;
|
10
|
|
- align-items: flex-end;
|
11
|
|
- justify-content: space-evenly;
|
12
|
|
-}
|
13
|
|
-
|
14
|
|
-.gallery-item {
|
15
|
|
- text-align: center;
|
16
|
|
- padding: 0;
|
17
|
|
-}
|
18
|
|
-
|
19
|
|
-.gallery-item img {
|
20
|
|
- width: 100%;
|
21
|
|
- image-rendering: pixelated;
|
22
|
|
-}
|
23
|
|
-
|
24
|
|
-@media screen and (min-width: 600px) {
|
25
|
|
- .gallery-item {
|
26
|
|
- flex-basis: 40%;
|
27
|
|
- }
|
28
|
|
-}
|
29
|
|
-
|
30
|
|
-@media screen and (min-width: 1220px) {
|
31
|
|
- .gallery-item img {
|
32
|
|
- transition: transform 0.25s, opacity 0.25s;
|
33
|
|
- opacity: 0.9;
|
34
|
|
- }
|
35
|
|
- .gallery-item img:hover {
|
36
|
|
- transform: scale(1.125);
|
37
|
|
- opacity: 1.0;
|
38
|
|
- }
|
39
|
|
-}
|
40
|
|
-</style>
|
41
|
|
-
|
42
|
|
-# WebAR Demo gallery
|
43
|
|
-
|
44
|
|
-Here you'll find some cool examples of what you can do with MARTINS.js. Simply click on a link or scan any of the QR codes below. After opening the web pages, scan the [target image](#target-image). In addition, please read the [guidelines](#guidelines).
|
|
5
|
+# Demo gallery
|
45
|
6
|
|
46
|
|
-## Basic demos
|
|
7
|
+Please read the [guidelines](#guidelines) before you play with the demos. Feel free to remix them.
|
47
|
8
|
|
48
|
|
-The following demos will help you get started:
|
|
9
|
+## Basic demos
|
49
|
10
|
|
50
|
|
-<div class="gallery-grid" markdown>
|
51
|
|
-<div class="gallery-item" markdown>
|
52
|
|
-[](/martins-js/demos/hello-aframe){ ._blank }
|
|
11
|
+### WebAR with A-Frame
|
53
|
12
|
|
54
|
|
-**MARTINS.js with AFRAME**
|
|
13
|
+Create an augmented scene with A-Frame. This is the easiest demo to edit!
|
55
|
14
|
|
56
|
|
-[Launch demo](/martins-js/demos/hello-aframe){ ._blank } | [View the code](https://github.com/alemart/martins-js/tree/master/demos/hello-aframe){ ._blank }
|
57
|
|
-</div>
|
58
|
|
-<div class="gallery-item" markdown>
|
59
|
|
-[](/martins-js/demos/hello-three){ ._blank }
|
|
15
|
+[Launch demo](/martins-js/demos/hello-aframe/README.html){ ._blank .md-button }
|
60
|
16
|
|
61
|
|
-**MARTINS.js with THREE.js**
|
|
17
|
+### WebAR with three.js
|
62
|
18
|
|
63
|
|
-[Launch demo](/martins-js/demos/hello-three){ ._blank } | [View the code](https://github.com/alemart/martins-js/tree/master/demos/hello-three){ ._blank }
|
64
|
|
-</div>
|
65
|
|
-<div class="gallery-item" markdown>
|
66
|
|
-[](/martins-js/demos/hello-webgl){ ._blank }
|
|
19
|
+Create an augmented scene with three.js.
|
67
|
20
|
|
68
|
|
-**MARTINS.js with pure WebGL**
|
|
21
|
+[Launch demo](/martins-js/demos/hello-three/README.html){ ._blank .md-button }
|
69
|
22
|
|
70
|
|
-[Launch demo](/martins-js/demos/hello-webgl){ ._blank } | [View the code](https://github.com/alemart/martins-js/tree/master/demos/hello-webgl){ ._blank }
|
71
|
|
-</div>
|
72
|
|
-<div class="gallery-item" markdown>
|
73
|
|
-[](/martins-js/demos/touch-interaction){ ._blank }
|
|
23
|
+### WebAR with WebGL only
|
74
|
24
|
|
75
|
|
-**Touch interaction with THREE.js**
|
|
25
|
+Create an augmented scene without additional libraries. Writing WebGL code is intricate and not needed.
|
76
|
26
|
|
77
|
|
-[Launch demo](/martins-js/demos/touch-interaction){ ._blank } | [View the code](https://github.com/alemart/martins-js/tree/master/demos/touch-interaction){ ._blank }
|
78
|
|
-</div>
|
79
|
|
-</div>
|
|
27
|
+[Launch demo](/martins-js/demos/hello-webgl/README.html){ ._blank .md-button }
|
80
|
28
|
|
81
|
|
-## Minimal demos
|
|
29
|
+### Hello, world!
|
82
|
30
|
|
83
|
|
-Explore the source code with these minimalistic demos:
|
|
31
|
+A basic template to help you get started.
|
84
|
32
|
|
85
|
|
-<div class="gallery-grid" markdown>
|
86
|
|
-<div class="gallery-item" markdown>
|
87
|
|
-[](/martins-js/demos/hello-world){ ._blank }
|
|
33
|
+[Launch demo](/martins-js/demos/hello-world/README.html){ ._blank .md-button }
|
88
|
34
|
|
89
|
|
-**Hello, World!**
|
|
35
|
+## Interactive demos
|
90
|
36
|
|
91
|
|
-[Launch demo](/martins-js/demos/hello-world){ ._blank } | [View the code](https://github.com/alemart/martins-js/tree/master/demos/hello-world){ ._blank }
|
92
|
|
-</div>
|
93
|
|
-<div class="gallery-item" markdown>
|
94
|
|
-[](/martins-js/demos/simple-webcam){ ._blank }
|
|
37
|
+### Touch interaction
|
95
|
38
|
|
96
|
|
-**Simple Webcam demo**
|
|
39
|
+Have virtual elements respond to touch input.
|
97
|
40
|
|
98
|
|
-[Launch demo](/martins-js/demos/simple-webcam){ ._blank } | [View the code](https://github.com/alemart/martins-js/tree/master/demos/simple-webcam){ ._blank }
|
99
|
|
-</div>
|
100
|
|
-</div>
|
|
41
|
+[Launch demo](/martins-js/demos/touch-three/README.html){ ._blank .md-button }
|
101
|
42
|
|
102
|
43
|
## Guidelines
|
103
|
44
|
|
104
|
|
-You can use a webcam or a video file as input. Click on the 🎥 icon at the top-right corner of the screen to toggle webcam input. When using a webcam:
|
|
45
|
+For a good experience:
|
105
|
46
|
|
106
|
|
-* Avoid low-quality cameras. A camera of a typical smartphone is probably good enough.
|
107
|
47
|
* Don't move the camera nor the target image too quickly. This produces motion blur.
|
108
|
|
-* Make sure that the physical environment is properly illuminated.
|
109
|
48
|
* The target image should appear clearly in the video.
|
|
49
|
+* The physical environment should be properly illuminated.
|
110
|
50
|
* If you're scanning the image on a screen, make sure to adjust the brightness. If the screen is too bright (too dark), it will cause overexposure (underexposure) in the video and tracking difficulties - details of the images will be lost. Screen reflections are also undesirable.
|
111
|
51
|
* If you print the image, avoid shiny materials (e.g., glossy paper). They may generate artifacts in the image and interfere with the tracking. Prefer non-reflective materials.
|
|
52
|
+* Avoid low-quality cameras. Cameras of common smartphones are okay.
|
112
|
53
|
|
113
|
54
|
## Try locally
|
114
|
55
|
|
115
|
56
|
Try the demos on your own machine:
|
116
|
57
|
|
117
|
|
-1. Run on a console:
|
|
58
|
+* Run on a console:
|
118
|
59
|
|
119
|
60
|
```sh
|
120
|
61
|
git clone git@github.com:alemart/martins-js.git
|
|
@@ -122,9 +63,5 @@ cd martins-js
|
122
|
63
|
npm start
|
123
|
64
|
```
|
124
|
65
|
|
125
|
|
-2. Open [https://localhost:8000/demos/](https://localhost:8000/demos/)
|
126
|
|
-3. Pick a demo and have fun!
|
127
|
|
-
|
128
|
|
-## Target image
|
129
|
|
-
|
130
|
|
-[](./assets/my-reference-image.webp "Based on free image by ArtRose from https://pixabay.com/pt/vectors/bruxa-vassoura-gato-chap%c3%a9u-magia-5635225/"){ ._blank }
|
|
66
|
+* Open [https://localhost:8000/demos/](https://localhost:8000/demos/)
|
|
67
|
+* Pick a demo and have fun!
|