1
0

LineMaterial.html 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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:Material] &rarr; [page:ShaderMaterial] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. A material for drawing wireframe-style geometries.
  14. Unlike [page:LineBasicMaterial], it supports arbitrary line widths and allows using world units instead of screen space units.
  15. This material is used with [page:LineSegments2] and [page:Line2].
  16. </p>
  17. <p class="desc">
  18. Lines are always rendered with round caps and round joints.
  19. </p>
  20. <h2>Examples</h2>
  21. <p>
  22. [example:webgl_lines_fat WebGL / lines / fat ]<br />
  23. [example:webgl_lines_fat_raycasting WebGL / lines / fat / raycasting ]<br />
  24. [example:webgl_lines_fat_wireframe WebGL / lines / fat / wireframe ]<br />
  25. [example:webgpu_lines_fat WebGPU / lines / fat / raycasting ]
  26. </p>
  27. <h2>Constructor</h2>
  28. <h3>[name]( [param:Object parameters] )</h3>
  29. <p>
  30. [page:Object parameters] - (optional) an object with one or more properties defining the material's appearance.
  31. Any property of the material (including any property inherited from [page:ShaderMaterial]) can be passed in here.
  32. </p>
  33. <p>
  34. The exception is the property [page:Hexadecimal color], which can be passed in as a number or hexadecimal string and is `0xffffff` (white) by default.
  35. [page:Color.set]( color ) is called internally.
  36. </p>
  37. <h2>Properties</h2>
  38. <p>See the base [page:ShaderMaterial] class for common properties.</p>
  39. <h3>[property:Color color]</h3>
  40. <p>[page:Color] of the material, by default set to white (0xffffff).</p>
  41. <h3>[property:Boolean dashed]</h3>
  42. <p>Whether the line is dashed, or solid. Default is `false`.</p>
  43. <h3>[property:number dashOffset]</h3>
  44. <p>Where in the dash cycle the dash starts. Default is `0`.</p>
  45. <h3>[property:number dashScale]</h3>
  46. <p>The scale of the dashes and gaps. Default is `1`.</p>
  47. <h3>[property:number dashSize]</h3>
  48. <p>The size of the dash. Default is `1`.</p>
  49. <h3>[property:number gapSize]</h3>
  50. <p>The size of the gap. Default is `1`.</p>
  51. <h3>[property:Float linewidth]</h3>
  52. <p>Controls line thickness. Default is `1`.</p>
  53. <h3>[property:Vector2 resolution]</h3>
  54. <p>
  55. The size of the viewport, in screen pixels.
  56. This must be kept updated to make screen-space rendering accurate.
  57. The [page:LineSegments2.onBeforeRender] callback performs the update for visible objects.
  58. Default is `[1, 1]`.
  59. </p>
  60. <h3>[property:Boolean worldUnits]</h3>
  61. <p>
  62. Whether the material's sizes (width, dash gaps) are in world units.
  63. Default is `false` (screen space units.)
  64. </p>
  65. <h2>Methods</h2>
  66. <p>See the base [page:ShaderMaterial] class for common methods.</p>
  67. <h2>Source</h2>
  68. <p>
  69. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/lines/LineMaterial.js examples/jsm/lines/LineMaterial.js]
  70. </p>
  71. </body>
  72. </html>