Line.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../list.js"></script>
  6. <script src="../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../page.css" />
  8. </head>
  9. <body>
  10. [page:Object3D] &rarr;
  11. <h1>[name]</h1>
  12. <div class="desc">A continuous line.</div>
  13. <h2>Example</h2>
  14. <code>var material = new THREE.LineBasicMaterial({
  15. color: 0x0000ff
  16. });
  17. var geometry = new THREE.Geometry();
  18. geometry.vertices.push(
  19. new THREE.Vector3( -10, 0, 0 ),
  20. new THREE.Vector3( 0, 10, 0 ),
  21. new THREE.Vector3( 10, 0, 0 )
  22. );
  23. var line = new THREE.Line( geometry, material );
  24. scene.add( line );
  25. </code>
  26. <h2>Constructor</h2>
  27. <h3>[name]( [page:Geometry geometry], [page:Material material] )</h3>
  28. <div>
  29. geometry — Vertices representing the line segment(s).<br />
  30. material — Material for the line. Default is [page:LineBasicMaterial LineBasicMaterial].<br />
  31. </div>
  32. <div>If no material is supplied, a randomized line material will be created and assigned to the object.</div>
  33. <h2>Properties</h2>
  34. <h3>[property:Geometry geometry]</h3>
  35. <div>
  36. Vertices representing the line segment(s).
  37. </div>
  38. <h3>[property:Material material]</h3>
  39. <div>
  40. Material for the line.
  41. </div>
  42. <h2>Methods</h2>
  43. <h3>[method:Array raycast]([page:Raycaster raycaster], [page:Array intersects])</h3>
  44. <div>
  45. Get intersections between a casted ray and this Line. [page:Raycaster.intersectObject] will call this method.
  46. </div>
  47. <h2>Source</h2>
  48. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  49. </body>
  50. </html>