| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>HTMLMesh - 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>
- <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Object3D.html">Object3D</a> → <a href="Mesh.html">Mesh</a> → </p>
- <h1 translate="no">HTMLMesh</h1>
- <section>
- <header>
- <div class="class-description"><p>This class can be used to render a DOM element onto a canvas and use it as a texture
- for a plane mesh.</p>
- <p>A typical use case for this class is to render the GUI of <code>lil-gui</code> as a texture so it
- is compatible for VR.</p></div>
- <h2>Code Example</h2>
- <div translate="no"><pre><code class="language-js">const gui = new GUI( { width: 300 } ); // create lil-gui instance
- const mesh = new HTMLMesh( gui.domElement );
- scene.add( mesh );
- </code></pre></div>
- </header>
- <article>
- <h2 class="subsection-title">Import</h2>
- <p><span translate="no">HTMLMesh</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 { HTMLMesh } from 'three/addons/interactive/HTMLMesh.js';</code></pre>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="HTMLMesh" translate="no">new <a href="#HTMLMesh">HTMLMesh</a><span class="signature">( dom : <span class="param-type">HTMLElement</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new HTML mesh.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>dom</strong>
- </td>
- <td class="description last">
- <p>The DOM element to display as a plane mesh.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
- <div class="method">
- <div class="description">
- <p>Frees the GPU-related resources allocated by this instance and removes all event listeners.
- Call this method whenever this instance is no longer used in your app.</p>
- </div>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/interactive/HTMLMesh.js" translate="no" target="_blank" rel="noopener">examples/jsm/interactive/HTMLMesh.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|