Line.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. <div class="desc">A continuous line.</div>
  14. <h2>Example</h2>
  15. <code>var material = new THREE.LineBasicMaterial({
  16. color: 0x0000ff
  17. });
  18. var geometry = new THREE.Geometry();
  19. geometry.vertices.push(
  20. new THREE.Vector3( -10, 0, 0 ),
  21. new THREE.Vector3( 0, 10, 0 ),
  22. new THREE.Vector3( 10, 0, 0 )
  23. );
  24. var line = new THREE.Line( geometry, material );
  25. scene.add( line );
  26. </code>
  27. <h2>Constructor</h2>
  28. <h3>[name]( [page:Geometry geometry], [page:Material material] )</h3>
  29. <div>
  30. geometry — Vertices representing the line segment(s).<br />
  31. material — Material for the line. Default is [page:LineBasicMaterial LineBasicMaterial].<br />
  32. </div>
  33. <div>If no material is supplied, a randomized line material will be created and assigned to the object.</div>
  34. <h2>Properties</h2>
  35. <h3>[property:Geometry geometry]</h3>
  36. <div>
  37. Vertices representing the line segment(s).
  38. </div>
  39. <h3>[property:Material material]</h3>
  40. <div>
  41. Material for the line.
  42. </div>
  43. <h2>Methods</h2>
  44. <h3>[method:Array raycast]([page:Raycaster raycaster], [page:Array intersects])</h3>
  45. <div>
  46. Get intersections between a casted ray and this Line. [page:Raycaster.intersectObject] will call this method.
  47. </div>
  48. <h3>[method:Object3D clone]([page:Object3D object])</h3>
  49. <div>
  50. object -- (optional) Object3D which needs to be cloned. If undefined, clone method will create a new cloned Line Object.
  51. </div>
  52. <div>
  53. Clone a Line Object.
  54. </div>
  55. <h2>Source</h2>
  56. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  57. </body>
  58. </html>