GridHelper.html 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>GridHelper - 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="Object3D.html">Object3D</a> → <a href="Line.html">Line</a> → <a href="LineSegments.html">LineSegments</a> → </p>
  13. <h1 translate="no">GridHelper</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>The helper is an object to define grids. Grids are two-dimensional
  17. arrays of lines.</p></div>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const size = 10;
  20. const divisions = 10;
  21. const gridHelper = new THREE.GridHelper( size, divisions );
  22. scene.add( gridHelper );
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="GridHelper" translate="no">new <a href="#GridHelper">GridHelper</a><span class="signature">( size : <span class="param-type">number</span>, divisions : <span class="param-type">number</span>, color1 : <span class="param-type">number | <a href="Color.html">Color</a> | string</span>, color2 : <span class="param-type">number | <a href="Color.html">Color</a> | string</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new grid helper.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name">
  37. <strong>size</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The size of the grid.</p>
  41. <p>Default is <code>10</code>.</p>
  42. </td>
  43. </tr>
  44. <tr>
  45. <td class="name">
  46. <strong>divisions</strong>
  47. </td>
  48. <td class="description last">
  49. <p>The number of divisions across the grid.</p>
  50. <p>Default is <code>10</code>.</p>
  51. </td>
  52. </tr>
  53. <tr>
  54. <td class="name">
  55. <strong>color1</strong>
  56. </td>
  57. <td class="description last">
  58. <p>The color of the center line.</p>
  59. <p>Default is <code>0x444444</code>.</p>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td class="name">
  64. <strong>color2</strong>
  65. </td>
  66. <td class="description last">
  67. <p>The color of the lines of the grid.</p>
  68. <p>Default is <code>0x888888</code>.</p>
  69. </td>
  70. </tr>
  71. </tbody>
  72. </table>
  73. </div>
  74. </div>
  75. <h2 class="subsection-title">Methods</h2>
  76. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  77. <div class="method">
  78. <div class="description">
  79. <p>Frees the GPU-related resources allocated by this instance. Call this
  80. method whenever this instance is no longer used in your app.</p>
  81. </div>
  82. </div>
  83. <h2 class="subsection-title">Source</h2>
  84. <p>
  85. <a href="https://github.com/mrdoob/three.js/blob/master/src/helpers/GridHelper.js" translate="no" target="_blank" rel="noopener">src/helpers/GridHelper.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号