| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Projector - 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">Projector</h1>
- <section>
- <header>
- <div class="class-description"><p>This class can project a given scene in 3D space into a 2D representation
- used for rendering with a 2D API. <code>Projector</code> is currently used by <a href="SVGRenderer.html">SVGRenderer</a>
- and was previously used by the legacy <code>CanvasRenderer</code>.</p></div>
- </header>
- <article>
- <h2 class="subsection-title">Import</h2>
- <p><span translate="no">Projector</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
- <pre><code class="language-js">import { Projector } from 'three/addons/renderers/Projector.js';</code></pre>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="Projector" translate="no">new <a href="#Projector">Projector</a><span class="signature">()</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new projector.</p>
- </div>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="projectScene" translate="no">.<a href="#projectScene">projectScene</a><span class="signature">( scene : <span class="param-type">Object3D</span>, camera : <span class="param-type">Camera</span>, sortObjects : <span class="param-type">boolean</span>, sortElements : <span class="param-type">boolean</span> )</span><span class="type-signature"> : Object</span> </h3>
- <div class="method">
- <div class="description">
- <p>Projects the given scene in 3D space into a 2D representation. The result
- is an object with renderable items.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>scene</code></td>
- <td class="description last"><p>A scene or any other type of 3D object.</p></td>
- </tr>
- <tr>
- <td class="name"><code>camera</code></td>
- <td class="description last"><p>The camera.</p></td>
- </tr>
- <tr>
- <td class="name"><code>sortObjects</code></td>
- <td class="description last"><p>Whether to sort objects or not.</p></td>
- </tr>
- <tr>
- <td class="name"><code>sortElements</code></td>
- <td class="description last"><p>Whether to sort elements (faces, lines and sprites) or not.</p></td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The projected scene as renderable objects.</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/renderers/Projector.js" target="_blank" rel="noopener" translate="no">examples/jsm/renderers/Projector.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|