-
-
Notifications
You must be signed in to change notification settings - Fork 36.4k
Expand file tree
/
Copy pathARButton.html
More file actions
69 lines (69 loc) · 2.94 KB
/
ARButton.html
File metadata and controls
69 lines (69 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ARButton - Three.js Docs</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<script src="../scripts/highlight.min.js"></script>
<link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
<link type="text/css" rel="stylesheet" href="../styles/page.css">
</head>
<body>
<h1 translate="no">ARButton</h1>
<section>
<header>
<div class="class-description"><p>A utility class for creating a button that allows to initiate
immersive AR sessions based on WebXR. The button can be created
with a factory method and then appended ot the website's DOM.</p></div>
<h2>Code Example</h2>
<div translate="no"><pre><code class="language-js">document.body.appendChild( ARButton.createButton( renderer ) );
</code></pre></div>
</header>
<article>
<h2 class="subsection-title">Import</h2>
<p><span translate="no">ARButton</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
<pre><code class="language-js">import { ARButton } from 'three/addons/webxr/ARButton.js';</code></pre>
<div class="container-overview">
<div class="method">
</div>
</div>
<h2 class="subsection-title">Static Methods</h2>
<h3 class="name name-method" id=".createButton" translate="no">.<a href="#.createButton">createButton</a><span class="signature">( renderer : <span class="param-type"><a href="WebGLRenderer.html">WebGLRenderer</a> | <a href="WebGPURenderer.html">WebGPURenderer</a></span>, sessionInit : <span class="param-type">XRSessionInit</span> )</span><span class="type-signature"> : HTMLElement</span> </h3>
<div class="method">
<div class="description">
<p>Constructs a new AR button.</p>
</div>
<table class="params">
<tbody>
<tr>
<td class="name">
<strong translate="no">renderer</strong>
</td>
<td class="description last">
<p>The renderer.</p>
</td>
</tr>
<tr>
<td class="name">
<strong translate="no">sessionInit</strong>
</td>
<td class="description last">
<p>The a configuration object for the AR session.</p>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-returns"><strong>Returns:</strong> The button or an error message if <code>immersive-ar</code> isn't supported.</dt>
</dl>
</div>
<h2 class="subsection-title">Source</h2>
<p>
<a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/webxr/ARButton.js" translate="no" target="_blank" rel="noopener">examples/jsm/webxr/ARButton.js</a>
</p>
</article>
</section>
<script src="../scripts/linenumber.js"></script>
<script src="../scripts/page.js"></script>
</body>
</html>