PlaneGeometry.html 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PlaneGeometry - 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. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="BufferGeometry.html">BufferGeometry</a> → </p>
  13. <h1 translate="no">PlaneGeometry</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A geometry class for representing a plane.</p></div>
  17. <iframe id="viewer" src="../scenes/geometry-browser.html#PlaneGeometry"></iframe>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const geometry = new THREE.PlaneGeometry( 1, 1 );
  20. const material = new THREE.MeshBasicMaterial( { color: 0xffff00, side: THREE.DoubleSide } );
  21. const plane = new THREE.Mesh( geometry, material );
  22. scene.add( plane );
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="PlaneGeometry" translate="no">new <a href="#PlaneGeometry">PlaneGeometry</a><span class="signature">( width : <span class="param-type">number</span>, height : <span class="param-type">number</span>, widthSegments : <span class="param-type">number</span>, heightSegments : <span class="param-type">number</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new plane geometry.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name"><code>width</code></td>
  37. <td class="description last"><p>The width along the X axis.<br/>Default is <code>1</code>.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>height</code></td>
  41. <td class="description last"><p>The height along the Y axis<br/>Default is <code>1</code>.</p></td>
  42. </tr>
  43. <tr>
  44. <td class="name"><code>widthSegments</code></td>
  45. <td class="description last"><p>The number of segments along the X axis.<br/>Default is <code>1</code>.</p></td>
  46. </tr>
  47. <tr>
  48. <td class="name"><code>heightSegments</code></td>
  49. <td class="description last"><p>The number of segments along the Y axis.<br/>Default is <code>1</code>.</p></td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. </div>
  54. </div>
  55. <h2 class="subsection-title">Properties</h2>
  56. <div class="member">
  57. <h3 class="name" id="parameters" translate="no">.<a href="#parameters">parameters</a><span class="type-signature"> : Object</span> </h3>
  58. <div class="description">
  59. <p>Holds the constructor parameters that have been
  60. used to generate the geometry. Any modification
  61. after instantiation does not change the geometry.</p>
  62. </div>
  63. </div>
  64. <h2 class="subsection-title">Static Methods</h2>
  65. <h3 class="name name-method" id=".fromJSON" translate="no">.<a href="#.fromJSON">fromJSON</a><span class="signature">( data : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="PlaneGeometry.html">PlaneGeometry</a></span> </h3>
  66. <div class="method">
  67. <div class="description">
  68. <p>Factory method for creating an instance of this class from the given
  69. JSON object.</p>
  70. </div>
  71. <table class="params">
  72. <tbody>
  73. <tr>
  74. <td class="name"><code>data</code></td>
  75. <td class="description last"><p>A JSON object representing the serialized geometry.</p></td>
  76. </tr>
  77. </tbody>
  78. </table>
  79. <dl class="details">
  80. <dt class="tag-returns"><strong>Returns:</strong> A new instance.</dt>
  81. </dl>
  82. </div>
  83. <h2 class="subsection-title">Source</h2>
  84. <p>
  85. <a href="https://github.com/mrdoob/three.js/blob/master/src/geometries/PlaneGeometry.js" target="_blank" rel="noopener" translate="no">src/geometries/PlaneGeometry.js</a>
  86. </p>
  87. </article>
  88. </section>
  89. <script src="../scripts/linenumber.js"></script>
  90. <script src="../scripts/page.js"></script>
  91. </body>
  92. </html>
粤ICP备19079148号