Line.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 line or a series of lines.</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], [page:Integer type] )</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. type — Connection type between vertices. Default is THREE.LineStrip.
  32. </div>
  33. <div>If no material is supplied, a randomized line material will be created and assigned to the object.</div>
  34. <div>Also, if no type is supplied, the default (THREE.LineStrip) will be used).</div>
  35. <h2>Properties</h2>
  36. <h3>[property:Geometry geometry]</h3>
  37. <div>
  38. Vertices representing the line segment(s).
  39. </div>
  40. <h3>[property:Material material]</h3>
  41. <div>
  42. Material for the line.
  43. </div>
  44. <h3>[property:Integer type]</h3>
  45. <div>
  46. Possible values: THREE.LineStrip or THREE.LinePieces. THREE.LineStrip will draw a series of segments connecting each point (first connected to the second, the second connected to the third, and so on and so forth); and THREE.LinePieces will draw a series of pairs of segments (first connected to the second, the third connected to the fourth, and so on and so forth).</div>
  47. <div>
  48. In OpenGL terms, LineStrip is the classic GL_LINE_STRIP and LinePieces is the equivalent to GL_LINES.
  49. </div>
  50. <h2>Methods</h2>
  51. <h3>[method:Array raycast]([page:Raycaster raycaster], [page:Array intersects])</h3>
  52. <div>
  53. Get intersections between a casted ray and this Line. [page:Raycaster.intersectObject] will call this method.
  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>