Projector.html 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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" rel="noopener">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"><a href="Object3D.html">Object3D</a></span>, camera : <span class="param-type"><a href="Camera.html">Camera</a></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">
  43. <strong>scene</strong>
  44. </td>
  45. <td class="description last">
  46. <p>A scene or any other type of 3D object.</p>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td class="name">
  51. <strong>camera</strong>
  52. </td>
  53. <td class="description last">
  54. <p>The camera.</p>
  55. </td>
  56. </tr>
  57. <tr>
  58. <td class="name">
  59. <strong>sortObjects</strong>
  60. </td>
  61. <td class="description last">
  62. <p>Whether to sort objects or not.</p>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td class="name">
  67. <strong>sortElements</strong>
  68. </td>
  69. <td class="description last">
  70. <p>Whether to sort elements (faces, lines and sprites) or not.</p>
  71. </td>
  72. </tr>
  73. </tbody>
  74. </table>
  75. <dl class="details">
  76. <dt class="tag-returns"><strong>Returns:</strong> The projected scene as renderable objects.</dt>
  77. </dl>
  78. </div>
  79. <h2 class="subsection-title">Source</h2>
  80. <p>
  81. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/renderers/Projector.js" translate="no" target="_blank" rel="noopener">examples/jsm/renderers/Projector.js</a>
  82. </p>
  83. </article>
  84. </section>
  85. <script src="../scripts/linenumber.js"></script>
  86. <script src="../scripts/page.js"></script>
  87. </body>
  88. </html>
粤ICP备19079148号