Преглед на файлове

Simplify docs

customisations
alemart преди 1 година
родител
ревизия
0137f0fe31

+ 0
- 29
demos/assets/demo.css Целия файл

@@ -1,29 +0,0 @@
1
-body {
2
-    background-color: #3d5afe;
3
-}
4
-
5
-#scan {
6
-    width: 100%;
7
-    height: 100%;
8
-    object-fit: contain;
9
-    opacity: 0.75;
10
-}
11
-
12
-#toggle-webcam {
13
-    display: inline-block;
14
-    width: 64px;
15
-    height: 64px;
16
-
17
-    border: 0;
18
-    font-size: 36px;
19
-    color: #fff;
20
-    background: rgba(61, 90, 254, 0.8);
21
-
22
-    position: absolute;
23
-    right: 0;
24
-    top: 0;
25
-}
26
-
27
-#toggle-webcam:hover {
28
-    cursor: pointer;
29
-}

+ 0
- 72
demos/simple-webcam/demo.js Целия файл

@@ -1,72 +0,0 @@
1
-/**
2
- * @file MARTINS.js WebAR: Simple Webcam demo
3
- * @version 1.0.2
4
- * @author Alexandre Martins (https://github.com/alemart)
5
- * @license LGPL-3.0-or-later
6
- */
7
-
8
-window.addEventListener('load', async function() {
9
-    try {
10
-        const session = await startARSession();
11
-
12
-        function animate(time, frame)
13
-        {
14
-            session.requestAnimationFrame(animate);
15
-        }
16
-
17
-        session.requestAnimationFrame(animate);
18
-    }
19
-    catch(error) {
20
-        alert(error.message);
21
-    }
22
-
23
-    async function startARSession()
24
-    {
25
-        if(!Martins.isSupported()) {
26
-            throw new Error(
27
-                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
28
-                'Your user agent is ' + navigator.userAgent
29
-            );
30
-        }
31
-
32
-        //Martins.Settings.powerPreference = 'low-power';
33
-
34
-        const tracker = Martins.Tracker.ImageTracker();
35
-        await tracker.database.add([{
36
-            name: 'my-reference-image',
37
-            image: document.getElementById('my-reference-image')
38
-        }]);
39
-
40
-        const viewport = Martins.Viewport({
41
-            container: document.getElementById('ar-viewport'),
42
-            hudContainer: document.getElementById('ar-hud')
43
-        });
44
-
45
-        const source = Martins.Source.Camera({
46
-            resolution: 'md'
47
-        });
48
-
49
-        const session = await Martins.startSession({
50
-            mode: 'immersive',
51
-            viewport: viewport,
52
-            trackers: [ tracker ],
53
-            sources: [ source ],
54
-            stats: true,
55
-            gizmos: true,
56
-        });
57
-
58
-        const scan = document.getElementById('scan');
59
-
60
-        tracker.addEventListener('targetfound', event => {
61
-            if(scan)
62
-                scan.hidden = true;
63
-        });
64
-
65
-        tracker.addEventListener('targetlost', event => {
66
-            if(scan)
67
-                scan.hidden = false;
68
-        });
69
-
70
-        return session;
71
-    }
72
-});

+ 0
- 20
demos/simple-webcam/index.html Целия файл

@@ -1,20 +0,0 @@
1
-<!doctype html>
2
-<html>
3
-    <head>
4
-        <meta charset="utf-8">
5
-        <meta name="viewport" content="width=device-width,initial-scale=1">
6
-        <title>MARTINS.js WebAR: Simple Webcam demo</title>
7
-        <link href="../assets/demo.css" rel="stylesheet">
8
-        <script src="../../dist/martins.js"></script>
9
-        <script src="demo.js"></script>
10
-    </head>
11
-    <body>
12
-        <div id="ar-viewport">
13
-            <div id="ar-hud" hidden>
14
-                <img id="scan" src="../assets/scan.png">
15
-                <button id="toggle-webcam"></button>
16
-            </div>
17
-        </div>
18
-        <img id="my-reference-image" src="../assets/my-reference-image.webp" hidden>
19
-    </body>
20
-</html>

+ 5
- 29
docs/getting-started/create-the-augmented-scene.md Целия файл

@@ -4,25 +4,7 @@ Now that the image is being tracked, the next step is to render a virtual scene
4 4
 
5 5
 ## Pick a 3D rendering technology
6 6
 
7
-MARTINS.js is not a 3D rendering technology. It is an Augmented Reality technology that provides the data you need in order to augment your physical scenes. There are free and open-source 3D rendering technologies for the web that you can find online and use with MARTINS.js. Popular solutions include:
8
-
9
-<div style="display: flex; flex-flow: row wrap; justify-content: center; align-items: flex-end; text-align: center" markdown>
10
-<div markdown>
11
-![A-Frame](../img/logo-aframe.png "A-Frame logo by Mozilla"){ width=200 }
12
-
13
-**A-Frame**
14
-</div><div markdown>
15
-![Babylon.js](../img/logo-babylonjs.png "Babylon.js logo by David Catuhe"){ width=200 }
16
-
17
-**Babylon.js**
18
-</div><div markdown>
19
-![Three.js](../img/logo-threejs.png "Three.js logo by Mr.doob"){ width=200 }
20
-
21
-**Three.js**
22
-</div>
23
-</div>
24
-
25
-You can also use other solutions. MARTINS.js lets you pick any 3D rendering technology.
7
+MARTINS.js is not a 3D rendering technology. It is an Augmented Reality technology that provides the data you need in order to augment your physical scenes. There are free and open-source 3D rendering technologies for the web that you can find online and use with MARTINS.js. Popular solutions include: A-Frame, Babylon.js and Three.js. You can also use other solutions. MARTINS.js lets you pick any 3D rendering technology.
26 8
 
