2
0

Line.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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( new THREE.Vector3( -10, 0, 0 ) );
  19. geometry.vertices.push( new THREE.Vector3( 0, 10, 0 ) );
  20. geometry.vertices.push( new THREE.Vector3( 10, 0, 0 ) );
  21. var line = new THREE.Line( geometry, material );
  22. scene.add( line );
  23. </code>
  24. <h2>Constructor</h2>
  25. <h3>[name]( [page:Geometry geometry], [page:Material material], [page:Integer type] )</h3>
  26. <div>
  27. geometry — Vertices representing the line segment(s).<br />
  28. material — Material for the line. Default is [page:LineBasicMaterial LineBasicMaterial].<br />
  29. type — Connection type between vertices. Default is THREE.LineStrip.
  30. </div>
  31. <div>If no material is supplied, a randomized line material will be created and assigned to the object.</div>
  32. <div>Also, if no type is supplied, the default (THREE.LineStrip) will be used).</div>
  33. <h2>Properties</h2>
  34. <h3>.[page:Geometry geometry]</h3>
  35. <div>
  36. Vertices representing the line segment(s).
  37. </div>
  38. <h3>.[page:Material material]</h3>
  39. <div>
  40. Material for the line.
  41. </div>
  42. <h3>.[page:Integer type]</h3>
  43. <div>
  44. 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>
  45. <div>
  46. In OpenGL terms, LineStrip is the classic GL_LINE_STRIP and LinePieces is the equivalent to GL_LINES.
  47. </div>
  48. <h2>Methods</h2>
  49. <h2>Source</h2>
  50. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  51. </body>
  52. </html>