LineGeometry.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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; [page:LineSegmentsGeometry] &rarr;
  11. <h1>线段几何体([name])</h1>
  12. <p class="desc">
  13. 由顶点链组成的多段线几何体。
  14. </p>
  15. <p class="desc">
  16. 在 [page:Line2] 中用于描述形状。
  17. </p>
  18. <h2>导入</h2>
  19. <p>
  20. [name] 是一个附加组件,必须显式导入。
  21. 查看[link:#manual/introduction/Installation Installation / Addons]。
  22. </p>
  23. <code>
  24. import { LineGeometry } from 'three/addons/lines/LineGeometry.js';
  25. </code>
  26. <h2>示例</h2>
  27. <p>
  28. [example:webgl_lines_fat WebGL / lines / fat ]<br />
  29. [example:webgl_lines_fat_raycasting WebGL / lines / fat / raycasting ]<br />
  30. [example:webgpu_lines_fat WebGPU / lines / fat / raycasting ]
  31. </p>
  32. <h2>构造函数</h2>
  33. <h3>[name]()</h3>
  34. <p>
  35. 创建一个新的几何体。
  36. 调用 [page:LineGeometry.setPositions setPositions] 来添加线段。
  37. </p>
  38. <h2>属性</h2>
  39. <p>共有属性,请参见基类 [page:LineSegmentsGeometry]。</p>
  40. <h3>[property:Boolean isLineGeometry]</h3>
  41. <p>只读标志,用于检查给定对象是否为 [name] 类型。</p>
  42. <h2>方法</h2>
  43. <p>共有方法,请参见基类 [page:LineSegmentsGeometry]。</p>
  44. <h3>[method:this fromLine]( [param:Line line] )</h3>
  45. <p>
  46. 将 [page:Line] 对象的顶点位置复制到该几何体中。
  47. 假定源几何体未使用索引。
  48. </p>
  49. <h3>[method:this setColors]( [param:Array array] )</h3>
  50. <p>
  51. 替换每个顶点的颜色。
  52. 每个三元组描述一个线段顶点:`[r1, g1, b1]`。
  53. 数组可以是 `Array` 或 `Float32Array` 类型。
  54. </p>
  55. <h3>[method:this setPositions]( [param:Array array] )</h3>
  56. <p>
  57. 用新的顶点位置集替换现有顶点位置。
  58. 数组可以是 `Array` 或 `Float32Array` 类型。
  59. 数组长度必须是 3 的倍数。
  60. </p>
  61. <h3>[method:this setFromPoints]( [param:Array points] )</h3>
  62. <p>
  63. 用点数组替换顶点位置。
  64. 可以是 `Vector3` 或 `Vector2` 数组。
  65. </p>
  66. <h2>源代码</h2>
  67. <p>
  68. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/lines/LineGeometry.js examples/jsm/lines/LineGeometry.js]
  69. </p>
  70. </body>
  71. </html>
粤ICP备19079148号