Sfoglia il codice sorgente

Update docs

customisations
alemart 11 mesi fa
parent
commit
964efc7bd6

+ 12
- 60
docs/getting-started/create-the-augmented-scene.md Vedi File

@@ -4,7 +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
-encantAR.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 encantAR.js. Popular solutions include: A-Frame, Babylon.js and Three.js. You can also use other solutions. encantAR.js lets you pick any 3D rendering technology.
7
+encantAR.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 encantAR.js. Popular solutions include: [A-Frame](#a-frame), [Babylon.js](#babylonjs) and [Three.js](#threejs). You can also use other solutions. encantAR.js lets you pick any 3D rendering technology.
8 8
 
9 9
 Once you pick a 3D rendering technology, you need to integrate it with encantAR.js. There is a code that is responsible for that integration. I call it a _plugin_. Among other things, a plugin transports the tracking results from encantAR.js to the 3D rendering technology of your choice.
10 10
 
@@ -12,21 +12,13 @@ Once you pick a 3D rendering technology, you need to integrate it with encantAR.
12 12
 
13 13
 Writing a plugin is a task of moderate complexity. It requires dealing with matrices, with performance issues, and with some idiosyncrasies of the 3D rendering technologies in order to make sure it all works as intended. It is advisable to have specialized knowledge of computer graphics programming in order to write a plugin that works correctly.
14 14
 
15
-I provide easy-to-use plugins that work with different 3D rendering technologies in my demos, so that you don't need to deal with the complexity. Those plugins are JavaScript (.js) files. You just need to add a plugin to your web page (e.g., via a `<script>` tag) and then the integration will be done for you. It's really that simple!
15
+I provide easy-to-use plugins that work with different 3D rendering technologies, so that you don't need to deal with the complexity. Those plugins are JavaScript (.js) files. You just need to add a plugin to your web page (e.g., via a `<script>` tag) and then the integration will be done for you. It's really that simple!
16 16
 
17
-[Find the plugins in my demos](../demos.md){ .md-button ._blank }
17
+[Get the plugins](https://github.com/alemart/encantar-js/tree/master/plugins){ .md-button .md-button--primary ._blank }
18 18
 
19 19
 ## Create the virtual scene
20 20
 
21
-You will create the virtual scene using the 3D rendering technology of your choice. As soon as you combine it with a plugin, the physical scene will be automatically augmented with the virtual scene, thus creating the augmented scene.
22
-
23
-<figure markdown>
24
-<video poster="../../img/demo-cool2.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
25
-    <source src="../../img/demo-cool2.webm" type="video/webm" />
26
-    <source src="../../img/demo-cool2.mp4" type="video/mp4" />
27
-</video>
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>
29
-</figure>
21
+You will create the virtual scene using the 3D rendering technology of your choice. As soon as you combine it with a plugin, the physical scene will be automagically augmented with the virtual scene, thus creating the augmented scene.
30 22
 
31 23
 Let me tell you a bit more about the 3D rendering technologies I just mentioned.
32 24
 
@@ -36,53 +28,9 @@ Let me tell you a bit more about the 3D rendering technologies I just mentioned.
36 28
 
37 29
 A-Frame is built on top of [Three.js](#threejs) and extends it in powerful ways. It introduces a HTML-based declarative approach for [scene graphs](https://en.wikipedia.org/wiki/Scene_graph){ ._blank }, empowering them with the [Entity-Component-System](https://en.wikipedia.org/wiki/Entity_component_system){ ._blank }, a software pattern commonly used in game development. Sounds complicated? It is not!
38 30
 
39
-A-Frame is easy for beginners and pleasing for experts. A simple scene is declared like this:
40
-
41
-```html title="index.html" hl_lines="7-8 11-12 23-36"
42
-<!doctype html>
43
-<html>
44
-    <head>
45
-        <meta charset="utf-8">
46
-        <meta name="viewport" content="width=device-width,initial-scale=1">
47
-        <title>encantAR.js WebAR demo</title>
48
-        <!-- include aframe -->
49
-        <script src="aframe-vX.Y.Z.min.js"></script>
50
-        <script src="encantar.js"></script>
51
-        <script src="ar-demo.js"></script>
52
-        <!-- include the aframe plugin for encantar.js -->
53
-        <script src="aframe-with-encantar.js"></script>
54
-        <style>body { background-color: #3d5afe; }</style>
55
-    </head>
56
-    <body>
57
-        <div id="ar-viewport"></div>
58
-        <img id="my-reference-image" src="my-reference-image.webp" hidden>
59
-        <video id="my-video" hidden muted loop playsinline autoplay>
60
-            <source src="my-video.webm" type="video/webm" />
61
-            <source src="my-video.mp4" type="video/mp4" />
62
-        </video>
63
-
64
-        <!-- This is a scene -->
65
-        <a-scene ar-scene>
66
-            <a-camera ar-camera></a-camera>
67
-
68
-            <!-- Whatever you add to <ar-root> will appear in AR -->
69
-            <ar-root>
70
-                <a-entity gltf-model="#my-3d-model"></a-entity>
71
-            </ar-root>
72
-
73
-            <!-- Declare external media files here -->
74
-            <a-assets>
75
-                <a-asset-item id="my-3d-model" src="my-3d-model.glb"></a-asset-item>
76
-            </a-assets>
77
-        </a-scene>
78
-
79
-    </body>
80
-</html>
81
-```
82
-
83
-`<ar-root>` is not part of A-Frame, but it becomes available as soon as you use my plugin.
84
-
85
-A-Frame lets you create animated scenes with special effects simply by declaring things, like in the above example. In many cases, writing new JavaScript code is not needed. A-Frame also includes a visual inspector that makes things really easy for non-coders.
31
+A-Frame is easy for beginners and pleasing for experts. In many cases, writing new JavaScript code is not needed. A-Frame also includes a visual inspector that makes things really easy for non-coders.
32
+
33
+[Launch an A-Frame demo](/encantar-js/demos/hello-aframe/README.html){ ._blank .md-button }
86 34
 
87 35
 ### Babylon.js
88 36
 
@@ -90,10 +38,14 @@ A-Frame lets you create animated scenes with special effects simply by declaring
90 38
 
91 39
 Babylon.js has an amazing documentation with plenty of learning resources. Even though it can be used by beginners, it's recommended to have working JavaScript experience before creating projects with it.
92 40
 
41
+[Launch a Babylon.js demo (soon)](#){ ._blank .md-button }
42
+
93 43
 ### Three.js
94 44
 
95 45
 [Three.js](https://threejs.org){ ._blank } is a popular open-source JavaScript library used to render 3D graphics in web browsers. It supports many features, including: scene graphs, cameras, animations, lights, materials, loading of 3D models, mathematical utilities, special effects, and more. It has an active and vibrant community. Many community-made extensions are available.
96 46
 
97 47
 Three.js often uses [WebGL](https://webglfundamentals.org){ ._blank } to draw 3D graphics. WebGL is a low-level rasterization engine that draws points, lines and triangles. It's seldom used directly by the developers of applications.
98 48
 
99
-Using Three.js requires more JavaScript experience than using A-Frame in most cases, but it's also a great choice if you're comfortable with coding. Compared to A-Frame, Three.js offers you additional freedom on how you can organize your code, because it's a library, not a framework.
49
+Using Three.js requires more JavaScript experience than using A-Frame in most cases, but it's also a great choice if you're comfortable with coding. Compared to A-Frame, Three.js offers you additional freedom on how you can organize your code, because it's a library, not a framework.
50
+
51
+[Launch a Three.js demo](/encantar-js/demos/hello-three/README.html){ ._blank .md-button }

+ 1
- 1
docs/getting-started/next-steps.md Vedi File

@@ -72,7 +72,7 @@ I emphasize that you are **not** required to enable low-power mode. Enable it if
72 72
 
73 73
 You can add multiple reference images to the reference image database. Each of those images can correspond to a different virtual scene. The virtual scene that shows up depends on the target image that is being tracked.
74 74
 
75
-Explore the API to see how you can have multiple virtual scenes in a single web page. Don't go overboard with this, though: the web page should load fast. Too much content may impact loading times. Keep your media files small and load your models asynchronously if possible.
75
+Explore the API to see how you can have multiple virtual scenes in a single web page. Don't go overboard with this, though: the web page should load fast. Too much content may impact loading times. Keep your media files small and load your content asynchronously if possible.
76 76
 
77 77
 ## Publish your WebAR experiences
78 78
 

Loading…
Annulla
Salva