Line.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <!DOCTYPE html>
  2. <html lang="it">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  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. <p class="desc">
  13. Una linea continua.<br /><br />
  14. Questo è quasi lo stesso di [page:LineSegments]; l'unica differenza è che questo viene renderizzato utilizzando
  15. [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP]
  16. invece di [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINES]
  17. </p>
  18. <h2>Codice di Esempio</h2>
  19. <code>
  20. const material = new THREE.LineBasicMaterial({
  21. color: 0x0000ff
  22. });
  23. const points = [];
  24. points.push( new THREE.Vector3( - 10, 0, 0 ) );
  25. points.push( new THREE.Vector3( 0, 10, 0 ) );
  26. points.push( new THREE.Vector3( 10, 0, 0 ) );
  27. const geometry = new THREE.BufferGeometry().setFromPoints( points );
  28. const line = new THREE.Line( geometry, material );
  29. scene.add( line );
  30. </code>
  31. <h2>Costruttore</h2>
  32. <h3>[name]( [param:BufferGeometry geometry], [param:Material material] )</h3>
  33. <p>
  34. [page:BufferGeometry geometry] — vertici che rappresentano il segmento(i) di linea. Il valore predefinito è una nuova [page:BufferGeometry].<br />
  35. [page:Material material] — materiale per la linea. Il valore predefinito è una nuova [page:LineBasicMaterial].<br />
  36. </p>
  37. <h2>Proprietà</h2>
  38. <p>Vedi la classe base [page:Object3D] per le proprietà comuni.</p>
  39. <h3>[property:BufferGeometry geometry]</h3>
  40. <p>Vertici che rappresentano il segmento(i) di linea.</p>
  41. <h3>[property:Boolean isLine]</h3>
  42. <p>
  43. Flag di sola lettura per verificare se l'oggetto dato è di tipo [name].
  44. </p>
  45. <h3>[property:Material material]</h3>
  46. <p>Materiale per la linea.</p>
  47. <h3>[property:Array morphTargetInfluences]</h3>
  48. <p>
  49. Un array di pesi solitamente da 0 a 1 che specifica la quantità di morph applicata.
  50. Non definito per impostazione predefinita, ma reimpostato su un array vuoto da [page:.updateMorphTargets]().
  51. </p>
  52. <h3>[property:Object morphTargetDictionary]</h3>
  53. <p>
  54. Un dizionario di morphTargets basato sulla proprietà morphTarget.name.
  55. Non definito per impostazione predefinita, ma ricompilato [page:.updateMorphTargets]().
  56. </p>
  57. <h2>Metodi</h2>
  58. <p>Vedi la classe base [page:Object3D] per i metodi comuni.</p>
  59. <h3>[method:this computeLineDistances]()</h3>
  60. <p>
  61. Calcola un array di valori di distanza necessari per [page:LineDashedMaterial].
  62. Per ogni vertice nella geometria, il metodo calcola la lunghezza cumulativa dal punto
  63. corrente fino all'inizio della linea.
  64. </p>
  65. <h3>[method:undefined raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
  66. <p>
  67. Ottiene le intersezioni tra un [page:Ray] lanciato e questa linea.
  68. [page:Raycaster.intersectObject] chiamerà questo metodo.
  69. </p>
  70. <h3>[method:undefined updateMorphTargets]()</h3>
  71. <p>
  72. Aggiorna i morphTargets in modo che non abbiano alcuna influenza sull'oggetto.
  73. Reimposta le proprietà [page:.morphTargetInfluences] e [page:.morphTargetDictionary].
  74. </p>
  75. <h2>Source</h2>
  76. <p>
  77. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  78. </p>
  79. </body>
  80. </html>