LineBasicMaterial.html 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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:Material] &rarr;
  11. <h1>基础线条材质([name])</h1>
  12. <p class="desc">一种用于绘制线框样式几何体的材质。</p>
  13. <h2>代码示例</h2>
  14. <code>
  15. const material = new THREE.LineBasicMaterial( {
  16. color: 0xffffff,
  17. linewidth: 1,
  18. linecap: 'round', //ignored by WebGLRenderer
  19. linejoin: 'round' //ignored by WebGLRenderer
  20. } );
  21. </code>
  22. <h2>例子</h2>
  23. <p>
  24. [example:webgl_buffergeometry_drawrange WebGL / buffergeometry / drawrange]<br />
  25. [example:webgl_buffergeometry_lines WebGL / buffergeometry / lines]<br />
  26. [example:webgl_buffergeometry_lines_indexed WebGL / buffergeometry / lines / indexed]<br />
  27. [example:webgl_decals WebGL / decals]<br />
  28. [example:webgl_geometry_nurbs WebGL / geometry / nurbs]<br />
  29. [example:webgl_geometry_shapes WebGL / geometry / shapes]<br />
  30. [example:webgl_geometry_spline_editor WebGL / geometry / spline / editor]<br />
  31. [example:webgl_interactive_buffergeometry WebGL / interactive / buffergeometry]<br />
  32. [example:webgl_interactive_voxelpainter WebGL / interactive / voxelpainter]<br />
  33. [example:webgl_lines_colors WebGL / lines / colors]<br />
  34. [example:webgl_lines_dashed WebGL / lines / dashed]<br />
  35. [example:physics_ammo_rope physics / ammo / rope]
  36. </p>
  37. <h2>构造函数(Constructor)</h2>
  38. <h3>[name]( [param:Object parameters] )</h3>
  39. <p>
  40. [page:Object parameters] - (可选)用于定义材质外观的对象,具有一个或多个属性。材质的任何属性都可以从此处传入(包括从[page:Material]继承的任何属性)。<br /><br />
  41. 属性[page:Hexadecimal color]例外,其可以作为十六进制字符串传递,默认情况下为 *0xffffff*(白色),内部调用[page:Color.set](color)。
  42. </p>
  43. <h2>属性(Properties)</h2>
  44. <p>共有属性请参见其基类[page:Material]。</p>
  45. <h3>[property:Color color]</h3>
  46. <p>材质的颜色([page:Color]),默认值为白色 (0xffffff)。</p>
  47. <h3>[property:Boolean fog]</h3>
  48. <p>材质是否受雾影响。默认为*true*。</p>
  49. <h3>[property:Float linewidth]</h3>
  50. <p> 控制线宽。默认值为 *1*。<br /><br />
  51. 由于[link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile]与
  52. 大多数平台上[page:WebGLRenderer WebGL]渲染器的限制,无论如何设置该值,线宽始终为1。
  53. </p>
  54. <h3>[property:String linecap]</h3>
  55. <p> 定义线两端的样式。可选值为 'butt', 'round' 和 'square'。默认值为 'round'。<br /><br />
  56. 该属性对应[link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap]属性,
  57. 并且会被[page:WebGLRenderer WebGL]渲染器忽略。
  58. </p>
  59. <h3>[property:String linejoin]</h3>
  60. <p> 定义线连接节点的样式。可选值为 'round', 'bevel' 和 'miter'。默认值为 'round'。<br /><br />
  61. 该属性对应[link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin]属性,
  62. 并且会被[page:WebGLRenderer WebGL]渲染器忽略。
  63. </p>
  64. <h3>[property:Texture map]</h3>
  65. <p>
  66. Sets the color of the lines using data from a [page:Texture].
  67. </p>
  68. <h2>方法(Methods)</h2>
  69. <p>共有方法请参见其基类[page:Material]。</p>
  70. <h2>源码(Source)</h2>
  71. <p>
  72. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  73. </p>
  74. </body>
  75. </html>