Selaa lähdekoodia

Initial commit

customisations
alemart 3 vuotta sitten
commit
55b945684d
100 muutettua tiedostoa jossa 32079 lisäystä ja 0 poistoa
  1. 23
    0
      .gitignore
  2. 5
    0
      CHANGES.md
  3. 19
    0
      CONTRIBUTING.md
  4. 129
    0
      LICENSE-PRO.md
  5. 660
    0
      LICENSE.md
  6. 9
    0
      NOTICE
  7. 25
    0
      README.md
  8. 28823
    0
      dist/martins.js
  9. 20
    0
      dist/martins.min.js
  10. 19
    0
      docs/CONTRIBUTING.md
  11. 3
    0
      docs/api/ar-event-listener.md
  12. 35
    0
      docs/api/ar-event-target.md
  13. 3
    0
      docs/api/ar-event-type.md
  14. 11
    0
      docs/api/ar-event.md
  15. 42
    0
      docs/api/camera-source.md
  16. 19
    0
      docs/api/canvas-source.md
  17. 32
    0
      docs/api/frame.md
  18. 11
    0
      docs/api/gizmos.md
  19. 17
    0
      docs/api/hud.md
  20. 23
    0
      docs/api/image-tracker-result.md
  21. 51
    0
      docs/api/image-tracker.md
  22. 37
    0
      docs/api/martins.md
  23. 29
    0
      docs/api/perspective-view.md
  24. 11
    0
      docs/api/pose.md
  25. 67
    0
      docs/api/reference-image-database.md
  26. 17
    0
      docs/api/reference-image.md
  27. 16
    0
      docs/api/resolution.md
  28. 17
    0
      docs/api/rigid-transform.md
  29. 124
    0
      docs/api/session.md
  30. 17
    0
      docs/api/settings.md
  31. 3
    0
      docs/api/source.md
  32. 63
    0
      docs/api/speedy-matrix.md
  33. 43
    0
      docs/api/speedy-promise.md
  34. 17
    0
      docs/api/speedy-size.md
  35. 15
    0
      docs/api/speedy.md
  36. 29
    0
      docs/api/time.md
  37. 17
    0
      docs/api/trackable-image.md
  38. 3
    0
      docs/api/trackable.md
  39. 17
    0
      docs/api/tracker-result.md
  40. 13
    0
      docs/api/tracker.md
  41. 19
    0
      docs/api/video-source.md
  42. 11
    0
      docs/api/view.md
  43. 11
    0
      docs/api/viewer-pose.md
  44. 39
    0
      docs/api/viewer.md
  45. 80
    0
      docs/api/viewport.md
  46. BIN
      docs/assets/my-3d-model.glb
  47. BIN
      docs/assets/my-reference-image.png
  48. BIN
      docs/assets/my-reference-image.webp
  49. BIN
      docs/assets/my-video.webm
  50. BIN
      docs/assets/scan.png
  51. 5
    0
      docs/contact.md
  52. 126
    0
      docs/demos.md
  53. 31
    0
      docs/download.md
  54. 298
    0
      docs/getting-started/activate-your-webcam.md
  55. 63
    0
      docs/getting-started/concepts.md
  56. 114
    0
      docs/getting-started/create-the-augmented-scene.md
  57. 56
    0
      docs/getting-started/guidelines-for-images.md
  58. 23
    0
      docs/getting-started/index.md
  59. 22
    0
      docs/getting-started/introduction.md
  60. 95
    0
      docs/getting-started/next-steps.md
  61. 37
    0
      docs/getting-started/questions-and-answers.md
  62. 101
    0
      docs/getting-started/set-up-a-web-server.md
  63. 225
    0
      docs/getting-started/set-up-the-session.md
  64. 189
    0
      docs/getting-started/set-up-the-tracker.md
  65. BIN
      docs/img/demo-aframe.gif
  66. BIN
      docs/img/demo-cool.webm
  67. BIN
      docs/img/demo-cool.webp
  68. BIN
      docs/img/demo-cool2.webm
  69. BIN
      docs/img/demo-cool2.webp
  70. BIN
      docs/img/demo-cool3.gif
  71. BIN
      docs/img/demo-cool3.webm
  72. BIN
      docs/img/demo-cool3.webp
  73. BIN
      docs/img/demo-hello.gif
  74. BIN
      docs/img/demo-hello.png
  75. BIN
      docs/img/demo-hello.webp
  76. BIN
      docs/img/demo-interactivity-three.jpg
  77. BIN
      docs/img/demo-touchthree.gif
  78. BIN
      docs/img/guidelines-for-images-1.jpg
  79. BIN
      docs/img/guidelines-for-images-10.jpg
  80. BIN
      docs/img/guidelines-for-images-11.jpg
  81. BIN
      docs/img/guidelines-for-images-12.jpg
  82. BIN
      docs/img/guidelines-for-images-2.jpg
  83. BIN
      docs/img/guidelines-for-images-3.jpg
  84. BIN
      docs/img/guidelines-for-images-4.jpg
  85. BIN
      docs/img/guidelines-for-images-5.jpg
  86. BIN
      docs/img/guidelines-for-images-6.jpg
  87. BIN
      docs/img/guidelines-for-images-7.jpg
  88. BIN
      docs/img/guidelines-for-images-8.jpg
  89. BIN
      docs/img/guidelines-for-images-9.jpg
  90. BIN
      docs/img/image-tracking-demo.webp
  91. BIN
      docs/img/image-tracking-demo2.webp
  92. BIN
      docs/img/image-tracking-gizmos.webp
  93. BIN
      docs/img/kofi.png
  94. BIN
      docs/img/logo-aframe.png
  95. BIN
      docs/img/logo-babylonjs.png
  96. BIN
      docs/img/logo-threejs.png
  97. BIN
      docs/img/martins-icon.png
  98. BIN
      docs/img/page-with-nothing.webp
  99. BIN
      docs/img/page-with-reference-image.webp
  100. 0
    0
      docs/img/poster.png

+ 23
- 0
.gitignore Näytä tiedosto

