LineSegments2.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!DOCTYPE html>
  2. <html lang="en">
  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:Object3D] &rarr; [page:Mesh] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. A series of lines drawn between pairs of vertices.
  14. </p>
  15. <p class="desc">
  16. This adds functionality beyond [page:LineSegments], like arbitrary line width and changing width to be in world units.
  17. The [page:Line2] extends this object, forming a polyline instead of individual segments.
  18. </p>
  19. <h2>Import</h2>
  20. <p>
  21. [name] is an add-on, and therefore must be imported explicitly.
  22. See [link:#manual/introduction/Installation Installation / Addons].
  23. </p>
  24. <code>
  25. import { LineSegments2 } from 'three/addons/lines/LineSegments2.js';
  26. </code>
  27. <h2>Example</h2>
  28. <p>[example:webgl_lines_fat_raycasting WebGL / lines / fat / raycasting ]</p>
  29. <h2>Constructor</h2>
  30. <h3>[name]( [param:LineSegmentsGeometry geometry], [param:LineMaterial material] )</h3>
  31. <p>
  32. [page:LineSegmentsGeometry geometry] — (optional) Pair(s) of vertices representing each line segment.<br />
  33. [page:Material material] — (optional) Material for the line. Default is a [page:LineMaterial] with random color.
  34. </p>
  35. <h2>Properties</h2>
  36. <p>See the base [page:Mesh] class for common properties.</p>
  37. <h3>[property:Boolean isLineSegments2]</h3>
  38. <p>Read-only flag to check if a given object is of type [name].</p>
  39. <h2>Methods</h2>
  40. <p>See the base [page:Mesh] class for common methods.</p>
  41. <h3>[method:undefined onBeforeRender]( [param:WebGLRenderer renderer] )</h3>
  42. <p>
  43. Called by the framework to update the material's resolution property, needed for screen-scaled widths.
  44. </p>
  45. <p>
  46. If your object is not visible to a camera (e.g. by [page:Object3D.layers layers] or [page:Object3D.visible visible],) you must call this manually whenever the viewport changes.
  47. </p>
  48. <h2>Source</h2>
  49. <p>
  50. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/lines/LineSegments2.js examples/jsm/lines/LineSegments2.js]
  51. </p>
  52. </body>
  53. </html>