27 9
 Once you pick a 3D rendering technology, you need to integrate it with MARTINS.js. There is a code that is responsible for that integration. I call it a _glue code_. Among other things, a glue code transports the tracking results from MARTINS.js to the 3D rendering technology of your choice - it really is a "glue" connecting them.
28 10
 
@@ -46,14 +28,6 @@ Once you plug in the glue code, you'll be using the 3D rendering technology of y
46 28
 <figcaption markdown>An augmented scene with a [3D model](../assets/my-3d-model.glb "A public domain 3D model from Kenney, converted to glTF format") from [Kenney](https://www.kenney.nl){ ._blank }</figcaption>
47 29
 </figure>
48 30
 
49
-<figure markdown>
50
-<video poster="../../img/demo-cool.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
51
-    <source src="../../img/demo-cool.webm" type="video/webm" />
52
-    <source src="../../img/demo-cool.mp4" type="video/mp4" />
53
-</video>
54
-<figcaption markdown>A similar augmented scene viewed from a different perspective</figcaption>
55
-</figure>
56
-
57 31
 Let me tell you a bit more about the 3D rendering technologies I just mentioned.
58 32
 
59 33
 ### A-Frame
@@ -64,17 +38,19 @@ A-Frame is built on top of [Three.js](#threejs) and extends it in powerful ways.
64 38
 
65 39
 A-Frame is easy for beginners and pleasing for experts. A simple scene is declared like this:
66 40
 
67
-```html title="index.html" hl_lines="7 10 21-34"
41
+```html title="index.html" hl_lines="7-8 11-12 23-36"
68 42
 <!doctype html>
69 43
 <html>
70 44
     <head>
71 45
         <meta charset="utf-8">
72 46
         <meta name="viewport" content="width=device-width,initial-scale=1">
73 47
         <title>MARTINS.js WebAR demo</title>
48
+        <!-- include A-Frame -->
74 49
         <script src="aframe-vX.Y.Z.min.js"></script>
75 50
         <script src="martins.js"></script>
76 51
         <script src="ar-demo.js"></script>
77
-        <script src="plug in my glue code here"></script>
52
+        <!-- this is my glue code for A-Frame -->
53
+        <script src="aframe-with-martins.js"></script>
78 54
         <style>body { background-color: #3d5afe; }</style>
79 55
     </head>
80 56
     <body>

+ 1
- 1
docs/getting-started/index.md Целия файл

@@ -38,4 +38,4 @@ MARTINS.js requires WebGL2 and WebAssembly.
38 38
 
39 39
 ## About
40 40
 
41
-MARTINS.js is free and open-source software developed by [Alexandre Martins](https://github.com/alemart). It is based on [Speedy Vision](https://github.com/alemart/speedy-vision) and released under the [LGPL](LICENSE.md).
41
+MARTINS.js is free and open-source software developed by [Alexandre Martins](https://github.com/alemart). It is based on [Speedy Vision](https://github.com/alemart/speedy-vision) and released under the [LGPL](../license.md).

+ 2
- 2
docs/getting-started/next-steps.md Целия файл

@@ -76,11 +76,11 @@ Explore the API to see how you can have multiple virtual scenes in a single web
76 76
 
77 77
 ## Publish your WebAR experiences
78 78
 
79
-So far we've just created a static HTML page. Static pages are surprisingly easy to deploy. Any quality web hosting supports them. [Neocities](https://neocities.org/){ ._blank }, [Glitch](https://glitch.com/){ ._blank } and [GitHub Pages](https://pages.github.com/){ ._blank } are popular alternatives that let you host your WebAR experiences easily and for free. Your pages will be served over HTTPS, and that's important for webcam access!
79
+So far we've just created a static HTML page. The next step is to make your page available on the web. Your pages must be served over HTTPS - that's important for webcam access!
80 80
 
81 81
 !!! tip "Tip: use a QR code"
82 82
 
83
-    If you intend to print your reference images and have them placed on, let's say, a wall somewhere, consider adding a [QR code](https://en.wikipedia.org/wiki/QR_code){ ._blank } nearby. The QR code should point to your website. Users can then just scan your QR code to open your WebAR experience. Easy! :wink:
83
+    If you intend to print your reference images, consider adding a QR code nearby. The QR code should point to your web page. Users can then just scan your QR code to open your WebAR experience. Easy! :wink:
84 84
 
85 85
 !!! tip "Use the minified code"
86 86
 

+ 2
- 0
docs_overrides/home.html Целия файл

@@ -114,12 +114,14 @@
114 114
             <a href="{{ './getting-started' | url }}" class="md-button md-button--primary">Get started</a>
115 115
             <a href="{{ './demo/instructions' | url }}" class="md-button">Try a demo</a>
116 116
         </div>
117
+        <!--
117 118
         <div class="splash-image">
118 119
             <video poster="{{ './img/demo-cool3.webp' | url }}" muted loop playsinline autoplay>
119 120
                 <source src="{{ './img/demo-cool3.webm' | url }}" type="video/webm" />
120 121
                 <source src="{{ './img/demo-cool3.mp4' | url }}" type="video/mp4" />
121 122
             </video>
122 123
         </div>
124
+        -->
123 125
     </div>
124 126
 </section>
125 127
 

Loading…
Отказ
Запис