@@ -0,0 +1,23 @@
1
+# vscode
2
+.vscode
3
+.vscode/*
4
+!.vscode/settings.json
5
+!.vscode/tasks.json
6
+!.vscode/launch.json
7
+!.vscode/extensions.json
8
+
9
+# vim
10
+# swap
11
+[._]*.s[a-v][a-z]
12
+[._]*.sw[a-p]
13
+[._]s[a-v][a-z]
14
+[._]sw[a-p]
15
+# session
16
+Session.vim
17
+# temporary
18
+.netrwhist
19
+*~
20
+
21
+# mine
22
+node_modules/*
23
+dist/*.map

+ 5
- 0
CHANGES.md Näytä tiedosto

@@ -0,0 +1,5 @@
1
+# Release notes
2
+
3
+## 0.1.0 - April 21st, 2022
4
+
5
+* Initial release

+ 19
- 0
CONTRIBUTING.md Näytä tiedosto

@@ -0,0 +1,19 @@
1
+# How to contribute
2
+
3
+Thank you for your interest in contributing to MARTINS.js! Here are some ways you can contribute:
4
+
5
+## Support my work
6
+
7
+I develop MARTINS.js independently and I release it as open-source software. Developing and maintaining this project requires a lot of skill, and I think it must be sustainable. I ask for support to be able to continue this work. If WebAR is meaningful to you or to your business, please [support my work with a paid membership](https://alemart.github.io/martins-js/support-my-work) and [purchase my WebAR demos](https://alemart.github.io/martins-js/demos).
8
+
9
+## Spread the word
10
+
11
+Augmented Reality is a joy to work with. :sunglasses: Spread the joy to your social media! Tell your friends and clients about the amazing, creative #WebAR experiences you are building with #MARTINSjs. They will surely like to hear from you, and you will also be helping this project by spreading the word about it.
12
+
13
+## Help others
14
+
15
+If you're technically savvy, please offer your advice to others asking for help on the community at [GitHub Discussions](https://github.com/alemart/martins-js/discussions). Even though there is complexity to this project, some questions may be technically simple, and a competent developer may be able to answer them accurately. If you feel that you're able to answer a question accurately, please do. You will be helping others and also learning for yourself in the process.
16
+
17
+## Pull requests
18
+
19
+I do not accept any pull requests to this repository at this time. If you make a suggestion and include some code as a proof-of-concept, I will most likely appreciate it. However, please do not feel offended if I do not use the code you provide, and instead decide to rewrite it.

+ 129
- 0
LICENSE-PRO.md Näytä tiedosto

@@ -0,0 +1,129 @@
1
+# PolyForm Perimeter License 1.0.0
2
+
3
+<https://polyformproject.org/licenses/perimeter/1.0.0>
4
+
5
+## Acceptance
6
+
7
+In order to get any license under these terms, you must agree
8
+to them as both strict obligations and conditions to all
9
+your licenses.
10
+
11
+## Copyright License
12
+
13
+The licensor grants you a copyright license for the
14
+software to do everything you might do with the software
15
+that would otherwise infringe the licensor's copyright
16
+in it for any permitted purpose.  However, you may
17
+only distribute the software according to [Distribution
18
+License](#distribution-license) and make changes or new works
19
+based on the software according to [Changes and New Works
20
+License](#changes-and-new-works-license).
21
+
22
+## Distribution License
23
+
24
+The licensor grants you an additional copyright license
25
+to distribute copies of the software.  Your license
26
+to distribute covers distributing the software with
27
+changes and new works permitted by [Changes and New Works
28
+License](#changes-and-new-works-license).
29
+
30
+## Notices
31
+
32
+You must ensure that anyone who gets a copy of any part of
33
+the software from you also gets a copy of these terms or the
34
+URL for them above, as well as copies of any plain-text lines
35
+beginning with `Required Notice:` that the licensor provided
36
+with the software.  For example:
37
+
38
+> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
39
+
40
+## Changes and New Works License
41
+
42
+The licensor grants you an additional copyright license to
43
+make changes and new works based on the software for any
44
+permitted purpose.
45
+
46
+## Patent License
47
+
48
+The licensor grants you a patent license for the software that
49
+covers patent claims the licensor can license, or becomes able
50
+to license, that you would infringe by using the software.
51
+
52
+## Noncompete
53
+
54
+Any purpose is a permitted purpose, except for providing to
55
+others any product that competes with the software.
56
+
57
+## Competition
58
+
59
+If you use this software to market a product as a substitute
60
+for the functionality or value of the software, it competes
61
+with the software. A product may compete regardless how it is
62
+designed or deployed. For example, a product may compete even
63
+if it provides its functionality via any kind of interface
64
+(including services, libraries or plug-ins), even if it is
65
+ported to a different platforms or programming languages,
66
+and even if it is provided free of charge.
67
+
68
+## Fair Use
69
+
70
+You may have "fair use" rights for the software under the
71
+law. These terms do not limit them.
72
+
73
+## No Other Rights
74
+
75
+These terms do not allow you to sublicense or transfer any of
76
+your licenses to anyone else, or prevent the licensor from
77
+granting licenses to anyone else.  These terms do not imply
78
+any other licenses.
79
+
80
+## Patent Defense
81
+
82
+If you make any written claim that the software infringes or
83
+contributes to infringement of any patent, your patent license
84
+for the software granted under these terms ends immediately. If
85
+your company makes such a claim, your patent license ends
86
+immediately for work on behalf of your company.
87
+
88
+## Violations
89
+
90
+The first time you are notified in writing that you have
91
+violated any of these terms, or done anything with the software
92
+not covered by your licenses, your licenses can nonetheless
93
+continue if you come into full compliance with these terms,
94
+and take practical steps to correct past violations, within
95
+32 days of receiving notice.  Otherwise, all your licenses
96
+end immediately.
97
+
98
+## No Liability
99
+
100
+***As far as the law allows, the software comes as is, without
101
+any warranty or condition, and the licensor will not be liable
102
+to you for any damages arising out of these terms or the use
103
+or nature of the software, under any kind of legal claim.***
104
+
105
+## Definitions
106
+
107
+The **licensor** is the individual or entity offering these
108
+terms, and the **software** is the software the licensor makes
109
+available under these terms.
110
+
111
+A **product** can be a good or service, or a combination
112
+of them.
113
+
114
+**You** refers to the individual or entity agreeing to these
115
+terms.
116
+
117
+**Your company** is any legal entity, sole proprietorship,
118
+or other kind of organization that you work for, plus all
119
+organizations that have control over, are under the control of,
120
+or are under common control with that organization.  **Control**
121
+means ownership of substantially all the assets of an entity,
122
+or the power to direct its management and policies by vote,
123
+contract, or otherwise.  Control can be direct or indirect.
124
+
125
+**Your licenses** are all the licenses granted to you for the
126
+software under these terms.
127
+
128
+**Use** means anything you do with the software requiring one
129
+of your licenses.

+ 660
- 0
LICENSE.md Näytä tiedosto

@@ -0,0 +1,660 @@
1
+### GNU AFFERO GENERAL PUBLIC LICENSE
2
+
3
+Version 3, 19 November 2007
4
+
5
+Copyright (C) 2007 Free Software Foundation, Inc.
6
+<https://fsf.org/>
7
+
8
+Everyone is permitted to copy and distribute verbatim copies of this
9
+license document, but changing it is not allowed.
10
+
11
+### Preamble
12
+
13
+The GNU Affero General Public License is a free, copyleft license for
14
+software and other kinds of works, specifically designed to ensure
15
+cooperation with the community in the case of network server software.
16
+
17
+The licenses for most software and other practical works are designed
18
+to take away your freedom to share and change the works. By contrast,
19
+our General Public Licenses are intended to guarantee your freedom to
20
+share and change all versions of a program--to make sure it remains
21
+free software for all its users.
22
+
23
+When we speak of free software, we are referring to freedom, not
24
+price. Our General Public Licenses are designed to make sure that you
25
+have the freedom to distribute copies of free software (and charge for
26
+them if you wish), that you receive source code or can get it if you
27
+want it, that you can change the software or use pieces of it in new
28
+free programs, and that you know you can do these things.
29
+
30
+Developers that use our General Public Licenses protect your rights
31
+with two steps: (1) assert copyright on the software, and (2) offer
32
+you this License which gives you legal permission to copy, distribute
33
+and/or modify the software.
34
+
35
+A secondary benefit of defending all users' freedom is that
36
+improvements made in alternate versions of the program, if they
37
+receive widespread use, become available for other developers to
38
+incorporate. Many developers of free software are heartened and
39
+encouraged by the resulting cooperation. However, in the case of
40
+software used on network servers, this result may fail to come about.
41
+The GNU General Public License permits making a modified version and
42
+letting the public access it on a server without ever releasing its
43
+source code to the public.
44
+
45
+The GNU Affero General Public License is designed specifically to
46
+ensure that, in such cases, the modified source code becomes available
47
+to the community. It requires the operator of a network server to
48
+provide the source code of the modified version running there to the
49
+users of that server. Therefore, public use of a modified version, on
50
+a publicly accessible server, gives the public access to the source
51
+code of the modified version.
52
+
53
+An older license, called the Affero General Public License and
54
+published by Affero, was designed to accomplish similar goals. This is
55
+a different license, not a version of the Affero GPL, but Affero has
56
+released a new version of the Affero GPL which permits relicensing
57
+under this license.
58
+
59
+The precise terms and conditions for copying, distribution and
60
+modification follow.
61
+
62
+### TERMS AND CONDITIONS
63
+
64
+#### 0. Definitions.
65
+
66
+"This License" refers to version 3 of the GNU Affero General Public
67
+License.
68
+
69
+"Copyright" also means copyright-like laws that apply to other kinds
70
+of works, such as semiconductor masks.
71
+
72
+"The Program" refers to any copyrightable work licensed under this
73
+License. Each licensee is addressed as "you". "Licensees" and
74
+"recipients" may be individuals or organizations.
75
+
76
+To "modify" a work means to copy from or adapt all or part of the work
77
+in a fashion requiring copyright permission, other than the making of
78
+an exact copy. The resulting work is called a "modified version" of
79
+the earlier work or a work "based on" the earlier work.
80
+
81
+A "covered work" means either the unmodified Program or a work based
82
+on the Program.
83
+
84
+To "propagate" a work means to do anything with it that, without
85
+permission, would make you directly or secondarily liable for
86
+infringement under applicable copyright law, except executing it on a
87
+computer or modifying a private copy. Propagation includes copying,
88
+distribution (with or without modification), making available to the
89
+public, and in some countries other activities as well.
90
+
91
+To "convey" a work means any kind of propagation that enables other
92
+parties to make or receive copies. Mere interaction with a user
93
+through a computer network, with no transfer of a copy, is not
94
+conveying.
95
+
96
+An interactive user interface displays "Appropriate Legal Notices" to
97
+the extent that it includes a convenient and prominently visible
98
+feature that (1) displays an appropriate copyright notice, and (2)
99
+tells the user that there is no warranty for the work (except to the
100
+extent that warranties are provided), that licensees may convey the
101
+work under this License, and how to view a copy of this License. If
102
+the interface presents a list of user commands or options, such as a
103
+menu, a prominent item in the list meets this criterion.
104
+
105
+#### 1. Source Code.
106
+
107
+The "source code" for a work means the preferred form of the work for
108
+making modifications to it. "Object code" means any non-source form of
109
+a work.
110
+
111
+A "Standard Interface" means an interface that either is an official
112
+standard defined by a recognized standards body, or, in the case of
113
+interfaces specified for a particular programming language, one that
114
+is widely used among developers working in that language.
115
+
116
+The "System Libraries" of an executable work include anything, other
117
+than the work as a whole, that (a) is included in the normal form of
118
+packaging a Major Component, but which is not part of that Major
119
+Component, and (b) serves only to enable use of the work with that
120
+Major Component, or to implement a Standard Interface for which an
121
+implementation is available to the public in source code form. A
122
+"Major Component", in this context, means a major essential component
123
+(kernel, window system, and so on) of the specific operating system
124
+(if any) on which the executable work runs, or a compiler used to
125
+produce the work, or an object code interpreter used to run it.
126
+
127
+The "Corresponding Source" for a work in object code form means all
128
+the source code needed to generate, install, and (for an executable
129
+work) run the object code and to modify the work, including scripts to
130
+control those activities. However, it does not include the work's
131
+System Libraries, or general-purpose tools or generally available free
132
+programs which are used unmodified in performing those activities but
133
+which are not part of the work. For example, Corresponding Source
134
+includes interface definition files associated with source files for
135
+the work, and the source code for shared libraries and dynamically
136
+linked subprograms that the work is specifically designed to require,
137
+such as by intimate data communication or control flow between those
138
+subprograms and other parts of the work.
139
+
140
+The Corresponding Source need not include anything that users can
141
+regenerate automatically from other parts of the Corresponding Source.
142
+
143
+The Corresponding Source for a work in source code form is that same
144
+work.
145
+
146
+#### 2. Basic Permissions.
147
+
148
+All rights granted under this License are granted for the term of
149
+copyright on the Program, and are irrevocable provided the stated
150
+conditions are met. This License explicitly affirms your unlimited
151
+permission to run the unmodified Program. The output from running a
152
+covered work is covered by this License only if the output, given its
153
+content, constitutes a covered work. This License acknowledges your
154
+rights of fair use or other equivalent, as provided by copyright law.
155
+
156
+You may make, run and propagate covered works that you do not convey,
157
+without conditions so long as your license otherwise remains in force.
158
+You may convey covered works to others for the sole purpose of having
159
+them make modifications exclusively for you, or provide you with
160
+facilities for running those works, provided that you comply with the
161
+terms of this License in conveying all material for which you do not
162
+control copyright. Those thus making or running the covered works for
163
+you must do so exclusively on your behalf, under your direction and
164
+control, on terms that prohibit them from making any copies of your
165
+copyrighted material outside their relationship with you.
166
+
167
+Conveying under any other circumstances is permitted solely under the
168
+conditions stated below. Sublicensing is not allowed; section 10 makes
169
+it unnecessary.
170
+
171
+#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
172
+
173
+No covered work shall be deemed part of an effective technological
174
+measure under any applicable law fulfilling obligations under article
175
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
176
+similar laws prohibiting or restricting circumvention of such
177
+measures.
178
+
179
+When you convey a covered work, you waive any legal power to forbid
180
+circumvention of technological measures to the extent such
181
+circumvention is effected by exercising rights under this License with
182
+respect to the covered work, and you disclaim any intention to limit
183
+operation or modification of the work as a means of enforcing, against
184
+the work's users, your or third parties' legal rights to forbid
185
+circumvention of technological measures.
186
+
187
+#### 4. Conveying Verbatim Copies.
188
+
189
+You may convey verbatim copies of the Program's source code as you
190
+receive it, in any medium, provided that you conspicuously and
191
+appropriately publish on each copy an appropriate copyright notice;
192
+keep intact all notices stating that this License and any
193
+non-permissive terms added in accord with section 7 apply to the code;
194
+keep intact all notices of the absence of any warranty; and give all
195
+recipients a copy of this License along with the Program.
196
+
197
+You may charge any price or no price for each copy that you convey,
198
+and you may offer support or warranty protection for a fee.
199
+
200
+#### 5. Conveying Modified Source Versions.
201
+
202
+You may convey a work based on the Program, or the modifications to
203
+produce it from the Program, in the form of source code under the
204
+terms of section 4, provided that you also meet all of these
205
+conditions:
206
+
207
+-   a) The work must carry prominent notices stating that you modified
208
+    it, and giving a relevant date.
209
+-   b) The work must carry prominent notices stating that it is
210
+    released under this License and any conditions added under
211
+    section 7. This requirement modifies the requirement in section 4
212
+    to "keep intact all notices".
213
+-   c) You must license the entire work, as a whole, under this
214
+    License to anyone who comes into possession of a copy. This
215
+    License will therefore apply, along with any applicable section 7
216
+    additional terms, to the whole of the work, and all its parts,
217
+    regardless of how they are packaged. This License gives no
218
+    permission to license the work in any other way, but it does not
219
+    invalidate such permission if you have separately received it.
220
+-   d) If the work has interactive user interfaces, each must display
221
+    Appropriate Legal Notices; however, if the Program has interactive
222
+    interfaces that do not display Appropriate Legal Notices, your
223
+    work need not make them do so.
224
+
225
+A compilation of a covered work with other separate and independent
226
+works, which are not by their nature extensions of the covered work,
227
+and which are not combined with it such as to form a larger program,
228
+in or on a volume of a storage or distribution medium, is called an
229
+"aggregate" if the compilation and its resulting copyright are not
230
+used to limit the access or legal rights of the compilation's users
231
+beyond what the individual works permit. Inclusion of a covered work
232
+in an aggregate does not cause this License to apply to the other
233
+parts of the aggregate.
234
+
235
+#### 6. Conveying Non-Source Forms.
236
+
237
+You may convey a covered work in object code form under the terms of
238
+sections 4 and 5, provided that you also convey the machine-readable
239
+Corresponding Source under the terms of this License, in one of these
240
+ways:
241
+
242
+-   a) Convey the object code in, or embodied in, a physical product
243
+    (including a physical distribution medium), accompanied by the
244
+    Corresponding Source fixed on a durable physical medium
245
+    customarily used for software interchange.
246
+-   b) Convey the object code in, or embodied in, a physical product
247
+    (including a physical distribution medium), accompanied by a
248
+    written offer, valid for at least three years and valid for as
249
+    long as you offer spare parts or customer support for that product
250
+    model, to give anyone who possesses the object code either (1) a
251
+    copy of the Corresponding Source for all the software in the
252
+    product that is covered by this License, on a durable physical
253
+    medium customarily used for software interchange, for a price no
254
+    more than your reasonable cost of physically performing this
255
+    conveying of source, or (2) access to copy the Corresponding
256
+    Source from a network server at no charge.
257
+-   c) Convey individual copies of the object code with a copy of the
258
+    written offer to provide the Corresponding Source. This
259
+    alternative is allowed only occasionally and noncommercially, and
260
+    only if you received the object code with such an offer, in accord
261
+    with subsection 6b.
262
+-   d) Convey the object code by offering access from a designated
263
+    place (gratis or for a charge), and offer equivalent access to the
264
+    Corresponding Source in the same way through the same place at no
265
+    further charge. You need not require recipients to copy the
266
+    Corresponding Source along with the object code. If the place to
267
+    copy the object code is a network server, the Corresponding Source
268
+    may be on a different server (operated by you or a third party)
269
+    that supports equivalent copying facilities, provided you maintain
270
+    clear directions next to the object code saying where to find the
271
+    Corresponding Source. Regardless of what server hosts the
272
+    Corresponding Source, you remain obligated to ensure that it is
273
+    available for as long as needed to satisfy these requirements.
274
+-   e) Convey the object code using peer-to-peer transmission,
275
+    provided you inform other peers where the object code and
276
+    Corresponding Source of the work are being offered to the general
277
+    public at no charge under subsection 6d.
278
+
279
+A separable portion of the object code, whose source code is excluded
280
+from the Corresponding Source as a System Library, need not be
281
+included in conveying the object code work.
282
+
283
+A "User Product" is either (1) a "consumer product", which means any
284
+tangible personal property which is normally used for personal,
285
+family, or household purposes, or (2) anything designed or sold for
286
+incorporation into a dwelling. In determining whether a product is a
287
+consumer product, doubtful cases shall be resolved in favor of
288
+coverage. For a particular product received by a particular user,
289
+"normally used" refers to a typical or common use of that class of
290
+product, regardless of the status of the particular user or of the way
291
+in which the particular user actually uses, or expects or is expected
292
+to use, the product. A product is a consumer product regardless of
293
+whether the product has substantial commercial, industrial or
294
+non-consumer uses, unless such uses represent the only significant
295
+mode of use of the product.
296
+
297
+"Installation Information" for a User Product means any methods,
298
+procedures, authorization keys, or other information required to
299
+install and execute modified versions of a covered work in that User
300
+Product from a modified version of its Corresponding Source. The
301
+information must suffice to ensure that the continued functioning of
302
+the modified object code is in no case prevented or interfered with
303
+solely because modification has been made.
304
+
305
+If you convey an object code work under this section in, or with, or
306
+specifically for use in, a User Product, and the conveying occurs as
307
+part of a transaction in which the right of possession and use of the
308
+User Product is transferred to the recipient in perpetuity or for a
309
+fixed term (regardless of how the transaction is characterized), the
310
+Corresponding Source conveyed under this section must be accompanied
311
+by the Installation Information. But this requirement does not apply
312
+if neither you nor any third party retains the ability to install
313
+modified object code on the User Product (for example, the work has
314
+been installed in ROM).
315
+
316
+The requirement to provide Installation Information does not include a
317
+requirement to continue to provide support service, warranty, or
318
+updates for a work that has been modified or installed by the
319
+recipient, or for the User Product in which it has been modified or
320
+installed. Access to a network may be denied when the modification
321
+itself materially and adversely affects the operation of the network
322
+or violates the rules and protocols for communication across the
323
+network.
324
+
325
+Corresponding Source conveyed, and Installation Information provided,
326
+in accord with this section must be in a format that is publicly
327
+documented (and with an implementation available to the public in
328
+source code form), and must require no special password or key for
329
+unpacking, reading or copying.
330
+
331
+#### 7. Additional Terms.
332
+
333
+"Additional permissions" are terms that supplement the terms of this
334
+License by making exceptions from one or more of its conditions.
335
+Additional permissions that are applicable to the entire Program shall
336
+be treated as though they were included in this License, to the extent
337
+that they are valid under applicable law. If additional permissions
338
+apply only to part of the Program, that part may be used separately
339
+under those permissions, but the entire Program remains governed by
340
+this License without regard to the additional permissions.
341
+
342
+When you convey a copy of a covered work, you may at your option
343
+remove any additional permissions from that copy, or from any part of
344
+it. (Additional permissions may be written to require their own
345
+removal in certain cases when you modify the work.) You may place
346
+additional permissions on material, added by you to a covered work,
347
+for which you have or can give appropriate copyright permission.
348
+
349
+Notwithstanding any other provision of this License, for material you
350
+add to a covered work, you may (if authorized by the copyright holders
351
+of that material) supplement the terms of this License with terms:
352
+
353
+-   a) Disclaiming warranty or limiting liability differently from the
354
+    terms of sections 15 and 16 of this License; or
355
+-   b) Requiring preservation of specified reasonable legal notices or
356
+    author attributions in that material or in the Appropriate Legal
357
+    Notices displayed by works containing it; or
358
+-   c) Prohibiting misrepresentation of the origin of that material,
359
+    or requiring that modified versions of such material be marked in
360
+    reasonable ways as different from the original version; or
361
+-   d) Limiting the use for publicity purposes of names of licensors
362
+    or authors of the material; or
363
+-   e) Declining to grant rights under trademark law for use of some
364
+    trade names, trademarks, or service marks; or
365
+-   f) Requiring indemnification of licensors and authors of that
366
+    material by anyone who conveys the material (or modified versions
367
+    of it) with contractual assumptions of liability to the recipient,
368
+    for any liability that these contractual assumptions directly
369
+    impose on those licensors and authors.
370
+
371
+All other non-permissive additional terms are considered "further
372
+restrictions" within the meaning of section 10. If the Program as you
373
+received it, or any part of it, contains a notice stating that it is
374
+governed by this License along with a term that is a further
375
+restriction, you may remove that term. If a license document contains
376
+a further restriction but permits relicensing or conveying under this
377
+License, you may add to a covered work material governed by the terms
378
+of that license document, provided that the further restriction does
379
+not survive such relicensing or conveying.
380
+
381
+If you add terms to a covered work in accord with this section, you
382
+must place, in the relevant source files, a statement of the
383
+additional terms that apply to those files, or a notice indicating
384
+where to find the applicable terms.
385
+
386
+Additional terms, permissive or non-permissive, may be stated in the
387
+form of a separately written license, or stated as exceptions; the
388
+above requirements apply either way.
389
+
390
+#### 8. Termination.
391
+
392
+You may not propagate or modify a covered work except as expressly
393
+provided under this License. Any attempt otherwise to propagate or
394
+modify it is void, and will automatically terminate your rights under
395
+this License (including any patent licenses granted under the third
396
+paragraph of section 11).
397
+
398
+However, if you cease all violation of this License, then your license
399
+from a particular copyright holder is reinstated (a) provisionally,
400
+unless and until the copyright holder explicitly and finally
401
+terminates your license, and (b) permanently, if the copyright holder
402
+fails to notify you of the violation by some reasonable means prior to
403
+60 days after the cessation.
404
+
405
+Moreover, your license from a particular copyright holder is
406
+reinstated permanently if the copyright holder notifies you of the
407
+violation by some reasonable means, this is the first time you have
408
+received notice of violation of this License (for any work) from that
409
+copyright holder, and you cure the violation prior to 30 days after
410
+your receipt of the notice.
411
+
412
+Termination of your rights under this section does not terminate the
413
+licenses of parties who have received copies or rights from you under
414
+this License. If your rights have been terminated and not permanently
415
+reinstated, you do not qualify to receive new licenses for the same
416
+material under section 10.
417
+
418
+#### 9. Acceptance Not Required for Having Copies.
419
+
420
+You are not required to accept this License in order to receive or run
421
+a copy of the Program. Ancillary propagation of a covered work
422
+occurring solely as a consequence of using peer-to-peer transmission
423
+to receive a copy likewise does not require acceptance. However,
424
+nothing other than this License grants you permission to propagate or
425
+modify any covered work. These actions infringe copyright if you do
426
+not accept this License. Therefore, by modifying or propagating a
427
+covered work, you indicate your acceptance of this License to do so.
428
+
429
+#### 10. Automatic Licensing of Downstream Recipients.
430
+
431
+Each time you convey a covered work, the recipient automatically
432
+receives a license from the original licensors, to run, modify and
433
+propagate that work, subject to this License. You are not responsible
434
+for enforcing compliance by third parties with this License.
435
+
436
+An "entity transaction" is a transaction transferring control of an
437
+organization, or substantially all assets of one, or subdividing an
438
+organization, or merging organizations. If propagation of a covered
439
+work results from an entity transaction, each party to that
440
+transaction who receives a copy of the work also receives whatever
441
+licenses to the work the party's predecessor in interest had or could
442
+give under the previous paragraph, plus a right to possession of the
443
+Corresponding Source of the work from the predecessor in interest, if
444
+the predecessor has it or can get it with reasonable efforts.
445
+
446
+You may not impose any further restrictions on the exercise of the
447
+rights granted or affirmed under this License. For example, you may
448
+not impose a license fee, royalty, or other charge for exercise of
449
+rights granted under this License, and you may not initiate litigation
450
+(including a cross-claim or counterclaim in a lawsuit) alleging that
451
+any patent claim is infringed by making, using, selling, offering for
452
+sale, or importing the Program or any portion of it.
453
+
454
+#### 11. Patents.
455
+
456
+A "contributor" is a copyright holder who authorizes use under this
457
+License of the Program or a work on which the Program is based. The
458
+work thus licensed is called the contributor's "contributor version".
459
+
460
+A contributor's "essential patent claims" are all patent claims owned
461
+or controlled by the contributor, whether already acquired or
462
+hereafter acquired, that would be infringed by some manner, permitted
463
+by this License, of making, using, or selling its contributor version,
464
+but do not include claims that would be infringed only as a
465
+consequence of further modification of the contributor version. For
466
+purposes of this definition, "control" includes the right to grant
467
+patent sublicenses in a manner consistent with the requirements of
468
+this License.
469
+
470
+Each contributor grants you a non-exclusive, worldwide, royalty-free
471
+patent license under the contributor's essential patent claims, to
472
+make, use, sell, offer for sale, import and otherwise run, modify and
473
+propagate the contents of its contributor version.
474
+
475
+In the following three paragraphs, a "patent license" is any express
476
+agreement or commitment, however denominated, not to enforce a patent
477
+(such as an express permission to practice a patent or covenant not to
478
+sue for patent infringement). To "grant" such a patent license to a
479
+party means to make such an agreement or commitment not to enforce a
480
+patent against the party.
481
+
482
+If you convey a covered work, knowingly relying on a patent license,
483
+and the Corresponding Source of the work is not available for anyone
484
+to copy, free of charge and under the terms of this License, through a
485
+publicly available network server or other readily accessible means,
486
+then you must either (1) cause the Corresponding Source to be so
487
+available, or (2) arrange to deprive yourself of the benefit of the
488
+patent license for this particular work, or (3) arrange, in a manner
489
+consistent with the requirements of this License, to extend the patent
490
+license to downstream recipients. "Knowingly relying" means you have
491
+actual knowledge that, but for the patent license, your conveying the
492
+covered work in a country, or your recipient's use of the covered work
493
+in a country, would infringe one or more identifiable patents in that
494
+country that you have reason to believe are valid.
495
+
496
+If, pursuant to or in connection with a single transaction or
497
+arrangement, you convey, or propagate by procuring conveyance of, a
498
+covered work, and grant a patent license to some of the parties
499
+receiving the covered work authorizing them to use, propagate, modify
500
+or convey a specific copy of the covered work, then the patent license
501
+you grant is automatically extended to all recipients of the covered
502
+work and works based on it.
503
+
504
+A patent license is "discriminatory" if it does not include within the
505
+scope of its coverage, prohibits the exercise of, or is conditioned on
506
+the non-exercise of one or more of the rights that are specifically
507
+granted under this License. You may not convey a covered work if you
508
+are a party to an arrangement with a third party that is in the
509
+business of distributing software, under which you make payment to the
510
+third party based on the extent of your activity of conveying the
511
+work, and under which the third party grants, to any of the parties
512
+who would receive the covered work from you, a discriminatory patent
513
+license (a) in connection with copies of the covered work conveyed by
514
+you (or copies made from those copies), or (b) primarily for and in
515
+connection with specific products or compilations that contain the
516
+covered work, unless you entered into that arrangement, or that patent
517
+license was granted, prior to 28 March 2007.
518
+
519
+Nothing in this License shall be construed as excluding or limiting
520
+any implied license or other defenses to infringement that may
521
+otherwise be available to you under applicable patent law.
522
+
523
+#### 12. No Surrender of Others' Freedom.
524
+
525
+If conditions are imposed on you (whether by court order, agreement or
526
+otherwise) that contradict the conditions of this License, they do not
527
+excuse you from the conditions of this License. If you cannot convey a
528
+covered work so as to satisfy simultaneously your obligations under
529
+this License and any other pertinent obligations, then as a
530
+consequence you may not convey it at all. For example, if you agree to
531
+terms that obligate you to collect a royalty for further conveying
532
+from those to whom you convey the Program, the only way you could
533
+satisfy both those terms and this License would be to refrain entirely
534
+from conveying the Program.
535
+
536
+#### 13. Remote Network Interaction; Use with the GNU General Public License.
537
+
538
+Notwithstanding any other provision of this License, if you modify the
539
+Program, your modified version must prominently offer all users
540
+interacting with it remotely through a computer network (if your
541
+version supports such interaction) an opportunity to receive the
542
+Corresponding Source of your version by providing access to the
543
+Corresponding Source from a network server at no charge, through some
544
+standard or customary means of facilitating copying of software. This
545
+Corresponding Source shall include the Corresponding Source for any
546
+work covered by version 3 of the GNU General Public License that is
547
+incorporated pursuant to the following paragraph.
548
+
549
+Notwithstanding any other provision of this License, you have
550
+permission to link or combine any covered work with a work licensed
551
+under version 3 of the GNU General Public License into a single
552
+combined work, and to convey the resulting work. The terms of this
553
+License will continue to apply to the part which is the covered work,
554
+but the work with which it is combined will remain governed by version
555
+3 of the GNU General Public License.
556
+
557
+#### 14. Revised Versions of this License.
558
+
559
+The Free Software Foundation may publish revised and/or new versions
560
+of the GNU Affero General Public License from time to time. Such new
561
+versions will be similar in spirit to the present version, but may
562
+differ in detail to address new problems or concerns.
563
+
564
+Each version is given a distinguishing version number. If the Program
565
+specifies that a certain numbered version of the GNU Affero General
566
+Public License "or any later version" applies to it, you have the
567
+option of following the terms and conditions either of that numbered
568
+version or of any later version published by the Free Software
569
+Foundation. If the Program does not specify a version number of the
570
+GNU Affero General Public License, you may choose any version ever
571
+published by the Free Software Foundation.
572
+
573
+If the Program specifies that a proxy can decide which future versions
574
+of the GNU Affero General Public License can be used, that proxy's
575
+public statement of acceptance of a version permanently authorizes you
576
+to choose that version for the Program.
577
+
578
+Later license versions may give you additional or different
579
+permissions. However, no additional obligations are imposed on any
580
+author or copyright holder as a result of your choosing to follow a
581
+later version.
582
+
583
+#### 15. Disclaimer of Warranty.
584
+
585
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
586
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
587
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
588
+WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
589
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
590
+A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
591
+PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
592
+DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
593
+CORRECTION.
594
+
595
+#### 16. Limitation of Liability.
596
+
597
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
598
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
599
+CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
600
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
601
+ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
602
+NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
603
+LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
604
+TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
605
+PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
606
+
607
+#### 17. Interpretation of Sections 15 and 16.
608
+
609
+If the disclaimer of warranty and limitation of liability provided
610
+above cannot be given local legal effect according to their terms,
611
+reviewing courts shall apply local law that most closely approximates
612
+an absolute waiver of all civil liability in connection with the
613
+Program, unless a warranty or assumption of liability accompanies a
614
+copy of the Program in return for a fee.
615
+
616
+END OF TERMS AND CONDITIONS
617
+
618
+### How to Apply These Terms to Your New Programs
619
+
620
+If you develop a new program, and you want it to be of the greatest
621
+possible use to the public, the best way to achieve this is to make it
622
+free software which everyone can redistribute and change under these
623
+terms.
624
+
625
+To do so, attach the following notices to the program. It is safest to
626
+attach them to the start of each source file to most effectively state
627
+the exclusion of warranty; and each file should have at least the
628
+"copyright" line and a pointer to where the full notice is found.
629
+
630
+        <one line to give the program's name and a brief idea of what it does.>
631
+        Copyright (C) <year>  <name of author>
632
+
633
+        This program is free software: you can redistribute it and/or modify
634
+        it under the terms of the GNU Affero General Public License as
635
+        published by the Free Software Foundation, either version 3 of the
636
+        License, or (at your option) any later version.
637
+
638
+        This program is distributed in the hope that it will be useful,
639
+        but WITHOUT ANY WARRANTY; without even the implied warranty of
640
+        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
641
+        GNU Affero General Public License for more details.
642
+
643
+        You should have received a copy of the GNU Affero General Public License
644
+        along with this program.  If not, see <https://www.gnu.org/licenses/>.
645
+
646
+Also add information on how to contact you by electronic and paper
647
+mail.
648
+
649
+If your software can interact with users remotely through a computer
650
+network, you should also make sure that it provides a way for users to
651
+get its source. For example, if your program is a web application, its
652
+interface could display a "Source" link that leads users to an archive
653
+of the code. There are many ways you could offer source, and different
654
+solutions will be better for different programs; see section 13 for
655
+the specific requirements.
656
+
657
+You should also get your employer (if you work as a programmer) or
658
+school, if any, to sign a "copyright disclaimer" for the program, if
659
+necessary. For more information on this, and how to apply and follow
660
+the GNU AGPL, see <https://www.gnu.org/licenses/>.

+ 9
- 0
NOTICE Näytä tiedosto

@@ -0,0 +1,9 @@
1
+Required Notice: MARTINS.js WebAR engine developed by Alexandre Martins (https://github.com/alemart)
2
+
3
+MARTINS.js: GPU-accelerated Augmented Reality for the web
4
+Copyright (c) Alexandre Martins
5
+https://github.com/alemart/martins-js
6
+
7
+Speedy Vision: GPU-accelerated Computer Vision for JavaScript
8
+Copyright (c) Alexandre Martins
9
+https://github.com/alemart/speedy-vision

+ 25
- 0
README.md Näytä tiedosto

@@ -0,0 +1,25 @@
1
+# MARTINS.js WebAR engine
2
+
3
+Create amazing Augmented Reality experiences with **MARTINS.js**, a GPU-accelerated Augmented Reality engine for the web.
4
+
5
+Get started at <https://alemart.github.io/martins-js/>
6
+
7
+![WebAR demo](docs/img/demo-cool3.gif) ![WebAR demo](docs/img/splash.gif)
8
+
9
+MARTINS.js is [dual licensed](#author). It is currently in beta.
10
+
11
+## Why use MARTINS.js?
12
+
13
+Here is why MARTINS.js is a great choice for creating Augmented Reality experiences:
14
+
15
+* **No need to download apps!** MARTINS.js is a WebAR engine. It runs in web browsers. Users can access the AR experience immediately.
16
+* **Fast and powerful!** MARTINS.js is GPU-accelerated. It uses WebGL2 and WebAssembly for turbocharged performance.
17
+* **No need of custom hardware or software!** MARTINS.js is built from scratch using standard web technologies. All it requires is a modern and compatible web browser.
18
+* **Fully standalone!** MARTINS.js has in it everything it needs to analyze the environment and help you create AR. There are no additional requirements.
19
+* **Easy to get started!** MARTINS.js can be used with a `<script>` tag in your page. A static HTML page is enough to get started.
20
+
21
+## Author
22
+
23
+MARTINS.js is developed by me, [Alexandre Martins](https://github.com/alemart), a computer scientist from Brazil. This project is dual-licensed. The Free Edition, available to everyone, is licensed under the [AGPL 3.0](docs/license/agpl-3.0.md). The Professional Edition, available to [my supporters](https://alemart.github.io/martins-js/support-my-work/), is licensed under the [Polyform Perimeter 1.0.0](docs/license/PolyForm-Perimeter-1.0.0-1.md).
24
+
25
+See [CONTRIBUTING](CONTRIBUTING.md) for information on how you can contribute.

+ 28823
- 0
dist/martins.js
File diff suppressed because it is too large
Näytä tiedosto


+ 20
- 0
dist/martins.min.js
File diff suppressed because it is too large
Näytä tiedosto


+ 19
- 0
docs/CONTRIBUTING.md Näytä tiedosto

@@ -0,0 +1,19 @@
1
+# How to contribute
2
+
3
+Thank you for your interest in contributing to MARTINS.js! Here are some ways you can contribute:
4
+
5
+## Support my work
6
+
7
+I develop MARTINS.js independently and I release it as open-source software. Developing and maintaining this project requires a lot of skill, and I think it must be sustainable. I ask for support to be able to continue this work. If WebAR is meaningful to you or to your business, please [support my work with a paid membership](https://alemart.github.io/martins-js/support-my-work) and [purchase my WebAR demos](https://alemart.github.io/martins-js/demos).
8
+
9
+## Spread the word
10
+
11
+Augmented Reality is a joy to work with. :sunglasses: Spread the joy to your social media! Tell your friends and clients about the amazing, creative #WebAR experiences you are building with #MARTINSjs. They will surely like to hear from you, and you will also be helping this project by spreading the word about it.
12
+
13
+## Help others
14
+
15
+If you're technically savvy, please offer your advice to others asking for help on the community at [GitHub Discussions](https://github.com/alemart/martins-js/discussions). Even though there is complexity to this project, some questions may be technically simple, and a competent developer may be able to answer them accurately. If you feel that you're able to answer a question accurately, please do. You will be helping others and also learning for yourself in the process.
16
+
17
+## Pull requests
18
+
19
+I do not accept any pull requests to this repository at this time. If you make a suggestion and include some code as a proof-of-concept, I will most likely appreciate it. However, please do not feel offended if I do not use the code you provide, and instead decide to rewrite it.

+ 3
- 0
docs/api/ar-event-listener.md Näytä tiedosto

@@ -0,0 +1,3 @@
1
+# AREventListener
2
+
3
+A function that is linked to an [AREventTarget](ar-event-target.md). It is called as soon as that [AREventTarget](ar-event-target.md) receives an [AREvent](ar-event.md) of a specific [type](ar-event-type.md). The event is passed as an argument.

+ 35
- 0
docs/api/ar-event-target.md Näytä tiedosto

@@ -0,0 +1,35 @@
1
+# AREventTarget
2
+
3
+An AREventTarget is an object that is able to receive [AREvents](ar-event.md). You may add [event listeners](ar-event-listener.md) to it in order to listen to "relevant changes" in its state.
4
+
5
+## Methods
6
+
7
+### addEventListener
8
+
9
+`target.addEventListener(type: AREventType, listener: AREventListener): void`
10
+
11
+Add an event listener to `target`.
12
+
13
+**Arguments**
14
+
15
+* `type: AREventType`. The type of event you intend to listen to.
16
+* `listener: AREventListener`. The event listener you intend to add.
17
+
18
+**Example**
19
+
20
+```js
21
+session.addEventListener('end', event => {
22
+    console.log('The session has ended.');
23
+});
24
+```
25
+
26
+### removeEventListener
27
+
28
+`target.removeEventListener(type: AREventType, listener: AREventListener): void`
29
+
30
+Remove an event listener from `target`.
31
+
32
+**Arguments**
33
+
34
+* `type: AREventType`. The type of event you are listening to.
35
+* `listener: AREventListener`. The event listener you intend to remove.

+ 3
- 0
docs/api/ar-event-type.md Näytä tiedosto

@@ -0,0 +1,3 @@
1
+# AREventType
2
+
3
+An AREventType is a string representing the type of an [AREvent](ar-event.md). The documentation of the different [AREventTargets](ar-event-target.md) (e.g., [Session](session.md)) specify which event types are valid for those targets.

+ 11
- 0
docs/api/ar-event.md Näytä tiedosto

@@ -0,0 +1,11 @@
1
+# AREvent
2
+
3
+An AREvent is an `Event` sent to an [AREventTarget](ar-event-target.md). AREvents are used to notify [AREventListeners](ar-event-listener.md) about "relevant changes" in the state of [AREventTargets](ar-event-target.md).
4
+
5
+## Properties
6
+
7
+### type
8
+
9
+`event.type: AREventType`
10
+
11
+An [AREventType](ar-event-type.md) representing the type of the event.

+ 42
- 0
docs/api/camera-source.md Näytä tiedosto

@@ -0,0 +1,42 @@
1
+# CameraSource
2
+
3
+A [source of data](source.md) linked to a webcam.
4
+
5
+## Instantiation
6
+
7
+### Martins.Source.Camera
8
+
9
+`Martins.Source.Camera(settings: object): CameraSource`
10
+
11
+Create a new webcam-based source of data with the specified `settings`.
12
+
13
+**Arguments**
14
+
15
+* `settings: object, optional`. An object with the following keys (all are optional):
16
+    * `resolution: Resolution`. The desired [resolution](resolution.md) of the video. The higher the resolution, the longer it takes for the video to be uploaded to the GPU, which impacts performance. The lower the resolution, the less accurate the tracking will be. Suggested values: `"md+"`, `"md"`, `"sm+"`.
17
+    * `aspectRatio: number`. A hint specifying the preferred aspect ratio of the video.
18
+    * `constraints: MediaTrackConstraints`. Additional video constraints that will be passed to `navigator.mediaDevices.getUserMedia()`.
19
+
20
+**Returns**
21
+
22
+A new webcam-based source of data.
23
+
24
+**Example**
25
+
26
+```js
27
+const webcam = Martins.Source.Camera({
28
+    resolution: 'md+',
29
+    constraints: {
30
+        facingMode: 'environment' // will prefer the rear camera on mobile devices
31
+        //facingMode: 'user' // will prefer the front camera on mobile devices
32
+    }
33
+});
34
+```
35
+
36
+## Properties
37
+
38
+### resolution
39
+
40
+`source.resolution: Resolution, read-only`
41
+
42
+The [resolution](resolution.md) of this source of data.

+ 19
- 0
docs/api/canvas-source.md Näytä tiedosto

@@ -0,0 +1,19 @@
1
+# CanvasSource
2
+
3
+A [source of data](source.md) linked to a `<canvas>` element.
4
+
5
+## Instantiation
6
+
7
+### Martins.Source.Canvas
8
+
9
+`Martins.Source.Canvas(canvas: HTMLCanvasElement): CanvasSource`
10
+
11
+Create a new source of data linked to the provided `canvas`.
12
+
13
+**Arguments**
14
+
15
+* `canvas: HTMLCanvasElement`. A `<canvas>` element.
16
+
17
+**Returns**
18
+
19
+A new source of data.

+ 32
- 0
docs/api/frame.md Näytä tiedosto

@@ -0,0 +1,32 @@
1
+# Frame
2
+
3
+A `Frame` holds data for augmenting the physical scene with the virtual scene.
4
+
5
+## Properties
6
+
7
+### session
8
+
9
+`frame.session: Session, read-only`
10
+
11
+A reference to the [session](session.md).
12
+
13
+### results
14
+
15
+`frame.results: Iterable<TrackerResult>, read-only`
16
+
17
+Use this property to iterate through the [results](tracker-result.md) generated by the [trackers](tracker.md).
18
+
19
+**Example**
20
+
21
+```js
22
+function animate(time, frame)
23
+{
24
+    for(const result of frame.results) {
25
+        // ...
26
+    }
27
+
28
+    session.requestAnimationFrame(animate);
29
+}
30
+
31
+session.requestAnimationFrame(animate);
32
+```

+ 11
- 0
docs/api/gizmos.md Näytä tiedosto

@@ -0,0 +1,11 @@
1
+# Gizmos
2
+
3
+Gizmos provide visual cues about the state of the [trackers](tracker.md). They are particularly useful during development.
4
+
5
+## Properties
6
+
7
+### visible
8
+
9
+`gizmos.visible: boolean`
10
+
11
+Whether or not the gizmos are visible.

+ 17
- 0
docs/api/hud.md Näytä tiedosto

@@ -0,0 +1,17 @@
1
+# HUD
2
+
3
+A HUD (Heads Up Display) is an overlay used to display 2D elements that do not correlate with the physical scene. It's part of a [viewport](viewport.md) and occupies its entire space. It appears in front of the augmented scene.
4
+
5
+## Properties
6
+
7
+### container
8
+
9
+`hud.container: HTMLDivElement, read-only`
10
+
11
+The container of the HUD.
12
+
13
+### visible
14
+
15
+`hud.visible: boolean`
16
+
17
+Whether or not the HUD is visible.

+ 23
- 0
docs/api/image-tracker-result.md Näytä tiedosto

@@ -0,0 +1,23 @@
1
+# ImageTrackerResult
2
+
3
+A [result](tracker-result.md) generated by an [Image Tracker](image-tracker.md).
4
+
5
+## Properties
6
+
7
+### tracker
8
+
9
+`result.tracker: ImageTracker, read-only`
10
+
11
+A reference to the [Image Tracker](image-tracker.md) that generated this result.
12
+
13
+### trackables
14
+
15
+`result.trackables: TrackableImage[], read-only`
16
+
17
+An array of zero or one [TrackableImage](trackable-image.md) object(s).
18
+
19
+### viewer
20
+
21
+`result.viewer: Viewer | undefined, read-only`
22
+
23
+A [viewer](viewer.md) associated with the trackable. If there is no trackable, this property will be `undefined`.

+ 51
- 0
docs/api/image-tracker.md Näytä tiedosto

@@ -0,0 +1,51 @@
1
+# ImageTracker
2
+
3
+A [tracker](tracker.md) that tracks images in a video. Images are tracked using templates known as [reference images](reference-image.md).
4
+
5
+## Properties
6
+
7
+### state
8
+
9
+`tracker.state: string, read-only`
10
+
11
+The current state of the tracker.
12
+
13
+### database
14
+
15
+`tracker.database: ReferenceImageDatabase, read-only`
16
+
17
+A [database](reference-image-database.md) of [reference images](reference-image.md).
18
+
19
+### resolution
20
+
21
+`tracker.resolution: Resolution`
22
+
23
+The [resolution](resolution.md) adopted by the computer vision algorithms implemented in the tracker. Higher resolutions improve the tracking quality, but are computationally more expensive.
24
+
25
+## Events
26
+
27
+An ImageTracker is an [AREventTarget](ar-event-target.md). You can listen to the following events:
28
+
29
+### targetfound
30
+
31
+A target has been found.
32
+
33
+**Properties**
34
+
35
+* `referenceImage: ReferenceImage`. The [reference image](reference-image.md) that is linked to the target.
36
+
37
+**Example**
38
+
39
+```js
40
+tracker.addEventListener('targetfound', event => {
41
+    console.log('Found target: ' + event.referenceImage.name);
42
+});
43
+```
44
+
45
+### targetlost
46
+
47
+A target has been lost.
48
+
49
+**Properties**
50
+
51
+* `referenceImage: ReferenceImage`. The [reference image](reference-image.md) that is linked to the target.

+ 37
- 0
docs/api/martins.md Näytä tiedosto

@@ -0,0 +1,37 @@
1
+# Martins
2
+
3
+The `Martins` namespace is the entry point of the features and components of MARTINS.js.
4
+
5
+I have documented the instantiation of the components of the engine in their respective pages.
6
+
7
+## Properties
8
+
9
+### Settings
10
+
11
+`Martins.Settings: Settings, read-only`
12
+
13
+The [settings](settings.md) of the engine.
14
+
15
+### version
16
+
17
+`Martins.version: string, read-only`
18
+
19
+The version of MARTINS.js.
20
+
21
+### edition
22
+
23
+`Martins.edition: string, read-only`
24
+
25
+The edition of MARTINS.js.
26
+
27
+## Methods
28
+
29
+### isSupported
30
+
31
+`Martins.isSupported(): boolean`
32
+
33
+Checks if the user agent is capable of running the engine.
34
+
35
+**Returns**
36
+
37
+Returns `true` if the user agent is compatible with the engine, or `false` otherwise.

+ 29
- 0
docs/api/perspective-view.md Näytä tiedosto

@@ -0,0 +1,29 @@
1
+# PerspectiveView
2
+
3
+A [View](view.md) that models a perspective projection.
4
+
5
+## Properties
6
+
7
+### aspect
8
+
9
+`view.aspect: number, read-only`
10
+
11
+Aspect ratio of the viewing frustum.
12
+
13
+### fovy
14
+
15
+`view.fovy: number, read-only`
16
+
17
+Vertical field-of-view of the viewing frustum, measured in radians.
18
+
19
+### near
20
+
21
+`view.near: number, read-only`
22
+
23
+Distance of the near clipping plane of the viewing frustum to the Z = 0 plane in viewer space.
24
+
25
+### far
26
+
27
+`view.far: number, read-only`
28
+
29
+Distance of the far clipping plane of the viewing frustum to the Z = 0 plane in viewer space.

+ 11
- 0
docs/api/pose.md Näytä tiedosto

@@ -0,0 +1,11 @@
1
+# Pose
2
+
3
+A pose represents a position and an orientation in 3D space.
4
+
5
+## Properties
6
+
7
+### transform
8
+
9
+`pose.transform: RigidTransform, read-only`
10
+
11
+The underlying [rigid transform](rigid-transform.md).

+ 67
- 0
docs/api/reference-image-database.md Näytä tiedosto

@@ -0,0 +1,67 @@
1
+# ReferenceImageDatabase
2
+
3
+A database of [reference images](reference-image.md) that belongs to an [Image Tracker](image-tracker.md).
4
+
5
+## Properties
6
+
7
+### count
8
+
9
+`database.count: number, read-only`
10
+
11
+The number of reference images stored in this database.
12
+
13
+### capacity
14
+
15
+`database.capacity: number, read-only`
16
+
17
+The maximum number of reference images that can be stored in this database.
18
+
19
+## Methods
20
+
21
+### add
22
+
23
+`database.add(referenceImages: ReferenceImage[]): SpeedyPromise<void>`
24
+
25
+Add reference image(s) to the database.
26
+
27
+**Arguments**
28
+
29
+* `referenceImages: ReferenceImage[]`. The reference image(s) you want to add.
30
+
31
+**Returns**
32
+
33
+A promise that resolves as soon as the provided reference images are loaded and added to the database.
34
+
35
+**Example**
36
+
37
+```js
38
+const referenceImages = [{
39
+    name: 'my-first-image',
40
+    image: document.getElementById('my-first-image')
41
+}, {
42
+    name: 'my-second-image',
43
+    image: document.getElementById('my-second-image')
44
+}];
45
+
46
+tracker.database.add(referenceImages).then(() => {
47
+    console.log('The images have been added to the database');
48
+});
49
+```
50
+
51
+### @@iterator
52
+
53
+`database[Symbol.iterator](): Iterator<ReferenceImage>`
54
+
55
+This is used to iterate over the reference images stored in the database.
56
+
57
+**Returns**
58
+
59
+An iterator.
60
+
61
+**Example**
62
+
63
+```js
64
+for(const referenceImage of tracker.database) {
65
+    console.log(referenceImage.name);
66
+}
67
+```

+ 17
- 0
docs/api/reference-image.md Näytä tiedosto

@@ -0,0 +1,17 @@
1
+# ReferenceImage
2
+
3
+An interface specifying an image template that is fed to an [Image Tracker](image-tracker.md).
4
+
5
+## Properties
6
+
7
+### name
8
+
9
+`referenceImage.name: string, read-only`
10
+
11
+A name used to identify this reference image in a [database](reference-image-database.md).
12
+
13
+### image
14
+
15
+`referenceImage.image: HTMLImageElement | HTMLCanvasElement | ImageBitmap, read-only`
16
+
17
+Image template with pixel data.

+ 16
- 0
docs/api/resolution.md Näytä tiedosto

@@ -0,0 +1,16 @@
1
+# Resolution
2
+
3
+A `Resolution` is a setting defined by a string. It is mapped to a size measured in pixels according to special rules. You may use it to change the resolution in pixels of a video captured by a webcam, or to adjust the resolution in pixels of the videos that are processed by a tracker for example.
4
+
5
+The table below shows examples of how resolution strings are converted to pixels:
6
+
7
+| Resolution string | 16:9 landscape | 16:10 landscape | 4:3 landscape |
8
+| ----------------- | -------------- | --------------- | ------------- |
9
+| `"xs"` | 212x120 | 192x120 | 160x120 |
10
+| `"xs+"` | 284x160 | 256x160 | 212x160 |
11
+| `"sm"` | 356x200 | 320x200 | 266x200 | 
12
+| `"sm+"` | 426x240 | 384x240 | 320x240 |
13
+| `"md"` | 568x320 | 512x320 | 426x320 |
14
+| `"md+"` | 640x360 | 576x360 | 480x360 |
15
+| `"lg"` | 852x480 | 768x480 | 640x480 |
16
+| `"lg+"` | 1066x600 | 960x600 | 800x600 |

+ 17
- 0
docs/api/rigid-transform.md Näytä tiedosto

@@ -0,0 +1,17 @@
1
+# RigidTransform
2
+
3
+A RigidTransform represents a rotation and a translation in 3D space.
4
+
5
+## Properties
6
+
7
+### matrix
8
+
9
+`transform.matrix: SpeedyMatrix, read-only`
10
+
11
+A 4x4 matrix encoding the transform.
12
+
13
+### inverse
14
+
15
+`transform.inverse: RigidTransform, read-only`
16
+
17
+The inverse transform.

+ 124
- 0
docs/api/session.md Näytä tiedosto

@@ -0,0 +1,124 @@
1
+# Session
2
+
3
+A central component of a WebAR experience. Read the [concepts](../getting-started/concepts.md) for more information.
4
+
5
+## Instantiation
6
+
7
+### Martins.startSession
8
+
9
+`Martins.startSession(options: object): SpeedyPromise<Session>`
10
+
11
+Start a new session.
12
+
13
+**Arguments**
14
+
15
+* `options: object`. Options object with the following keys:
16
+    * `trackers: Tracker[]`. The [trackers](tracker.md) to be attached to the session.
17
+    * `sources: Source[]`. The [sources of data](source.md) to be linked to the session.
18
+    * `viewport: Viewport`. The [viewport](viewport.md) to be linked to the session.
19
+    * `mode: string, optional`. Either `"immersive"` or `"inline"`. Defaults to `"immersive"`.
20
+    * `gizmos: boolean, optional`. Whether or not to display the [gizmos](gizmos.md). Defaults to `false`.
21
+    * `stats: boolean, optional`. Whether or not to display the stats panel. It's useful during development. Defaults to `false`.
22
+
23
+**Returns**
24
+
25
+A promise that resolves to a new Session object.
26
+
27
+## Properties
28
+
29
+### mode
30
+
31
+`session.mode: string, read-only`
32
+
33
+Session mode.
34
+
35
+### time
36
+
37
+`session.time: Time, read-only`
38
+
39
+A reference to the [Time](time.md) utilities of this session.
40
+
41
+### viewport
42
+
43
+`session.viewport: Viewport, read-only`
44
+
45
+A reference to the [Viewport](viewport.md) linked to this session.
46
+
47
+### gizmos
48
+
49
+`session.gizmos: Gizmos, read-only`
50
+
51
+A reference to the [Gizmos](gizmos.md) object.
52
+
53
+## Methods
54
+
55
+### requestAnimationFrame
56
+
57
+`session.requestAnimationFrame(callback: function): SessionRequestAnimationFrameHandle`
58
+
59
+Schedules a call to the `callback` function, which is intended to update and render the virtual scene. Your `callback` function must itself call `session.requestAnimationFrame()` again in order to continue to update and render the virtual scene.
60
+
61
+!!! info "Note"
62
+
63
+    `session.requestAnimationFrame()` is analogous to `window.requestAnimationFrame()`, but they are not the same! The former is a call to the WebAR engine, whereas the latter is a standard call to the web browser.
64
+
65
+**Arguments**
66
+
67
+* `callback: function`. A function that receives two parameters:
68
+    * `time: DOMHighResTimeStamp`. Elapsed time, in milliseconds, since an arbitrary reference. This parameter is kept to mimic web standards, but its usage is discouraged. Prefer using `frame.session.time.elapsed` and `frame.session.time.delta` instead. These are especially useful for creating animations. See also: [Time](time.md).
69
+    * `frame: Frame`. A [Frame](frame.md) holding the data you need to create the augmented scene.
70
+
71
+**Returns**
72
+
73
+A handle.
74
+
75
+**Example**
76
+
77
+```js
78
+function animate(time, frame)
79
+{
80
+    // update and render the virtual scene
81
+    // ...
82
+
83
+    // repeat the call
84
+    session.requestAnimationFrame(animate);
85
+}
86
+
87
+session.requestAnimationFrame(animate);
88
+```
89
+
90
+### cancelAnimationFrame
91
+
92
+`session.cancelAnimationFrame(handle: SessionRequestAnimationFrameHandle): void`
93
+
94
+Cancels an animation frame request.
95
+
96
+**Arguments**
97
+
98
+* `handle: SessionRequestAnimationFrameHandle`. A handle returned by `session.requestAnimationFrame()`.
99
+
100
+### end
101
+
102
+`session.end(): SpeedyPromise<void>`
103
+
104
+Ends the session.
105
+
106
+**Returns**
107
+
108
+A promise that resolves as soon as the session is terminated.
109
+
110
+## Events
111
+
112
+A session is an [AREventTarget](ar-event-target.md). You can listen to the following events:
113
+
114
+### end
115
+
116
+The session has ended.
117
+
118
+**Example**
119
+
120
+```js
121
+session.addEventListener('end', event => {
122
+    console.log('The session has ended.');
123
+});
124
+```

+ 17
- 0
docs/api/settings.md Näytä tiedosto

@@ -0,0 +1,17 @@
1
+# Settings
2
+
3
+Engine settings.
4
+
5
+## Properties
6
+
7
+### powerPreference
8
+
9
+`Martins.Settings.powerPreference: string`
10
+
11
+Power profile. One of the following: `"default"`, `"low-power"`, `"high-performance"`.
12
+
13
+| Profile | Description |
14
+| ------- | ----------- |
15
+| `"default"` | Default settings. |
16
+| `"low-power"` | Reduce performance in order to reduce power consumption. |
17
+| `"high-performance"` | High performance mode. |

+ 3
- 0
docs/api/source.md Näytä tiedosto

@@ -0,0 +1,3 @@
1
+# Source
2
+
3
+An abstraction representing a source of data that is meant to be linked to a [session](session.md). A video is a typical source of data. Sources of data feed the [trackers](tracker.md). Refer to the [concepts](../getting-started/concepts.md) for more information.

+ 63
- 0
docs/api/speedy-matrix.md Näytä tiedosto

@@ -0,0 +1,63 @@
1
+# SpeedyMatrix
2
+
3
+[Speedy](speedy.md) includes its own fast implementation of matrices. They are used extensively in MARTINS.js.
4
+
5
+## Properties
6
+
7
+### rows
8
+
9
+`matrix.rows: number, read-only`
10
+
11
+Number of rows of the matrix.
12
+
13
+### columns
14
+
15
+`matrix.columns: number, read-only`
16
+
17
+Number of columns of the matrix.
18
+
19
+## Methods
20
+
21
+### read
22
+
23
+`matrix.read(): number[]`
24
+
25
+Read the entries of the matrix in [column-major format](https://en.wikipedia.org/wiki/Row-_and_column-major_order){ ._blank }.
26
+
27
+**Returns**
28
+
29
+The entries of the matrix in column-major format.
30
+
31
+**Example**
32
+
33
+```js
34
+/*
35
+
36
+Suppose that you are given this matrix:
37
+
38
+         [ 1  4  7 ]
39
+matrix = [ 2  5  8 ]
40
+         [ 3  6  9 ]
41
+
42
+Its entries in column-major format are: [1,2,3,   4,5,6,   7,8,9]
43
+
44
+*/
45
+
46
+const entries = matrix.read();
47
+```
48
+
49
+### toString
50
+
51
+`matrix.toString(): string`
52
+
53
+Convert to string.
54
+
55
+**Returns**
56
+
57
+A human-readable representation of the matrix.
58
+
59
+**Example**
60
+
61
+```js
62
+console.log(matrix.toString());
63
+```

+ 43
- 0
docs/api/speedy-promise.md Näytä tiedosto

@@ -0,0 +1,43 @@
1
+# SpeedyPromise
2
+
3
+[Speedy](speedy.md) includes its own implementation of promises. A `SpeedyPromise` works just like a standard promise. SpeedyPromises are designed for realtime applications. There are some subtle differences behind the scenes, but you need not be concerned with those.
4
+
5
+## Instantiation
6
+
7
+### Speedy.Promise
8
+
9
+`new Speedy.Promise(executor: function): SpeedyPromise`
10
+
11
+Creates a new `SpeedyPromise`. This works just like the constructor of a standard promise.
12
+
13
+**Arguments**
14
+
15
+* `executor: function`. A function that takes two functions as arguments:
16
+    * `resolve: function`. To be called when the promise is resolved.
17
+    * `reject: function`. To be called when the promise is rejected.
18
+
19
+**Returns**
20
+
21
+A new `SpeedyPromise`.
22
+
23
+**Example**
24
+
25
+```js
26
+function sleep(ms)
27
+{
28
+    return new Speedy.Promise((resolve, reject) => {
29
+        if(ms >= 0)
30
+            setTimeout(resolve, ms);
31
+        else
32
+            reject(new Error('Invalid time'));
33
+    });
34
+}
35
+
36
+sleep(2000).then(() => {
37
+    console.log('2 seconds have passed');
38
+}).catch(error => {
39
+    console.error(error.message);
40
+}).finally(() => {
41
+    console.log('Done!');
42
+});
43
+```

+ 17
- 0
docs/api/speedy-size.md Näytä tiedosto

@@ -0,0 +1,17 @@
1
+# SpeedySize
2
+
3
+Represents the size of a rectangle.
4
+
5
+## Properties
6
+
7
+### width
8
+
9
+`size.width: number, read-only`
10
+
11
+Width of the rectangle.
12
+
13
+### height
14
+
15
+`size.height: number, read-only`
16
+
17
+Height of the rectangle.

+ 15
- 0
docs/api/speedy.md Näytä tiedosto

@@ -0,0 +1,15 @@
1
+# Speedy
2
+
3
+MARTINS.js is built using [Speedy Vision](https://github.com/alemart/speedy-vision){ ._blank }, a GPU-accelerated Computer Vision library which is another project of mine.
4
+
5
+Many features provided by Speedy Vision are very useful (e.g., matrices). I have decided to include some of them in parts of the MARTINS.js API for convenience.
6
+
7
+In this documentation, I provide a quick reference of some of the classes used in Speedy Vision. This reference is minimal. For a more complete reference, please visit the [website of the project](https://github.com/alemart/speedy-vision){ ._blank }.
8
+
9
+## Properties
10
+
11
+### Speedy
12
+
13
+`Speedy: Speedy, read-only`
14
+
15
+The `Speedy` namespace is provided in global scope. It's also available as `Martins.Speedy`.

+ 29
- 0
docs/api/time.md Näytä tiedosto

@@ -0,0 +1,29 @@
1
+# Time
2
+
3
+Time-related utilities. They are useful for animating virtual scenes.
4
+
5
+## Properties
6
+
7
+### elapsed
8
+
9
+`time.elapsed: number, read-only`
10
+
11
+Elapsed time since the start of the session, measured at the beginning of the current animation frame and given in seconds.
12
+
13
+### delta
14
+
15
+`time.delta: number, read-only`
16
+
17
+Elapsed time between the current and the previous animation frame, given in seconds. Use this value to produce animations that are independent of the framerate.
18
+
19
+### scale
20
+
21
+`time.scale: number`
22
+
23
+Time scale. Use it to accelerate, slowdown or pause the passage of time. Defaults to 1.
24
+
25
+### unscaled
26
+
27
+`time.unscaled: number, read-only`
28
+
29
+Time scale independent seconds since the start of the session, measured at the beginning of the current animation frame.

+ 17
- 0
docs/api/trackable-image.md Näytä tiedosto

@@ -0,0 +1,17 @@
1
+# TrackableImage
2
+
3
+A [trackable](trackable.md) that represents an image target tracked by an [Image Tracker](image-tracker.md).
4
+
5
+## Properties
6
+
7
+### pose
8
+
9
+`trackable.pose: Pose, read-only`
10
+
11
+The [pose](pose.md) of the trackable.
12
+
13
+### referenceImage
14
+
15
+`trackable.referenceImage: ReferenceImage, read-only`
16
+
17
+The [reference image](reference-image.md) associated with the trackable.

+ 3
- 0
docs/api/trackable.md Näytä tiedosto

@@ -0,0 +1,3 @@
1
+# Trackable
2
+
3
+A Trackable is an interface that represents something that is tracked by a [Tracker](tracker.md).

+ 17
- 0
docs/api/tracker-result.md Näytä tiedosto

@@ -0,0 +1,17 @@
1
+# TrackerResult
2
+
3
+An interface that represents the result generated by a [tracker](tracker.md) at a specific time. It is part of a [frame](frame.md).
4
+
5
+## Properties
6
+
7
+### tracker
8
+
9
+`result.tracker: Tracker, read-only`
10
+
11
+A reference to the [tracker](tracker.md) that generated this result.
12
+
13
+### trackables
14
+
15
+`result.trackables: Trackable[], read-only`
16
+
17
+An array of zero or more [trackables](trackable.md).

+ 13
- 0
docs/api/tracker.md Näytä tiedosto

@@ -0,0 +1,13 @@
1
+# Tracker
2
+
3
+An interface that represents a generic tracker. Trackers analyze input data in some way and are meant to be attached to a [session](session.md). Refer to the [concepts](../getting-started/concepts.md) for more information.
4
+
5
+An [Image Tracker](image-tracker.md) is an implementation of a tracker.
6
+
7
+## Properties
8
+
9
+### type
10
+
11
+`tracker.type: string, read-only`
12
+
13
+A string representing the type of the tracker.

+ 19
- 0
docs/api/video-source.md Näytä tiedosto

@@ -0,0 +1,19 @@
1
+# VideoSource
2
+
3
+A [source of data](source.md) linked to a `<video>` element.
4
+
5
+## Instantiation
6
+
7
+### Martins.Source.Video
8
+
9
+`Martins.Source.Video(video: HTMLVideoElement): VideoSource`
10
+
11
+Create a new source of data linked to the provided `video`.
12
+
13
+**Arguments**
14
+
15
+* `video: HTMLVideoElement`. A `<video>` element.
16
+
17
+**Returns**
18
+
19
+A new source of data.

+ 11
- 0
docs/api/view.md Näytä tiedosto

@@ -0,0 +1,11 @@
1
+# View
2
+
3
+An interface that represents a view of the 3D world at a moment in time. A [PerspectiveView](perspective-view.md) is an implementation of a View.
4
+
5
+## Properties
6
+
7
+### projectionMatrix
8
+
9
+`view.projectionMatrix: SpeedyMatrix, read-only`
10
+
11
+A 4x4 matrix that projects viewer space onto clip space.

+ 11
- 0
docs/api/viewer-pose.md Näytä tiedosto

@@ -0,0 +1,11 @@
1
+# ViewerPose
2
+
3
+The [pose](pose.md) of a [Viewer](viewer.md).
4
+
5
+## Properties
6
+
7
+### viewMatrix
8
+
9
+`pose.viewMatrix: SpeedyMatrix, read-only`
10
+
11
+A 4x4 matrix that converts points from world space to viewer space.

+ 39
- 0
docs/api/viewer.md Näytä tiedosto

@@ -0,0 +1,39 @@
1
+# Viewer
2
+
3
+A virtual camera in 3D world space.
4
+
5
+## Properties
6
+
7
+### pose
8
+
9
+`viewer.pose: ViewerPose, read-only`
10
+
11
+The [pose](viewer-pose.md) of the viewer.
12
+
13
+### view
14
+
15
+`viewer.view: View, read-only`
16
+
17
+A [view](view.md) of the viewer (monoscopic rendering).
18
+
19
+## Methods
20
+
21
+### convertToViewerSpace
22
+
23
+`viewer.convertToViewerSpace(pose: Pose): Pose`
24
+
25
+Convert a `pose` from world space to viewer space.
26
+
27
+**Arguments**
28
+
29
+* `pose: Pose`. A [pose](pose.md) in world space.
30
+
31
+**Returns**
32
+
33
+The input `pose` converted to viewer space.
34
+
35
+**Example**
36
+
37
+```js
38
+const modelViewMatrix = viewer.convertToViewerSpace(pose).transform.matrix;
39
+```

+ 80
- 0
docs/api/viewport.md Näytä tiedosto

@@ -0,0 +1,80 @@
1
+# Viewport
2
+
3
+The viewport is the area of the web page in which the augmented scene will be displayed.
4
+
5
+## Instantiation
6
+
7
+### Martins.Viewport
8
+
9
+`Martins.Viewport(settings: object): Viewport`
10
+
11
+Create a new viewport with the specified `settings`.
12
+
13
+**Arguments**
14
+
15
+* `settings: object`. An object with the following keys:
16
+    * `container: HTMLDivElement`. A `<div>` that will contain the augmented scene.
17
+    * `hudContainer: HTMLDivElement, optional`. An overlay that will be displayed in front of the augmented scene. It must be a direct child of `container` in the DOM tree.
18
+    * `resolution: Resolution, optional`. The [resolution](resolution.md) of the virtual scene.
19
+    * `canvas: HTMLCanvasElement, optional`. An existing canvas on which the virtual scene will be drawn. The engine automatically creates a canvas. You should only specify an existing canvas if you must. Experimental.
20
+
21
+**Returns**
22
+
23
+A new viewport.
24
+
25
+**Example**
26
+
27
+```js
28
+const viewport = Martins.Viewport({
29
+    container: document.getElementById('ar-viewport'),
30
+    resolution: 'lg'
31
+});
32
+```
33
+
34
+## Properties
35
+
36
+### container
37
+
38
+`viewport.container: HTMLDivElement, read-only`
39
+
40
+The container of the viewport.
41
+
42
+### hud
43
+
44
+`viewport.hud: HUD, read-only`
45
+
46
+The [HUD](hud.md).
47
+
48
+### resolution
49
+
50
+`viewport.resolution: Resolution, read-only`
51
+
52
+The [resolution](resolution.md) of the virtual scene.
53
+
54
+### canvas
55
+
56
+`viewport.canvas: HTMLCanvasElement, read-only`
57
+
58
+A `<canvas>` on which the virtual scene is drawn.
59
+
60
+### virtualSize
61
+
62
+`viewport.virtualSize: SpeedySize, read-only`
63
+
64
+The size in pixels that matches the [resolution](#resolution) of the virtual scene.
65
+
66
+## Events
67
+
68
+A viewport is an [AREventTarget](ar-event-target.md). You can listen to the following events:
69
+
70
+### resize
71
+
72
+The viewport has been resized. This may happen when the user resizes the window of the web browser or when the mobile device is flipped.
73
+
74
+**Example**
75
+
76
+```js
77
+viewport.addEventListener('resize', event => {
78
+    console.log('The viewport has been resized.');
79
+});
80
+```

BIN
docs/assets/my-3d-model.glb Näytä tiedosto


BIN
docs/assets/my-reference-image.png Näytä tiedosto


BIN
docs/assets/my-reference-image.webp Näytä tiedosto


BIN
docs/assets/my-video.webm Näytä tiedosto


BIN
docs/assets/scan.png Näytä tiedosto


+ 5
- 0
docs/contact.md Näytä tiedosto

@@ -0,0 +1,5 @@
1
+# Contact
2
+
3
+Please ask your questions on [GitHub Discussions](https://github.com/alemart/martins-js/discussions){ ._blank }. Make sure that you search for the answers before requesting help.
4
+
5
+[:heart:{ .heart } Support my work](./support-my-work.md){ .md-button }

+ 126
- 0
docs/demos.md Näytä tiedosto

@@ -0,0 +1,126 @@
1
+---
2
+title: WebAR demos
3
+---
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-between;
12
+}
13
+
14
+.gallery-item {
15
+    text-align: center;
16
+    padding: 0;
17
+}
18
+
19
+.gallery-item:not(.gallery-item-3) img {
20
+    border-radius: 25px;
21
+}
22
+
23
+@media screen and (min-width: 600px) {
24
+    .gallery-item {
25
+        flex-basis: 40%;
26
+    }
27
+
28
+    .gallery-item-3 {
29
+        flex-basis: 30% !important;
30
+    }
31
+}
32
+
33
+@media screen and (min-width: 1220px) {
34
+    .gallery-item {
35
+        transition: transform 0.25s, opacity 0.25s;
36
+        opacity: 0.9;
37
+    }
38
+    .gallery-item:hover {
39
+        transform: scale(1.1);
40
+        opacity: 1.0;
41
+    }
42
+}
43
+</style>
44
+
45
+# WebAR demos
46
+
47
+Welcome to my demo gallery! Here you'll find some cool examples of what you can do with MARTINS.js. Feel free to adapt my demos and also to study my code. My demos are available for a fee, which helps my work.
48
+
49
+The Free Edition of MARTINS.js is included with my demos. The Professional Edition is available [separately](./download.md){ ._blank }. Before creating derivative works of my demos, make sure to [pick the right edition](./download.md){ ._blank } for you. If you have questions, feel free to [reach out](./contact.md){ ._blank }.
50
+
51
+## Glue codes
52
+
53
+MARTINS.js scans the physical environment, but it doesn't render virtual content. You need a 3D rendering technology for that. Glue codes link MARTINS.js to different 3D rendering technologies. My glue codes are compatible with both the Free and the Professional Edition of MARTINS.js.
54
+
55
+AFRAME is the easiest choice for non-coders. If you're a coder, all choices are good. A basic demo is included with all of them.
56
+
57
+<div class="gallery-grid" markdown>
58
+<div class="gallery-item gallery-item-3" markdown>
59
+<a href="https://ko-fi.com/s/24523f7548" rel="external" target="_blank">
60
+
61
+![](./img/logo-aframe.png "A-Frame logo by Mozilla")
62
+
63
+**AFRAME + MARTINS.js**
64
+
65
+</a>
66
+</div>
67
+<div class="gallery-item gallery-item-3" markdown>
68
+<a href="https://ko-fi.com/s/eea4077938" rel="external" target="_blank">
69
+
70
+
71
+![](./img/logo-threejs.png "Three.js logo by Mr.doob")
72
+
73
+**THREE.js + MARTINS.js**
74
+
75
+</a>
76
+</div>
77
+<div class="gallery-item gallery-item-3" markdown>
78
+
79
+![](./img/logo-babylonjs.png "Babylon.js logo by David Catuhe")
80
+
81
+**BABYLON.js + MARTINS.js (soon)**
82
+
83
+</div>
84
+</div>
85
+
86
+
87
+
88
+## For newbies
89
+
90
+These simple demos help you get started with WebAR. They are great learning material!
91
+
92
+<div class="gallery-grid" markdown>
93
+<div class="gallery-item" markdown>
94
+<a href="https://ko-fi.com/s/058542943d" rel="external" target="_blank">
95
+
96
+![](./img/demo-hello.webp)
97
+
98
+**Hello world with MARTINS.js**
99
+
100
+</a>
101
+</div>
102
+<div class="gallery-item" markdown>
103
+<a href="https://ko-fi.com/s/1d3c7e401c" rel="external" target="_blank">
104
+
105
+
106
+![](./img/demo-interactivity-three.jpg)
107
+
108
+**Touch interaction with THREE.js**
109
+
110
+</a>
111
+</div>
112
+</div>
113
+
114
+
115
+
116
+## Fun & games
117
+
118
+Soon!
119
+
120
+
121
+
122
+## Need something else?
123
+
124
+You need a WebAR experience tailored for you, but you are unable to do it yourself. Is that your situation? Feel free to make a request!
125
+
126
+[Request a WebAR experience](https://ko-fi.com/alemart/commissions){ ._blank .md-button }

+ 31
- 0
docs/download.md Näytä tiedosto

@@ -0,0 +1,31 @@
1
+# Download
2
+
3
+## Overview
4
+
5
+There are currently two editions of MARTINS.js: Free and Professional. The Free Edition is available to everyone. The Professional Edition is available to my supporters only.
6
+
7
+| |Free Edition|Professional Edition|
8
+|-|:----------:|:------------------:|
9
+|**Intended for**|Students, researchers, hobbyists, open-source developers|Freelancers, small software shops, small marketing agencies|
10
+|**License**|[AGPL 3.0](./license/agpl-3.0.md)|[Polyform Perimeter 1.0.0](./license/PolyForm-Perimeter-1.0.0-1.md)|
11
+|**Image tracking**|:heavy_check_mark:|:heavy_check_mark:|
12
+|**Commercial use in proprietary software**| |:heavy_check_mark:|
13
+|**Support**|<abbr title="via GitHub Discussions">Community</abbr>|<abbr title="via GitHub Discussions">Community</abbr>|
14
+|**Pricing**|Free of charge|Membership|
15
+||[Download for free](https://github.com/alemart/martins-js/releases){ .md-button .md-button--primary ._blank }|[:heart:{ .heart } Support my work](./support-my-work.md){ .md-button } |
16
+
17
+## Questions & answers
18
+
19
+### Which edition is right for me?
20
+
21
+If you're an individual doing personal experiments, a developer of free and open-source software, a student or a researcher, pick the Free Edition. If you're a freelancer, a small game studio, a small marketing or webdesign agency, or a similar business, pick the Professional Edition.
22
+
23
+### What about commercial use?
24
+
25
+The Free Edition is unsuitable for most commercial users. It's [AGPL](./license/agpl-3.0.md)-licensed: any software written with the Free Edition must be free as well. If you write non-free software, use the Professional Edition instead.
26
+
27
+You may use the Professional Edition to create various kinds of commercial, proprietary AR experiences. However, you may not sublicense it nor transfer your license to anyone. Additionally, you may not use it to create any product that competes with this software, not even a "as-a-service" style of product (e.g., SaaS). Please read the [license](./license/PolyForm-Perimeter-1.0.0-1.md) for more information.
28
+
29
+### Where can I ask questions?
30
+
31
+You can ask questions on [GitHub Discussions](https://github.com/alemart/martins-js/discussions){ ._blank }.

+ 298
- 0
docs/getting-started/activate-your-webcam.md Näytä tiedosto

@@ -0,0 +1,298 @@
1
+# Activate your webcam
2
+
3
+In this section we're going to learn how to use your webcam to capture the video. We're also going to polish our work and make it presentable to users.
4
+
5
+## Change the source of data
6
+
7
+Instead of using a video file, we're going to use your webcam. We simply need to change the source of data and instruct MARTINS.js to use your webcam. We'll do it with 1 new line of code!
8
+
9
+```js title="ar-demo.js" hl_lines="20-22"
10
+async function startARSession()
11
+{
12
+    if(!Martins.isSupported()) {
13
+        throw new Error(
14
+            'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
15
+            'Your user agent is ' + navigator.userAgent
16
+        );
17
+    }
18
+
19
+    const tracker = Martins.Tracker.ImageTracker();
20
+    await tracker.database.add([{
21
+        name: 'my-reference-image',
22
+        image: document.getElementById('my-reference-image')
23
+    }]);
24
+
25
+    const viewport = Martins.Viewport({
26
+        container: document.getElementById('ar-viewport')
27
+    });
28
+
29
+    //const video = document.getElementById('my-video'); // comment this line
30
+    //const source = Martins.Source.Video(video); // comment this line
31
+    const source = Martins.Source.Camera();
32
+
33
+    const session = await Martins.startSession({
34
+        mode: 'immersive',
35
+        viewport: viewport,
36
+        trackers: [ tracker ],
37
+        sources: [ source ],
38
+        stats: true,
39
+        gizmos: true,
40
+    });
41
+
42
+    return session;
43
+}
44
+```
45
+
46
+Let's also comment (or remove) the `<video>` tag from the HTML file - we no longer need it:
47
+
48
+```html title="index.html" hl_lines="14-16"
49
+<!doctype html>
50
+<html>
51
+    <head>
52
+        <meta charset="utf-8">
53
+        <meta name="viewport" content="width=device-width,initial-scale=1">
54
+        <title>MARTINS.js WebAR demo</title>
55
+        <script src="martins.js"></script>
56
+        <script src="ar-demo.js"></script>
57
+        <style>body { background-color: #3d5afe; }</style>
58
+    </head>
59
+    <body>
60
+        <div id="ar-viewport"></div>
61
+        <img id="my-reference-image" src="my-reference-image.webp" hidden>
62
+        <!--
63
+        <video id="my-video" src="my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
64
+        -->
65
+    </body>
66
+</html>
67
+```
68
+
69
+Open <http://localhost:8000>{ ._blank } and... ta-da! The web browser will ask for your permission to access the camera. Have fun. :wink:
70
+
71
+!!! warning "Before using a webcam"
72
+
73
+    Pay attention to the following:
74
+
75
+    1. Low-quality cameras should be avoided. A camera of a typical smartphone is probably good enough.
76
+    2. Don't move the camera / the target image too quickly, as quick movements produce motion blur.
77
+    3. Ensure good lighting conditions (see below).
78
+
79
+!!! tip "Check your physical scene"
80
+
81
+    Good lighting conditions are important for a good user experience. Even though the MARTINS.js can handle various lighting conditions, you should get your physical scene appropriately illuminated.
82
+
83
+    When developing your own WebAR experiences, ask yourself:
84
+    
85
+    * Will my users experience AR indoors? If so, make sure that the room is sufficiently illuminated.
86
+    * Will my users experience AR outdoors? In this case, make sure that users interact with your AR experience during the day, or have that interaction happen in a place with sufficient artificial lighting.
87
+
88
+    When printing your reference images, avoid shiny materials (e.g., glossy paper). They may generate artifacts in the image and interfere with the tracking. Prefer non-reflective materials.
89
+
90
+    If you're using a screen to display the reference image, make sure to adjust the brightness. Too much brightness causes overexposure and loss of detail, leading to tracking difficulties. Not enough brightness is also undesirable, because it makes the reference image look too dark in the video. Screen reflections are also undesirable.
91
+
92
+!!! warning "Use HTTPS"
93
+
94
+    When distributing your WebAR experiences over the internet, make sure to use HTTPS. Web browsers will only allow access to the webcam in secure contexts.
95
+
96
+Here is the reference image in case you need it again:
97
+
98
+<figure markdown>
99
+[![/assets/my-reference-image.webp](../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/"){ width=512 }](../assets/my-reference-image.webp){ ._blank }
100
+<figcaption>Reference Image</figure>
101
+</figure>
102
+
103
+
104
+## Create a scan gimmick
105
+
106
+Let's polish our work. When the tracker is scanning the physical scene, we'll display a visual cue suggesting the user to frame the target image. I'll call that a scan gimmick.
107
+
108
+Save the image below as [scan.png](../assets/scan.png){ ._blank }:
109
+
110
+<figure markdown>
111
+<span class="transparent-background" style="display:inline-block">
112
+[![scan.png](../assets/scan.png)](../assets/scan.png){ ._blank }
113
+</span>
114
+<figcaption>Scan gimmick</figcaption>
115
+</figure>
116
+
117
+In order to display that scan gimmick, we need to create a HUD. A HUD is an overlay used to display 2D content in front of the augmented scene. It's part of the viewport. Modify `index.html` and `ar-demo.js` as follows:
118
+
119
+```html title="index.html" hl_lines="10-13 16-20"
120
+<!doctype html>
121
+<html>
122
+    <head>
123
+        <meta charset="utf-8">
124
+        <meta name="viewport" content="width=device-width,initial-scale=1">
125
+        <title>MARTINS.js WebAR demo</title>
126
+        <!-- <script> tags of the rendering engine of your choice -->
127
+        <script src="martins.js"></script>
128
+        <script src="ar-demo.js"></script>
129
+        <style>
130
+        body { background-color: #3d5afe; }
131
+        #scan { width: 100%; height: 100%; object-fit: contain; opacity: 0.75; }
132
+        </style>
133
+    </head>
134
+    <body>
135
+        <div id="ar-viewport">
136
+            <div id="ar-hud" hidden>
137
+                <img id="scan" src="scan.png">
138
+            </div>
139
+        </div>
140
+        <img id="my-reference-image" src="my-reference-image.webp" hidden>
141
+        <!--
142
+        <video id="my-video" src="my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
143
+        -->
144
+    </body>
145
+</html>
146
+```
147
+
148
+```js title="ar-demo.js" hl_lines="17-18"
149
+async function startARSession()
150
+{
151
+    if(!Martins.isSupported()) {
152
+        throw new Error(
153
+            'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
154
+            'Your user agent is ' + navigator.userAgent
155
+        );
156
+    }
157
+
158
+    const tracker = Martins.Tracker.ImageTracker();
159
+    await tracker.database.add([{
160
+        name: 'my-reference-image',
161
+        image: document.getElementById('my-reference-image')
162
+    }]);
163
+
164
+    const viewport = Martins.Viewport({
165
+        container: document.getElementById('ar-viewport'),
166
+        hudContainer: document.getElementById('ar-hud')
167
+    });
168
+
169
+    //const video = document.getElementById('my-video');
170
+    //const source = Martins.Source.Video(video);
171
+    const source = Martins.Source.Camera();
172
+
173
+    const session = await Martins.startSession({
174
+        mode: 'immersive',
175
+        viewport: viewport,
176
+        trackers: [ tracker ],
177
+        sources: [ source ],
178
+        stats: true,
179
+        gizmos: true,
180
+    });
181
+
182
+    return session;
183
+}
184
+```
185
+
186
+Open <http://localhost:8000>{ ._blank }. Now you can see the scan gimmick being displayed... all the time?!
187
+
188
+## Configure the scan gimmick
189
+
190
+The scan gimmick should only be displayed when the tracker is scanning the physical scene. We should hide it as soon as a target image is recognized. If the tracking is lost, then we need to display it again because we're back in scanning mode.
191
+
192
+A simple way to know whether or not we're tracking a target image is to use events. We're going to add two event listeners to our tracker. If a  `targetfound` event happens, we hide the scan gimmick. If a `targetlost` event happens, we show the scan gimmick again.
193
+
194
+```js title="ar-demo.js" hl_lines="34-42"
195
+async function startARSession()
196
+{
197
+    if(!Martins.isSupported()) {
198
+        throw new Error(
199
+            'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
200
+            'Your user agent is ' + navigator.userAgent
201
+        );
202
+    }
203
+
204
+    const tracker = Martins.Tracker.ImageTracker();
205
+    await tracker.database.add([{
206
+        name: 'my-reference-image',
207
+        image: document.getElementById('my-reference-image')
208
+    }]);
209
+
210
+    const viewport = Martins.Viewport({
211
+        container: document.getElementById('ar-viewport'),
212
+        hudContainer: document.getElementById('ar-hud')
213
+    });
214
+
215
+    //const video = document.getElementById('my-video');
216
+    //const source = Martins.Source.Video(video);
217
+    const source = Martins.Source.Camera();
218
+
219
+    const session = await Martins.startSession({
220
+        mode: 'immersive',
221
+        viewport: viewport,
222
+        trackers: [ tracker ],
223
+        sources: [ source ],
224
+        stats: true,
225
+        gizmos: true,
226
+    });
227
+
228
+    const scan = document.getElementById('scan');
229
+
230
+    tracker.addEventListener('targetfound', event => {
231
+        scan.hidden = true;
232
+    });
233
+
234
+    tracker.addEventListener('targetlost', event => {
235
+        scan.hidden = false;
236
+    });
237
+
238
+    return session;
239
+}
240
+```
241
+
242
+## Hide the gizmos
243
+
244
+Let's polish our work even more by hiding the gizmos. You may just set `gizmos` to `false` in `Martins.startSession()` and there will be no more gizmos. Do the same to hide the stats panel.
245
+
246
+Let me show you a different approach. Instead of getting rid of the gizmos completely, we're going to hide them partially. They will be displayed when the tracker is scanning the physical scene, but not when the physical scene is being augmented. That's easy to do with the event listeners we have just set up:
247
+
248
+```js title="ar-demo.js" hl_lines="38 43"
249
+async function startARSession()
250
+{
251
+    if(!Martins.isSupported()) {
252
+        throw new Error(
253
+            'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
254
+            'Your user agent is ' + navigator.userAgent
255
+        );
256
+    }
257
+
258
+    const tracker = Martins.Tracker.ImageTracker();
259
+    await tracker.database.add([{
260
+        name: 'my-reference-image',
261
+        image: document.getElementById('my-reference-image')
262
+    }]);
263
+
264
+    const viewport = Martins.Viewport({
265
+        container: document.getElementById('ar-viewport'),
266
+        hudContainer: document.getElementById('ar-hud')
267
+    });
268
+
269
+    //const video = document.getElementById('my-video');
270
+    //const source = Martins.Source.Video(video);
271
+    const source = Martins.Source.Camera();
272
+
273
+    const session = await Martins.startSession({
274
+        mode: 'immersive',
275
+        viewport: viewport,
276
+        trackers: [ tracker ],
277
+        sources: [ source ],
278
+        stats: true,
279
+        gizmos: true,
280
+    });
281
+
282
+    const scan = document.getElementById('scan');
283
+
284
+    tracker.addEventListener('targetfound', event => {
285
+        scan.hidden = true;
286
+        session.gizmos.visible = false;
287
+    });
288
+
289
+    tracker.addEventListener('targetlost', event => {
290
+        scan.hidden = false;
291
+        session.gizmos.visible = true;
292
+    });
293
+
294
+    return session;
295
+}
296
+```
297
+
298
+Open <http://localhost:8000>{ ._blank } again. Enjoy your WebAR experience! :wink:

+ 63
- 0
docs/getting-started/concepts.md Näytä tiedosto

@@ -0,0 +1,63 @@
1
+# Concepts
2
+
3
+Before diving into AR with you, I need to introduce a few concepts. Please take the time to read them all. Feel free to come back to this page at any time.
4
+
5
+## Fundamental concepts
6
+
7
+Let me clarify what I mean by terms such as Augmented Reality and WebAR:
8
+
9
+1. **Augmented Reality** is the augmentation of physical reality with virtual elements. We typically augment physical reality with imagery generated by computer graphics. In this context, the word augment means: to blend the physical and the virtual imagery in a visually correlated manner.
10
+
11
+    1.1. **AR** is an abbreviation of Augmented Reality.
12
+
13
+2. An **Augmented Reality experience** is a computer program designed to let users directly experience Augmented Reality[^1]. Augmented Reality experiences come in different shapes. Some are designed for smartphones and tablets, others for special headsets, and so on.
14
+
15
+3. **WebAR** is a set of technologies used to create Augmented Reality experiences that run in web browsers. WebAR makes it easy for users to experience AR, because they can have immediate access to the AR experiences. All they have to do is open a web page. They are not tied to specific platforms and they also don't need to download apps.
16
+
17
+4. A **WebAR experience** is an Augmented Reality experience developed using WebAR technology.
18
+
19
+5. **MARTINS.js** is a WebAR technology. I also call it a WebAR engine. Lots of computations have to be performed behind the scenes in order to make an Augmented Reality experience possible. MARTINS.js uses the GPU[^2] to accelerate many of those computations. In fact, the GPU and the CPU[^3] are used together. This approach improves the performance of the WebAR experience and ultimately leads to a better user experience.
20
+
21
+Now that those terms are clarified, I say this: you can use MARTINS.js to create amazing WebAR experiences! :wink:
22
+
23
+[^1]: This definition of AR experience is convenient in different ways. For example, it makes the term "WebAR experience", which is arguably better than "WebAR app" (no apps are downloaded), well-defined. I make a distinction between AR experience and experience of AR. An experience of AR is an event in consciousness in which AR is experienced. I sometimes use the latter definition.
24
+[^2]: Graphics Processing Unit
25
+[^3]: Central Processing Unit
26
+
27
+## Practical concepts
28
+
29
+Let me explain some concepts that you'll see over and over again when developing WebAR experiences with MARTINS.js:
30
+
31
+1. The experience of Augmented Reality is created by augmenting the physical scene with the virtual scene.
32
+
33
+    1.1. The **physical scene** is a scene of the physical world.
34
+
35
+    1.2. The **virtual scene** is a scene generated by computer graphics.
36
+
37
+    1.3. The **augmented scene** is the physical scene augmented with the virtual scene.
38
+
39
+2. A **session** is a central component of a WebAR experience. It handles the **main loop**. The main loop performs two central tasks: it analyzes the input data and then passes the result of that analysis to the user callback.
40
+
41
+    2.1. The **user callback** is a function that updates and renders the virtual scene.
42
+    
43
+    2.2. The main loop is repeated until the session ends. The session ends when the user closes the web page, or by deliberate command.
44
+
45
+3. A session has one or more **sources of data** linked to it. A typical source of data is a video stream. Such a stream usually comes from a webcam or from a video file.
46
+
47
+    3.1. A source of data produces **input data**.
48
+
49
+4. A **tracker** is a subsystem of the WebAR engine that analyzes input data in some way. Trackers are meant to be attached to a session. Example: an image tracker is a type of tracker. If we attach an image tracker to a session, then we will be able to track images in that session.
50
+
51
+5. The user callback receives a **frame**. A frame is an object that holds data for rendering the virtual scene in a way that is consistent with the input data at a particular moment in time. Simply put, frames help us augment the physical scene with the virtual scene.
52
+
53
+    5.1. The data held by a frame is computed by the trackers that are attached to the session.
54
+
55
+6. A session is linked to a **viewport**. The viewport is the area in which we'll display the augmented scene. It's represented by a container defined by a suitable HTML element, typically a `<div>`.
56
+
57
+7. A session has a **mode**. The mode can be either immersive or inline.
58
+
59
+    7.1. In immersive mode, the augmented scene is displayed in such a way that it occupies, in a best-fit manner, the entire area of the screen in which the web page is shown. Think of it as a kind of fullscreen. The immersive mode is what is typically wanted.
60
+    
61
+    7.2. In inline mode, the augmented scene is displayed in a way that is consistent with the typical flow of a web page. We can display the augmented scene in a web page such as this one - in the middle of text, links and other elements.
62
+
63
+Did you read it all? Cool, so let's create our first WebAR experience! It gets to be fun, I promise! :wink:

+ 114
- 0
docs/getting-started/create-the-augmented-scene.md Näytä tiedosto

@@ -0,0 +1,114 @@
1
+# Create the augmented scene
2
+
3
+Now that the image is being tracked, the next step is to render a virtual scene on top of it. You need a 3D rendering technology to do that.
4
+
5
+## Pick a 3D rendering technology
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.
26
+
27
+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
+
29
+## Write the glue code
30
+
31
+Writing a glue code 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 glue code that works correctly.
32
+
33
+I provide easy-to-use glue codes that work with different 3D rendering technologies in my demos, so that you don't need to deal with the complexity. Those glue codes are JavaScript (.js) files. You just need to add a glue code to your web page (e.g., via a `<script>` tag) and then the integration will be done for you. It's really that simple! Also, my glue codes may be used in both free and non-free projects.
34
+
35
+[Get the glue codes in my demos](../demos.md){ .md-button ._blank }
36
+
37
+## Create the virtual scene
38
+
39
+Once you plug in the glue code, you'll be using the 3D rendering technology of your choice to create the virtual scene. The physical scene will be automatically augmented with the virtual scene, thus creating the augmented scene.
40
+
41
+<figure markdown>
42
+<video src="../../img/demo-cool2.webm" poster="../../img/demo-cool2.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
43
+<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>
44
+</figure>
45
+
46
+<figure markdown>
47
+<video src="../../img/demo-cool.webm" poster="../../img/demo-cool.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
48
+<figcaption markdown>A similar augmented scene viewed from a different perspective</figcaption>
49
+</figure>
50
+
51
+Let me tell you a bit more about the 3D rendering technologies I just mentioned.
52
+
53
+### A-Frame
54
+
55
+[A-Frame](https://aframe.io){ ._blank } is an open-source framework used to build virtual reality (VR) experiences for the web. When you combine it with MARTINS.js, you become able to use it to create AR experiences too - without the need of special hardware or software.
56
+
57
+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!
58
+
59
+A-Frame is easy for beginners and pleasing for experts. A simple scene is declared like this:
60
+
61
+```html title="index.html" hl_lines="7 10 18-31"
62
+<!doctype html>
63
+<html>
64
+    <head>
65
+        <meta charset="utf-8">
66
+        <meta name="viewport" content="width=device-width,initial-scale=1">
67
+        <title>MARTINS.js WebAR demo</title>
68
+        <script src="aframe-vX.Y.Z.min.js"></script>
69
+        <script src="martins.js"></script>
70
+        <script src="ar-demo.js"></script>
71
+        <script src="plug in my glue code here"></script>
72
+        <style>body { background-color: #3d5afe; }</style>
73
+    </head>
74
+    <body>
75
+        <div id="ar-viewport"></div>
76
+        <img id="my-reference-image" src="my-reference-image.webp" hidden>
77
+        <video id="my-video" src="my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
78
+
79
+        <!-- This is a scene -->
80
+        <a-scene ar-scene>
81
+            <a-camera ar-camera></a-camera>
82
+
83
+            <!-- Whatever you add to <ar-root> will appear in AR -->
84
+            <ar-root>
85
+                <a-entity gltf-model="#my-3d-model"></a-entity>
86
+            </ar-root>
87
+
88
+            <!-- Declare external media files here -->
89
+            <a-assets>
90
+                <a-asset-item id="my-3d-model" src="my-3d-model.glb"></a-asset-item>
91
+            </a-assets>
92
+        </a-scene>
93
+
94
+    </body>
95
+</html>
96
+```
97
+
98
+`<ar-root>` is not part of A-Frame, but it becomes available as soon as you plug in my glue code.
99
+
100
+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.
101
+
102
+### Babylon.js
103
+
104
+[Babylon.js](https://www.babylonjs.com){ ._blank } is a powerful open-source game and 3D rendering engine for the web. It includes pretty much all features you commonly find in 3D rendering engines (scene graphs, lights, materials, meshes, etc.), plus systems that are specific to game engines (animation engine, audio engine, collision system, physics system, support for sprites, etc.), plus all kinds of sophisticated features for various applications.
105
+
106
+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.
107
+
108
+### Three.js
109
+
110
+[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.
111
+
112
+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.
113
+
114
+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.

+ 56
- 0
docs/getting-started/guidelines-for-images.md Näytä tiedosto

@@ -0,0 +1,56 @@
1
+# Guidelines for Reference Images
2
+
3
+Some images are more suitable for tracking than others. For best results, pick images that are distinct, asymmetric and detailed. Let me show you some examples.
4
+
5
+## Distinct
6
+
7
+A distinct image has distinguishable areas - quite unlike a repetitive pattern!
8
+
9
+| Distinct :heavy_check_mark: | Not distinct :x: |
10
+| --------------------------- | ---------------- |
11
+| [![](../img/guidelines-for-images-10.jpg "Based on free image from https://pixabay.com/pt/illustrations/unic%c3%b3rnio-gal%c3%a1xia-fantasia-estrela-3115021/ (Tarishart)")](../img/guidelines-for-images-10.jpg){ ._blank } | [![](../img/guidelines-for-images-1.jpg "Free image from https://www.pexels.com/pt-br/foto/papel-de-parede-abstrato-roxo-e-azul-430207/ (Scott Webb)")](../img/guidelines-for-images-1.jpg){ ._blank } |
12
+| [![](../img/guidelines-for-images-9.jpg "Based on free images from https://pixabay.com/pt/illustrations/o-macaco-chimpanz%c3%a9-macaco-banana-4701265/ (Dmitry Abramov) and https://pixabay.com/pt/vectors/panorama-crep%c3%basculo-luz-noite-c%c3%a9u-1844227/ (Wild0ne)")](../img/guidelines-for-images-9.jpg){ ._blank } | [![](../img/guidelines-for-images-4.jpg "Free image from https://www.pexels.com/pt-br/foto/imagem-completa-da-estrutura-arquitetonica-248921/ (Pixabay)")](../img/guidelines-for-images-4.jpg){ ._blank } |
13
+
14
+## Asymmetric
15
+
16
+Asymmetric images help the engine determine their orientation. When evaluating symmetry, you must not take colors into account.
17
+
18
+| Asymmetric :heavy_check_mark: | Symmetric :x: |
19
+| ----------------------------- | ------------- |
20
+| [![](../img/guidelines-for-images-12.jpg "Free image from https://www.pexels.com/pt-br/foto/gatinho-branco-e-cinza-cheirando-flor-da-margarida-branca-1472999/ (Alex Bargain)")](../img/guidelines-for-images-12.jpg){ ._blank } | [![](../img/guidelines-for-images-2.jpg "Free image from https://www.pexels.com/pt-br/foto/frutas-citricas-brancas-vermelhas-e-amarelas-1415734/ (Aleksandar Pasaric)")](../img/guidelines-for-images-2.jpg){ ._blank } |
21
+| [![](../img/guidelines-for-images-11.jpg "Based on free image from https://pixabay.com/pt/photos/sof%c3%a1-surreal-olhos-cachorro-arte-749629/ (0fjd125gk87)")](../img/guidelines-for-images-11.jpg){ ._blank } | [![](../img/guidelines-for-images-5.jpg "Free image from https://www.pexels.com/pt-br/foto/lapis-de-cor-amarelo-e-azul-1762851/ (Ann H)")](../img/guidelines-for-images-5.jpg){ ._blank } |
22
+
23
+## Detailed
24
+
25
+A detailed image has lots of details with sufficient contrast. There's not much blank space!
26
+
27
+| Detailed :heavy_check_mark: | Not detailed :x: |
28
+| ---------------------------------- | ----------------------- |
29
+| [![](../img/guidelines-for-images-3.jpg "Free image from https://www.pexels.com/pt-br/foto/pagode-verde-321900/ (Anthony)")](../img/guidelines-for-images-3.jpg){ ._blank } | [![](../img/guidelines-for-images-7.jpg "Free image from https://www.pexels.com/pt-br/foto/6985119/ (Gradienta)")](../img/guidelines-for-images-7.jpg){ ._blank } |
30
+| [![](../img/guidelines-for-images-8.jpg "Free image from https://www.pexels.com/pt-br/foto/fotografia-de-close-up-de-arara-azul-e-amarela-1453550/ (Susanne Jutzeler)")](../img/guidelines-for-images-8.jpg){ ._blank } | [![](../img/guidelines-for-images-6.jpg "Free image from https://unsplash.com/photos/KF-r4-KM9pM (Gian Gomez)")](../img/guidelines-for-images-6.jpg){ ._blank } |
31
+
32
+## Other considerations
33
+
34
+### Aspect ratio
35
+
36
+Prefer images whose aspect ratio (the ratio _width &divide; height_) is somewhere between the aspect ratio of the target device (16:9 is a common aspect ratio) and 1:1 (a square). It's okay to use landscape or portrait mode - the engine will make the necessary adjustments.
37
+
38
+### Resolution
39
+
40
+Using a Ultra HD image is of no benefit, because the engine will downscale it. A tiny image isn't desirable either, because some details may be lost and the engine will likely have to upscale it. Use an image that has its details preserved. It's even better if that image can be loaded quickly!
41
+
42
+### Physical materials
43
+
44
+When printing your images, keep the following in mind:
45
+
46
+- Prefer non-reflective materials. Avoid shiny materials such as glossy paper. Reflections may generate artifacts in the video and interfere with the tracking.
47
+- Materials should be rigid. Don't use something that can be distorted too easily.
48
+- Use quality materials.
49
+
50
+### Brightness on screens
51
+
52
+If you're using a screen to display your images, make sure to adjust its 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.
53
+
54
+### Test it!
55
+
56
+In addition to the guidelines presented above, you should always experiment with your images and make sure it all works as intended. Keep in mind that proper lighting of the physical environment is also very important!

+ 23
- 0
docs/getting-started/index.md Näytä tiedosto

@@ -0,0 +1,23 @@
1
+# Welcome to MARTINS.js!
2
+
3
+**MARTINS.js** is a GPU-accelerated Augmented Reality engine for the web. It's a standalone WebAR technology for creating AR experiences that run in web browsers. Users don't need specialized hardware nor dedicated software - only a modern and compatible web browser.
4
+
5
+[Get started with WebAR](./introduction.md){ .md-button .md-button--primary }
6
+
7
+## Why use MARTINS.js?
8
+
9
+Here is why MARTINS.js is a great choice for creating Augmented Reality experiences:
10
+
11
+* **No need to download apps!** MARTINS.js is a WebAR engine. It runs in web browsers. Users can access the AR experience immediately.
12
+* **Fast and powerful!** MARTINS.js is GPU-accelerated. It uses WebGL2 and WebAssembly for turbocharged performance.
13
+* **No need of custom hardware or software!** MARTINS.js is built from scratch using standard web technologies. All it requires is a modern and compatible web browser.
14
+* **Fully standalone!** MARTINS.js has in it everything it needs to analyze the environment and help you create AR. There are no additional requirements.
15
+* **Easy to get started!** MARTINS.js can be used with a `<script>` tag in your page. A static HTML page is enough to get started.
16
+
17
+[Check out my WebAR demos](../demos.md){ .md-button }
18
+
19
+## Author
20
+
21
+MARTINS.js is developed by me, [Alexandre Martins](https://github.com/alemart){ ._blank }, a computer scientist from Brazil. This project is dual-licensed. The Free Edition, available to everyone, is licensed under the [AGPL 3.0](../license/agpl-3.0.md). The Professional Edition, available to my supporters, is licensed under the [Polyform Perimeter 1.0.0](../license/PolyForm-Perimeter-1.0.0-1.md).
22
+
23
+[:heart:{ .heart } Support my work](../support-my-work.md){ .md-button }

+ 22
- 0
docs/getting-started/introduction.md Näytä tiedosto

@@ -0,0 +1,22 @@
1
+# Introduction
2
+
3
+Augmented Reality (AR) has applications in many fields, including: games, marketing, commerce, education, arts, tourism, sports, healthcare, and so on. AR brings many exciting possibilities for creative projects - and you too can get into it!
4
+
5
+Traditionally, users were required to download (sometimes large) apps to experience AR. That was an obstacle for adoption. What if we dropped the need for apps and just required a web browser instead? Users already have web browsers! That's where WebAR comes in.
6
+
7
+<figure markdown>
8
+<video src="../../img/demo-cool.webm" poster="../../img/demo-cool.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
9
+<figcaption>A WebAR demo created with MARTINS.js</figcaption>
10
+</figure>
11
+
12
+## What to expect from this guide
13
+
14
+We will create together an Augmented Reality experience that runs in web browsers. You will learn how to track an image in real-time. This is a common use case of Augmented Reality technology.
15
+
16
+No matter if you are a beginner, an expert, or somewhere in-between, set yourself at ease: this step-by-step guide can be followed by you.
17
+
18
+<figure markdown>
19
+<video src="../../img/demo-cool3.webm" poster="../../img/demo-cool3.webp" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
20
+<figcaption>Augmented Reality based on Image Tracking</figcaption>
21
+</figure>
22
+

+ 95
- 0
docs/getting-started/next-steps.md Näytä tiedosto

@@ -0,0 +1,95 @@
1
+# Next steps
2
+
3
+Congratulations! You have created your first WebAR experience with MARTINS.js! :sunglasses:
4
+
5
+Let me tell you some of the steps you can take from now on.
6
+
7
+## Change the power preference
8
+
9
+Image tracking is no trivial task: lots of computations are being performed behind the scenes. The WebAR engine prioritizes processing performance over power consumption by default. You may reduce power consumption by reducing processing performance. This is simple to do: just set `Martins.Settings.powerPreference` to `"low-power"`.
10
+
11
+```js title="ar-demo.js" hl_lines="10"
12
+async function startARSession()
13
+{
14
+    if(!Martins.isSupported()) {
15
+        throw new Error(
16
+            'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
17
+            'Your user agent is ' + navigator.userAgent
18
+        );
19
+    }
20
+
21
+    Martins.Settings.powerPreference = 'low-power'; // OPTIONAL
22
+
23
+    const tracker = Martins.Tracker.ImageTracker();
24
+    await tracker.database.add([{
25
+        name: 'my-reference-image',
26
+        image: document.getElementById('my-reference-image')
27
+    }]);
28
+
29
+    const viewport = Martins.Viewport({
30
+        container: document.getElementById('ar-viewport'),
31
+        hudContainer: document.getElementById('ar-hud')
32
+    });
33
+
34
+    //const video = document.getElementById('my-video');
35
+    //const source = Martins.Source.Video(video);
36
+    const source = Martins.Source.Camera();
37
+
38
+    const session = await Martins.startSession({
39
+        mode: 'immersive',
40
+        viewport: viewport,
41
+        trackers: [ tracker ],
42
+        sources: [ source ],
43
+        stats: true,
44
+        gizmos: true,
45
+    });
46
+
47
+    const scan = document.getElementById('scan');
48
+
49
+    tracker.addEventListener('targetfound', event => {
50
+        scan.hidden = true;
51
+        session.gizmos.visible = false;
52
+    });
53
+
54
+    tracker.addEventListener('targetlost', event => {
55
+        scan.hidden = false;
56
+        session.gizmos.visible = true;
57
+    });
58
+
59
+    return session;
60
+}
61
+```
62
+
63
+When you enable low-power mode, the WebAR engine will target a framerate of 30. In many cases, this is still acceptable for a good user experience. I suggest you test both ways!
64
+
65
+I emphasize that you are **not** required to enable low-power mode. Enable it if power consumption is an issue for you. If it isn't, you may also experiment with the `"high-performance"` mode.
66
+
67
+!!! question "When should I use low-power mode?"
68
+
69
+    If you're targeting mobile devices, test your WebAR experiences with low-power mode. If you decide that the lower framerate is still acceptable, keep the low-power mode in order to save battery life.
70
+
71
+## Add multiple virtual scenes
72
+
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
+
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.
76
+
77
+## Publish your WebAR experiences
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!
80
+
81
+!!! tip "Tip: use a QR code"
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:
84
+
85
+!!! tip "Use the minified code"
86
+
87
+    When deploying your WebAR experiences, make sure to include the minified `martins.min.js` file instead of the regular `martins.js`. The latter is suitable for development. The former, for production.
88
+
89
+## Support my work
90
+
91
+If you came this far in the guide, WebAR probably excites you. It is definitely something you want. I know, it is awesome! The possibilities are endless. Even better than getting your creative juices boiling with enthusiasm is the feeling of joy I have for sharing this work with you.
92
+
93
+Do you want more WebAR? Help me bring you more! Creating this WebAR engine has been a **huge** personal effort that required time, skill and highly specialized knowledge. Please support my work, so that I'm able to continue it and make it even more awesome!
94
+
95
+[:heart:{ .heart } Support my work](../support-my-work.md){ .md-button }

+ 37
- 0
docs/getting-started/questions-and-answers.md Näytä tiedosto

@@ -0,0 +1,37 @@
1
+# Questions & Answers
2
+
3
+## What is MARTINS.js?
4
+
5
+MARTINS.js is a GPU-accelerated Augmented Reality engine for the web. It's a standalone WebAR technology for creating AR experiences that run in web browsers. Users don't need specialized hardware nor dedicated software - only a modern and compatible web browser.
6
+
7
+MARTINS is a recursive acronym for MARTINS Augmented Reality Technology for Internet Software. It also happens to be my name. See, AR is part of my name. Can you believe it? :sunglasses:
8
+
9
+## What is WebAR?
10
+
11
+Refer to the [concepts](./concepts.md).
12
+
13
+## Is this WebXR?
14
+
15
+No, MARTINS.js is not WebXR. The WebXR API allows you to access functionalities of VR and AR-capable devices in web browsers. It relies on other technologies, such as Google's ARCore or Apple's ARKit, to run the show. Those technologies are great, but they are supported on specific devices, which may or may not match your users' devices. On the other hand, MARTINS.js is fully standalone and is built from scratch using standard web technologies such as WebGL2 and WebAssembly, which are widely available. My intention is to give it broad compatibility.
16
+
17
+## Why do my models appear "laid down" in AR?
18
+
19
+MARTINS.js uses a right-handed coordinate system with the Z-axis pointing "up". The same convention is used in [Blender](https://www.blender.org){ ._blank }. When exporting your own models, make sure that the Z-axis points "up" and that the ground plane is the XY-plane. If your models appear "laid down" in AR, this is probably the issue.
20
+
21
+!!! info "Fix with code"
22
+
23
+    Fixing the orientation of the model is the preferred solution. However, you can also fix the issue with code: add a node (entity) to the scene graph and make it rotate its children by 90 degrees around the x-axis.
24
+
25
+## What about browser compatibility?
26
+
27
+MARTINS.js is currently compatible with the latest versions of almost all major web browsers:
28
+
29
+| Chrome | Edge | Firefox | Opera | Safari |
30
+|:------:|:----:|:-------:|:-----:|:------:|
31
+| :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | - |
32
+
33
+At the time of this writing, Safari is not yet compatible. MARTINS.js requires WebGL2 and WebAssembly.
34
+
35
+## I love WebAR!
36
+
37
+I know! :wink:

+ 101
- 0
docs/getting-started/set-up-a-web-server.md Näytä tiedosto

@@ -0,0 +1,101 @@
1
+# Set up a web server
2
+
3
+Let's prepare our local environment in order to create our first WebAR experience.
4
+
5
+We're going to use the Free Edition of MARTINS.js in this guide. The Free Edition is suitable for personal study, educational purposes and open-source projects. More information [in this link](../download.md){ ._blank }.
6
+
7
+## Create a file structure
8
+
9
+Let's create a file structure for our AR experience:
10
+
11
+1. Create a new folder called `ar-demo` in your filesystem
12
+2. Download the [latest release of MARTINS.js](../download.md){ ._blank } and extract `dist/martins.js` to `ar-demo/`
13
+3. Create a new empty file called `index.html` and store it in `ar-demo/`
14
+
15
+You will have the following file structure:
16
+
17
+    ar-demo/
18
+    ├── index.html
19
+    └── martins.js
20
+
21
+## Add boilerplate code
22
+
23
+Use the code editor of your choice to write the following content to `index.html`:
24
+
25
+```html title="index.html"
26
+<!doctype html>
27
+<html>
28
+    <head>
29
+        <meta charset="utf-8">
30
+        <meta name="viewport" content="width=device-width,initial-scale=1">
31
+        <title>MARTINS.js WebAR demo</title>
32
+        <script src="martins.js"></script>
33
+        <style>body { background-color: #3d5afe; }</style>
34
+    </head>
35
+    <body>
36
+    </body>
37
+</html>
38
+```
39
+
40
+## Set up a local web server
41
+
42
+Let's set up a local web server in your machine for development purposes. I'll be showing you an easy-to-follow approach. Feel free to use a different approach if you're an experienced web developer.
43
+
44
+=== "Graphical interface"
45
+
46
+    This is an easy solution that works on Windows, Linux and macOS:
47
+
48
+    1. [Download and run Servez](https://greggman.github.io/servez/){ ._blank }, a simple web server for local web development.
49
+    2. In _Folder to Serve_, specify the `ar-demo` folder we have just created.
50
+    3. Change the _Port_ to **8000**.
51
+    4. Click on _Start_ to launch the local web server.
52
+    5. Click on _Launch Browser_ to open a web browser at <http://localhost:8000>{ ._blank }.
53
+
54
+    <figure markdown>
55
+    ![Servez](../img/servez.png){ width=600 }
56
+    <figcaption>Setting up Servez: make sure that _Folder to Serve_ points to the correct path in your filesystem!</figcaption>
57
+    </figure>
58
+
59
+=== "Command line"
60
+
61
+    If you're familiar with the command line, you can use programs such as `python`, `node` or `php` to launch a local web server. Navigate to the `ar-demo` directory and then run:
62
+
63
+    === "Python 2"
64
+
65
+        ```sh
66
+        python -m SimpleHTTPServer 8000
67
+        ```
68
+
69
+    === "Python 3"
70
+
71
+        ```sh
72
+        python3 -m http.server 8000
73
+        ```
74
+
75
+    === "Node.js"
76
+
77
+        ```sh
78
+        npx http-server -p 8000
79
+        ```
80
+
81
+    === "PHP"
82
+
83
+        ```sh
84
+        php -S localhost:8000
85
+        ```
86
+
87
+    Next, open your web browser and go to <http://localhost:8000>{ ._blank }.
88
+
89
+
90
+You should see a blue screen in your web browser:
91
+
92
+<figure markdown>
93
+[![Expected web page](../img/page-with-nothing.webp)](../img/page-with-nothing.webp){ ._blank }
94
+<figcaption>Blue Screen of Success</figcaption>
95
+</figure>
96
+
97
+If you see that blue screen, you're ready to proceed. If not, review your settings.
98
+
99
+!!! info "Why port 8000?"
100
+
101
+    Port 8000 is commonly used in web development. Although you may use a different port, I suggest that you stick to this convention throughout this guide.

+ 225
- 0
docs/getting-started/set-up-the-session.md Näytä tiedosto

@@ -0,0 +1,225 @@
1
+# Set up the session
2
+
3
+Now we're going to track our reference image for the first time! :sunglasses:
4
+
5
+## Create the viewport
6
+
7
+We begin by creating the viewport. Remember that the viewport is the area in which we'll display the augmented scene. Add the following to `index.html` and to `ar-demo.js`:
8
+
9
+```html title="index.html" hl_lines="12"
10
+<!doctype html>
11
+<html>
12
+    <head>
13
+        <meta charset="utf-8">
14
+        <meta name="viewport" content="width=device-width,initial-scale=1">
15
+        <title>MARTINS.js WebAR demo</title>
16
+        <script src="martins.js"></script>
17
+        <script src="ar-demo.js"></script>
18
+        <style>body { background-color: #3d5afe; }</style>
19
+    </head>
20
+    <body>
21
+        <div id="ar-viewport"></div>
22
+        <img id="my-reference-image" src="my-reference-image.webp" hidden>
23
+        <video id="my-video" src="my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
24
+    </body>
25
+</html>
26
+```
27
+
28
+```js title="ar-demo.js" hl_lines="17-19"
29
+window.onload = async function()
30
+{
31
+    try {
32
+        if(!Martins.isSupported()) {
33
+            throw new Error(
34
+                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
35
+                'Your user agent is ' + navigator.userAgent
36
+            );
37
+        }
38
+
39
+        const tracker = Martins.Tracker.ImageTracker();
40
+        await tracker.database.add([{
41
+            name: 'my-reference-image',
42
+            image: document.getElementById('my-reference-image')
43
+        }]);
44
+
45
+        const viewport = Martins.Viewport({
46
+            container: document.getElementById('ar-viewport')
47
+        });
48
+    }
49
+    catch(error) {
50
+        alert(error.message);
51
+    }
52
+};
53
+```
54
+
55
+## Create the source of data
56
+
57
+Let's set up our source of data. We get the `HTMLVideoElement` corresponding to the test video and then we use it to instantiate a video source of data. Write the following to `ar-demo.js`:
58
+
59
+```js title="ar-demo.js" hl_lines="21-22"
60
+window.onload = async function()
61
+{
62
+    try {
63
+        if(!Martins.isSupported()) {
64
+            throw new Error(
65
+                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
66
+                'Your user agent is ' + navigator.userAgent
67
+            );
68
+        }
69
+
70
+        const tracker = Martins.Tracker.ImageTracker();
71
+        await tracker.database.add([{
72
+            name: 'my-reference-image',
73
+            image: document.getElementById('my-reference-image')
74
+        }]);
75
+
76
+        const viewport = Martins.Viewport({
77
+            container: document.getElementById('ar-viewport')
78
+        });
79
+
80
+        const video = document.getElementById('my-video');
81
+        const source = Martins.Source.Video(video);
82
+    }
83
+    catch(error) {
84
+        alert(error.message);
85
+    }
86
+};
87
+```
88
+
89
+## Start the session
90
+
91
+The session is a central component of a WebAR experience. The `Martins` namespace has a very special method called `startSession`. It receives a settings dictionary that lets us configure the new session in different ways. Add the following code to `ar-demo.js`:
92
+
93
+```js title="ar-demo.js" hl_lines="24-31"
94
+window.onload = async function()
95
+{
96
+    try {
97
+        if(!Martins.isSupported()) {
98
+            throw new Error(
99
+                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
100
+                'Your user agent is ' + navigator.userAgent
101
+            );
102
+        }
103
+
104
+        const tracker = Martins.Tracker.ImageTracker();
105
+        await tracker.database.add([{
106
+            name: 'my-reference-image',
107
+            image: document.getElementById('my-reference-image')
108
+        }]);
109
+
110
+        const viewport = Martins.Viewport({
111
+            container: document.getElementById('ar-viewport')
112
+        });
113
+
114
+        const video = document.getElementById('my-video');
115
+        const source = Martins.Source.Video(video);
116
+
117
+        const session = await Martins.startSession({
118
+            mode: 'immersive',
119
+            viewport: viewport,
120
+            trackers: [ tracker ],
121
+            sources: [ source ],
122
+            stats: true,
123
+            gizmos: true,
124
+        });
125
+    }
126
+    catch(error) {
127
+        alert(error.message);
128
+    }
129
+};
130
+```
131
+
132
+Most of the settings passed to `startSession` correspond directly to the [concepts](./concepts.md) we saw earlier. We're starting a new session in immersive mode, with the tracker, source of data and viewport that we have just configured. Let me explain what `stats` and `gizmos` mean:
133
+
134
+1. When you set `stats: true`, you're asking the engine to display a stats panel that shows useful data such as the current framerate. This is useful when developing WebAR experiences, but you should disable it in production.
135
+
136
+2. The option `gizmos: true` enables the gizmos. Gizmos are visual artifacts that help you visualize the current state of the tracker. They too are useful in development. In production, you may disable them or enable them partially (more on that later).
137
+
138
+Open <http://localhost:8000>{ ._blank }. You should see the tracking in action. Even though there is no virtual scene yet, the gizmos will show you the image being tracked.
139
+
140
+<figure markdown>
141
+[![Image tracking](../img/image-tracking-gizmos.webp)](../img/image-tracking-gizmos.webp){ ._blank }
142
+<figcaption>Image tracking in action!</figcaption>
143
+</figure>
144
+
145
+The code I have just presented is, in essence, what you need to start a session. I'm going to move it to a new function called `startARSession` for convenience:
146
+
147
+```js title="ar-demo.js" hl_lines="4 11-43"
148
+window.onload = async function()
149
+{
150
+    try {
151
+        const session = await startARSession();
152
+    }
153
+    catch(error) {
154
+        alert(error.message);
155
+    }
156
+};
157
+
158
+async function startARSession()
159
+{
160
+    if(!Martins.isSupported()) {
161
+        throw new Error(
162
+            'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
163
+            'Your user agent is ' + navigator.userAgent
164
+        );
165
+    }
166
+
167
+    const tracker = Martins.Tracker.ImageTracker();
168
+    await tracker.database.add([{
169
+        name: 'my-reference-image',
170
+        image: document.getElementById('my-reference-image')
171
+    }]);
172
+
173
+    const viewport = Martins.Viewport({
174
+        container: document.getElementById('ar-viewport')
175
+    });
176
+
177
+    const video = document.getElementById('my-video');
178
+    const source = Martins.Source.Video(video);
179
+
180
+    const session = await Martins.startSession({
181
+        mode: 'immersive',
182
+        viewport: viewport,
183
+        trackers: [ tracker ],
184
+        sources: [ source ],
185
+        stats: true,
186
+        gizmos: true,
187
+    });
188
+
189
+    return session;
190
+}
191
+```
192
+
193
+Now all you have to do to start a new session is call `startARSession()`!
194
+
195
+## Write the user callback
196
+
197
+The user callback is a function responsible for updating and rendering the virtual scene. We have no virtual scene at the moment, but we can already set up that function. In order to do this, we must call `session.requestAnimationFrame()` and pass the user callback as an argument.
198
+
199
+```js title="ar-demo.js" hl_lines="6-11"
200
+window.onload = async function()
201
+{
202
+    try {
203
+        const session = await startARSession();
204
+
205
+        function animate(time, frame)
206
+        {
207
+            session.requestAnimationFrame(animate);
208
+        }
209
+
210
+        session.requestAnimationFrame(animate);
211
+    }
212
+    catch(error) {
213
+        alert(error.message);
214
+    }
215
+};
216
+
217
+async function startARSession()
218
+{
219
+    // ...
220
+}
221
+```
222
+
223
+!!! info "requestAnimationFrame"
224
+
225
+    Note that `session.requestAnimationFrame()` is different from `window.requestAnimationFrame()`. The former is a call to the WebAR engine, whereas the latter is a standard call to the web browser.

+ 189
- 0
docs/getting-started/set-up-the-tracker.md Näytä tiedosto

@@ -0,0 +1,189 @@
1
+# Set up the tracker
2
+
3
+In this section we'll learn how to set up the tracker. Later on we'll see how to use the tracker to track an image in a video, with its position and orientation in 3D.
4
+
5
+## Add a reference image
6
+
7
+The first thing we need to do is add the image we want to track to our web page. We'll be calling that a **reference image**. We simply pick a suitable image and add an `<img>` tag to the page.
8
+
9
+Not all images are suitable for tracking. Images should be distinct, detailed and asymmetrical. I discuss this in detail in [Guidelines for Images](./guidelines-for-images.md). For now we'll just use the following image:
10
+
11
+<figure markdown>
12
+[![../assets/my-reference-image.webp](../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/"){ width=512 }](../assets/my-reference-image.webp){ ._blank }
13
+<figcaption>Reference Image</figure>
14
+</figure>
15
+
16
+Download the image to the `ar-demo/` folder. Save it as [my-reference-image.webp](../assets/my-reference-image.webp){ ._blank }.
17
+
18
+Next, let's add the reference image to our web page. Add an `<img>` tag to the `<body>` of the page as follows:
19
+
20
+```html title="index.html" hl_lines="11"
21
+<!doctype html>
22
+<html>
23
+    <head>
24
+        <meta charset="utf-8">
25
+        <meta name="viewport" content="width=device-width,initial-scale=1">
26
+        <title>MARTINS.js WebAR demo</title>
27
+        <script src="martins.js"></script>
28
+        <style>body { background-color: #3d5afe; }</style>
29
+    </head>
30
+    <body>
31
+        <img id="my-reference-image" src="my-reference-image.webp">
32
+    </body>
33
+</html>
34
+```
35
+
36
+Reload the page. You should see the reference image:
37
+
38
+<figure markdown>
39
+[![Expected web page](../img/page-with-reference-image.webp)](../img/page-with-reference-image.webp){ ._blank }
40
+<figcaption>Reference image in a web page</figcaption>
41
+</figure>
42
+
43
+If you don't see the image, make sure that there are no errors in the filename.
44
+
45
+Once you see that the image is being properly loaded, there is no need to keep it visible. Let's add the `hidden` attribute to the `<img>` tag:
46
+
47
+```html title="index.html" hl_lines="11"
48
+<!doctype html>
49
+<html>
50
+    <head>
51
+        <meta charset="utf-8">
52
+        <meta name="viewport" content="width=device-width,initial-scale=1">
53
+        <title>MARTINS.js WebAR demo</title>
54
+        <script src="martins.js"></script>
55
+        <style>body { background-color: #3d5afe; }</style>
56
+    </head>
57
+    <body>
58
+        <img id="my-reference-image" src="my-reference-image.webp" hidden>
59
+    </body>
60
+</html>
61
+```
62
+
63
+## Add a test video
64
+
65
+We're going to be tracking that reference image in a test video. Please save the following video as [my-video.webm](../assets/my-video.webm){ ._blank } in `ar-demo/`. Later on I'll tell you how to use your webcam instead.
66
+
67
+<figure markdown>
68
+<video src="../../assets/my-video.webm" style="width:600px" controls muted loop playsinline autoplay oncanplay="this.muted=true;this.play()">
69
+</figure>
70
+
71
+This is the expected directory structure at this point:
72
+
73
+    ar-demo/
74
+    ├── index.html
75
+    ├── martins.js
76
+    ├── my-reference-image.webp
77
+    └── my-video.webm
78
+
79
+Let's include the test video in our page. Add a `<video>` tag as follows:
80
+
81
+```html title="index.html" hl_lines="12"
82
+<!doctype html>
83
+<html>
84
+    <head>
85
+        <meta charset="utf-8">
86
+        <meta name="viewport" content="width=device-width,initial-scale=1">
87
+        <title>MARTINS.js WebAR demo</title>
88
+        <script src="martins.js"></script>
89
+        <style>body { background-color: #3d5afe; }</style>
90
+    </head>
91
+    <body>
92
+        <img id="my-reference-image" src="my-reference-image.webp" hidden>
93
+        <video id="my-video" src="my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
94
+    </body>
95
+</html>
96
+```
97
+
98
+## Instantiate an Image Tracker
99
+
100
+In order to track the reference image in our video, we need an Image Tracker. Remember that a tracker is a subsystem of the WebAR engine that analyzes input data in some way. An Image Tracker is a tracker that finds and tracks reference images in a video stream.
101
+
102
+Before we track anything with an Image Tracker, we must tell it what to track. There are two steps to this: first, we instantiate an Image Tracker. Next, we link our reference image to it.
103
+
104
+We'll be writing a little bit of JavaScript code now. In order to keep our code clean, we'll be writing the JavaScript code to a new file. Let's add a `<script>` tag below `martins.js` as follows:
105
+
106
+```html title="index.html" hl_lines="8"
107
+<!doctype html>
108
+<html>
109
+    <head>
110
+        <meta charset="utf-8">
111
+        <meta name="viewport" content="width=device-width,initial-scale=1">
112
+        <title>MARTINS.js WebAR demo</title>
113
+        <script src="martins.js"></script>
114
+        <script src="ar-demo.js"></script>
115
+        <style>body { background-color: #3d5afe; }</style>
116
+    </head>
117
+    <body>
118
+        <img id="my-reference-image" src="my-reference-image.webp" hidden>
119
+        <video id="my-video" src="my-video.webm" hidden muted loop playsinline autoplay oncanplay="this.muted=true;this.play()"></video>
120
+    </body>
121
+</html>
122
+```
123
+
124
+Create a new file called `ar-demo.js` and store it in the `ar-demo/` folder. Write the following contents to it:
125
+
126
+```js title="ar-demo.js"
127
+window.onload = async function()
128
+{
129
+    try {
130
+        if(!Martins.isSupported()) {
131
+            throw new Error(
132
+                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
133
+                'Your user agent is ' + navigator.userAgent
134
+            );
135
+        }
136
+
137
+        const tracker = Martins.Tracker.ImageTracker();
138
+    }
139
+    catch(error) {
140
+        alert(error.message);
141
+    }
142
+};
143
+```
144
+
145
+The `Martins` namespace holds the various elements featured by the engine. We'll be using it extensively.
146
+
147
+MARTINS.js only requires standard web technologies that have been around for a while. Still, it's a good practice to check if those technologies are supported by the target system. If they are not, we display a message and quit. If they are, we instantiate an Image Tracker.
148
+
149
+Before moving on, make sure that you have the following directory structure at this point:
150
+
151
+    ar-demo/
152
+    ├── ar-demo.js
153
+    ├── index.html
154
+    ├── martins.js
155
+    ├── my-reference-image.webp
156
+    └── my-video.webm
157
+
158
+## Link the image to the tracker
159
+
160
+Our Image Tracker has an internal database of reference images that it's capable of tracking. We call it a **reference image database**. To link a reference image to the tracker means to add that image to the database.
161
+
162
+When linking a reference image to the tracker, the appropriate `HTMLImageElement` must be provided to the database. You may optionally assign a name to the image, so that you can identify it later on. If you don't, an automatically generated name will be assigned for you.
163
+
164
+Let's link the image to the tracker. Add the following code to `ar-demo.js`:
165
+
166
+```js title="ar-demo.js" hl_lines="12-15"
167
+window.onload = async function()
168
+{
169
+    try {
170
+        if(!Martins.isSupported()) {
171
+            throw new Error(
172
+                'Use a browser/device compatible with WebGL2 and WebAssembly. ' +
173
+                'Your user agent is ' + navigator.userAgent
174
+            );
175
+        }
176
+
177
+        const tracker = Martins.Tracker.ImageTracker();
178
+        await tracker.database.add([{
179
+            name: 'my-reference-image',
180
+            image: document.getElementById('my-reference-image')
181
+        }]);
182
+    }
183
+    catch(error) {
184
+        alert(error.message);
185
+    }
186
+};
187
+```
188
+
189
+Reload the page. If you see no errors popping up, it means that the image is linked to the tracker. You're ready to proceed!

BIN
docs/img/demo-aframe.gif Näytä tiedosto


BIN
docs/img/demo-cool.webm Näytä tiedosto


BIN
docs/img/demo-cool.webp Näytä tiedosto


BIN
docs/img/demo-cool2.webm Näytä tiedosto


BIN
docs/img/demo-cool2.webp Näytä tiedosto


BIN
docs/img/demo-cool3.gif Näytä tiedosto


BIN
docs/img/demo-cool3.webm Näytä tiedosto


BIN
docs/img/demo-cool3.webp Näytä tiedosto


BIN
docs/img/demo-hello.gif Näytä tiedosto


BIN
docs/img/demo-hello.png Näytä tiedosto


BIN
docs/img/demo-hello.webp Näytä tiedosto


BIN
docs/img/demo-interactivity-three.jpg Näytä tiedosto


BIN
docs/img/demo-touchthree.gif Näytä tiedosto


BIN
docs/img/guidelines-for-images-1.jpg Näytä tiedosto


BIN
docs/img/guidelines-for-images-10.jpg Näytä tiedosto


BIN
docs/img/guidelines-for-images-11.jpg Näytä tiedosto


BIN
docs/img/guidelines-for-images-12.jpg Näytä tiedosto


BIN
docs/img/guidelines-for-images-2.jpg Näytä tiedosto


BIN
docs/img/guidelines-for-images-3.jpg Näytä tiedosto


BIN
docs/img/guidelines-for-images-4.jpg Näytä tiedosto


BIN
docs/img/guidelines-for-images-5.jpg Näytä tiedosto


BIN
docs/img/guidelines-for-images-6.jpg Näytä tiedosto


BIN
docs/img/guidelines-for-images-7.jpg Näytä tiedosto


BIN
docs/img/guidelines-for-images-8.jpg Näytä tiedosto


BIN
docs/img/guidelines-for-images-9.jpg Näytä tiedosto


BIN
docs/img/image-tracking-demo.webp Näytä tiedosto


BIN
docs/img/image-tracking-demo2.webp Näytä tiedosto


BIN
docs/img/image-tracking-gizmos.webp Näytä tiedosto


BIN
docs/img/kofi.png Näytä tiedosto


BIN
docs/img/logo-aframe.png Näytä tiedosto


BIN
docs/img/logo-babylonjs.png Näytä tiedosto


BIN
docs/img/logo-threejs.png Näytä tiedosto


BIN
docs/img/martins-icon.png Näytä tiedosto


BIN
docs/img/page-with-nothing.webp Näytä tiedosto


BIN
docs/img/page-with-reference-image.webp Näytä tiedosto


+ 0
- 0
docs/img/poster.png Näytä tiedosto


Some files were not shown because too many files changed in this diff

Loading…
Peruuta
Tallenna