GridHelper.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 | Color | string</span>, color2 : <span class="param-type">number | Color | 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"><code>size</code></td>
  37. <td class="description last"><p>The size of the grid.<br/>Default is <code>10</code>.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>divisions</code></td>
  41. <td class="description last"><p>The number of divisions across the grid.<br/>Default is <code>10</code>.</p></td>
  42. </tr>
  43. <tr>
  44. <td class="name"><code>color1</code></td>
  45. <td class="description last"><p>The color of the center line.<br/>Default is <code>0x444444</code>.</p></td>
  46. </tr>
  47. <tr>
  48. <td class="name"><code>color2</code></td>
  49. <td class="description last"><p>The color of the lines of the grid.<br/>Default is <code>0x888888</code>.</p></td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. </div>
  54. </div>
  55. <h2 class="subsection-title">Methods</h2>
  56. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  57. <div class="method">
  58. <div class="description">
  59. <p>Frees the GPU-related resources allocated by this instance. Call this
  60. method whenever this instance is no longer used in your app.</p>
  61. </div>
  62. </div>
  63. <h2 class="subsection-title">Source</h2>
  64. <p>
  65. <a href="https://github.com/mrdoob/three.js/blob/master/src/helpers/GridHelper.js" target="_blank" rel="noopener" translate="no">src/helpers/GridHelper.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号