Projector.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Projector - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <h1 translate="no">Projector</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>This class can project a given scene in 3D space into a 2D representation
  16. used for rendering with a 2D API. <code>Projector</code> is currently used by <a href="SVGRenderer.html">SVGRenderer</a>
  17. and was previously used by the legacy <code>CanvasRenderer</code>.</p></div>
  18. </header>
  19. <article>
  20. <h2 class="subsection-title">Import</h2>
  21. <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>
  22. <pre><code class="language-js">import { Projector } from 'three/addons/renderers/Projector.js';</code></pre>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="Projector" translate="no">new <a href="#Projector">Projector</a><span class="signature">()</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new projector.</p>
  29. </div>
  30. </div>
  31. </div>
  32. <h2 class="subsection-title">Methods</h2>
  33. <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>
  34. <div class="method">
  35. <div class="description">
  36. <p>Projects the given scene in 3D space into a 2D representation. The result
  37. is an object with renderable items.</p>
  38. </div>
  39. <table class="params">
  40. <tbody>
  41. <tr>
  42. <td class="name"><code>scene</code></td>
  43. <td class="description last"><p>A scene or any other type of 3D object.</p></td>
  44. </tr>
  45. <tr>
  46. <td class="name"><code>camera</code></td>
  47. <td class="description last"><p>The camera.</p></td>
  48. </tr>
  49. <tr>
  50. <td class="name"><code>sortObjects</code></td>
  51. <td class="description last"><p>Whether to sort objects or not.</p></td>
  52. </tr>
  53. <tr>
  54. <td class="name"><code>sortElements</code></td>
  55. <td class="description last"><p>Whether to sort elements (faces, lines and sprites) or not.</p></td>
  56. </tr>
  57. </tbody>
  58. </table>
  59. <dl class="details">
  60. <dt class="tag-returns"><strong>Returns:</strong> The projected scene as renderable objects.</dt>
  61. </dl>
  62. </div>
  63. <h2 class="subsection-title">Source</h2>
  64. <p>
  65. <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>
  66. </p>
  67. </article>
  68. </section>
  69. <script src="../scripts/linenumber.js"></script>
  70. <script src="../scripts/page.js"></script>
  71. </body>
  72. </html>
粤ICP备19079148号