Line.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. [page:Geometry geometry] — vertices representing the line segment(s). Default is a new [page:new BufferGeometry].<br />
  31. [page:Material material] — material for the line. Default is a new [page:LineBasicMaterial] with random color.<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. <div>See the base [page:Object3D] class for common properties.</div>
  36. <h3>[property:Boolean isLine]</h3>
  37. <div>
  38. Used to check whether this or derived classes are lines. Default is *true*.<br /><br />
  39. You should not change this, as it used internally for optimisation.
  40. </div>
  41. <h3>[property:Geometry geometry]</h3>
  42. <div>Vertices representing the line segment(s).</div>
  43. <h3>[property:Material material]</h3>
  44. <div>Material for the line.</div>
  45. <h2>Methods</h2>
  46. <div>See the base [page:Object3D] class for common methods.</div>
  47. <h3>[method:Array raycast]( [page:Raycaster raycaster], [page:Array intersects] )</h3>
  48. <div>
  49. Get intersections between a casted [page:Ray] and this Line.
  50. [page:Raycaster.intersectObject] will call this method.
  51. </div>
  52. <h3>[method:Line clone]()</h3>
  53. <div>
  54. Returns a clone of this Line object and its descendants.
  55. </div>
  56. <h2>Source</h2>
  57. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  58. </body>
  59. </html>