Line.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. [page:Object3D] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">
  14. A continuous line.<br /><br />
  15. This is nearly the same
  16. as [page:LineSegments]; the only difference is that it is rendered using
  17. [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP]
  18. instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINES]
  19. </p>
  20. <h2>Code Example</h2>
  21. <code>
  22. var material = new THREE.LineBasicMaterial({
  23. color: 0x0000ff
  24. });
  25. var points = [];
  26. points.push( new THREE.Vector3( - 10, 0, 0 ) );
  27. points.push( new THREE.Vector3( 0, 10, 0 ) );
  28. points.push( new THREE.Vector3( 10, 0, 0 ) );
  29. var geometry = new THREE.BufferGeometry().setFromPoints( points );
  30. var line = new THREE.Line( geometry, material );
  31. scene.add( line );
  32. </code>
  33. <h2>Constructor</h2>
  34. <h3>[name]( [param:Geometry geometry], [param:Material material] )</h3>
  35. <p>
  36. [page:Geometry geometry] — vertices representing the line segment(s). Default is a new [page:BufferGeometry].<br />
  37. [page:Material material] — material for the line. Default is a new [page:LineBasicMaterial].<br />
  38. </p>
  39. <h2>Properties</h2>
  40. <p>See the base [page:Object3D] class for common properties.</p>
  41. <h3>[property:Geometry geometry]</h3>
  42. <p>Vertices representing the line segment(s).</p>
  43. <h3>[property:Material material]</h3>
  44. <p>Material for the line.</p>
  45. <h3>[property:Array morphTargetInfluences]</h3>
  46. <p>
  47. An array of weights typically from 0-1 that specify how much of the morph is applied.
  48. Undefined by default, but reset to a blank array by [page:.updateMorphTargets]().
  49. </p>
  50. <h3>[property:Object morphTargetDictionary]</h3>
  51. <p>
  52. A dictionary of morphTargets based on the morphTarget.name property.
  53. Undefined by default, but rebuilt [page:.updateMorphTargets]().
  54. </p>
  55. <h2>Methods</h2>
  56. <p>See the base [page:Object3D] class for common methods.</p>
  57. <h3>[method:Line computeLineDistances]()</h3>
  58. <p>
  59. Computes an array of distance values which are necessary for [page:LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
  60. </p>
  61. <h3>[method:null raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
  62. <p>
  63. Get intersections between a casted [page:Ray] and this Line.
  64. [page:Raycaster.intersectObject] will call this method.
  65. </p>
  66. <h3>[method:Line clone]()</h3>
  67. <p>
  68. Returns a clone of this Line object and its descendants.
  69. </p>
  70. <h3>[method:null updateMorphTargets]()</h3>
  71. <p>
  72. Updates the morphTargets to have no influence on the object. Resets the
  73. [page:.morphTargetInfluences] and [page:.morphTargetDictionary] properties.
  74. </p>
  75. <h2>Source</h2>
  76. <p>
  77. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  78. </p>
  79. </body>
  80. </html>