LineSegmentsGeometry.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:BufferGeometry] &rarr; [page:InstancedBufferGeometry] &rarr;
  11. <h1>线段几何体([name])</h1>
  12. <p class="desc">
  13. 一系列形成线段的顶点对。
  14. </p>
  15. <p class="desc">
  16. 在 [page:LineSegments2] 中用于描述形状。
  17. </p>
  18. <h2>导入</h2>
  19. <p>
  20. [name] 是一个附加组件,必须显式导入。
  21. 查看[link:#manual/introduction/Installation Installation / Addons]。
  22. </p>
  23. <code>
  24. import { LineSegmentsGeometry } from 'three/addons/lines/LineSegmentsGeometry.js';
  25. </code>
  26. <h2>示例</h2>
  27. <p>[example:webgl_lines_fat_raycasting WebGL / lines / fat / raycasting ]</p>
  28. <h2>构造函数</h2>
  29. <h3>[name]()</h3>
  30. <p>
  31. 创建一个新的几何体。
  32. 调用 [page:LineSegmentsGeometry.setPositions setPositions] 来添加线段。
  33. </p>
  34. <h2>属性</h2>
  35. <p>共有属性,请参见基类 [page:InstancedBufferGeometry]。</p>
  36. <h3>[property:Boolean isLineSegmentsGeometry]</h3>
  37. <p>只读标志,用于检查给定对象是否为 [name] 类型。</p>
  38. <h2>方法</h2>
  39. <p>共有方法,请参见基类 [page:Mesh]。</p>
  40. <h3>[method:this fromEdgesGeometry]( [param:EdgesGeometry geometry] )</h3>
  41. <p>
  42. 将边缘几何体的顶点位置复制到此几何体中。
  43. </p>
  44. <h3>[method:this fromLineSegments]( [param:LineSegments lineSegments] )</h3>
  45. <p>
  46. 将 [page:LineSegments] 对象的顶点位置复制到此几何体中。
  47. 假定源几何体未使用索引。
  48. </p>
  49. <h3>[method:this fromMesh]( [param:Mesh mesh] )</h3>
  50. <p>
  51. 将网格对象的顶点位置复制到此几何体中。
  52. </p>
  53. <h3>[method:this fromWireframeGeometry]( [param:WireframeGeometry geometry] )</h3>
  54. <p>
  55. 将线框几何体的顶点位置复制到此几何体中。
  56. </p>
  57. <h3>[method:this setColors]( [param:Array array] )</h3>
  58. <p>
  59. 替换每个顶点的颜色。
  60. 每六个值描述一个线段:`[r1, g1, b1, r2, g2, b2]`。
  61. 数组可以是 `Array` 或 `Float32Array` 类型。
  62. </p>
  63. <h3>[method:this setPositions]( [param:Array array] )</h3>
  64. <p>
  65. 用新的顶点位置集替换现有顶点位置。
  66. 数组可以是 `Array` 或 `Float32Array` 类型。
  67. 数组长度必须是 6 的倍数。
  68. </p>
  69. <p>
  70. 另请参见 [page:LineSegmentsGeometry.positions positions]。
  71. </p>
  72. <h3>[method:undefined toJSON]()</h3>
  73. <p>
  74. 未实现。
  75. </p>
  76. <h2>源代码</h2>
  77. <p>
  78. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/lines/LineSegmentsGeometry.js examples/jsm/lines/LineSegmentsGeometry.js]
  79. </p>
  80. </body>
  81. </html>
粤ICP备19079148号