Triangle.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. <h1>[name]</h1>
  11. <p class="desc">
  12. Un triangolo geometrico definito da tre [page:Vector3 Vector3] che rappresentano i suoi tre angoli.
  13. </p>
  14. <h2>Costruttore</h2>
  15. <h3>[name]( [param:Vector3 a], [param:Vector3 b], [param:Vector3 c] )</h3>
  16. <p>
  17. [page:Vector3 a] - il primo angolo del triangolo. Il valore predefinito è un [page:Vector3] a `(0, 0, 0)`.<br />
  18. [page:Vector3 b] - il secondo angolo del triangolo. Il valore predefinito è un [page:Vector3] a `(0, 0, 0)`.<br />
  19. [page:Vector3 c] - il terzo angolo del triangolo. Il valore predefinito è un [page:Vector3] a `(0, 0, 0)`.<br /><br />
  20. Crea un nuovo [name].
  21. </p>
  22. <h2>Proprietà</h2>
  23. <h3>[property:Vector3 a]</h3>
  24. <p>
  25. Il primo angolo del triangolo. Il valore predefinito è un [page:Vector3] a `(0, 0, 0)`.
  26. </p>
  27. <h3>[property:Vector3 b]</h3>
  28. <p>
  29. Il secondo angolo del triangolo. Il valore predefinito è un [page:Vector3] a `(0, 0, 0)`.
  30. </p>
  31. <h3>[property:Vector3 c]</h3>
  32. <p>
  33. Il terzo angolo del triangolo. Il valore predefinito è un [page:Vector3] a `(0, 0, 0)`.
  34. </p>
  35. <h2>Metodi</h2>
  36. <h3>[method:Triangle clone]()</h3>
  37. <p>
  38. Restituisce un nuovo triangolo con le stesse proprietà [page:.a a], [page:.b b] e [page:.c c] di questo.
  39. </p>
  40. <h3>[method:Vector3 closestPointToPoint]( [param:Vector3 point], [param:Vector3 target] )</h3>
  41. <p>
  42. [page:Vector3 point] - [page:Vector3] <br />
  43. [page:Vector3 target] — il risultato sarà copiato in questo Vector3.<br /><br />
  44. Restituisce il punto più vicino del triangolo al [page:Vector3 punto].
  45. </p>
  46. <h3>[method:Boolean containsPoint]( [param:Vector3 point] )</h3>
  47. <p>
  48. [page:Vector3 point] - [page:Vector3] da controllare.<br /><br />
  49. Restituisce true se il punto passato, quando proiettato sul piano del triangolo, si trova all'interno del triangolo.
  50. </p>
  51. <h3>[method:this copy]( [param:Triangle triangle] )</h3>
  52. <p>
  53. Copia i valori delle proprietà [page:.a a], [page:.b b] e [page:.c c] del triangolo passato in questo triangolo.
  54. </p>
  55. <h3>[method:Boolean equals]( [param:Triangle triangle] )</h3>
  56. <p>
  57. Restituisce true se i due triangoli hanno le proprietà [page:.a a], [page:.b b] e [page:.c c] identiche.
  58. </p>
  59. <h3>[method:Float getArea]()</h3>
  60. <p>Restituisce l'area del triangolo.</p>
  61. <h3>[method:Vector3 getBarycoord]( [param:Vector3 point], [param:Vector3 target] )</h3>
  62. <p>
  63. [page:Vector3 point] - [page:Vector3] <br />
  64. [page:Vector3 target] — il risultato sarà copiato in questo Vector3.<br /><br />
  65. Restituisce una [link:https://en.wikipedia.org/wiki/Barycentric_coordinate_system coordinata baricentrica]
  66. dal vettore dato. <br/><br/>
  67. [link:http://commons.wikimedia.org/wiki/File:Barycentric_coordinates_1.png Figura delle coordinate baricentriche]
  68. </p>
  69. <h3>[method:Vector3 getMidpoint]( [param:Vector3 target] )</h3>
  70. <p>
  71. [page:Vector3 target] — il risultato sarà copiato in questo Vector3.<br /><br />
  72. Calcola il punto medio del triangolo.
  73. </p>
  74. <h3>[method:Vector3 getNormal]( [param:Vector3 target] )</h3>
  75. <p>
  76. [page:Vector3 target] — il risultato sarà copiato in questo Vector3.<br /><br />
  77. Calcola il [link:https://en.wikipedia.org/wiki/Normal_(geometry) vettore normale] del triangolo.
  78. </p>
  79. <h3>[method:Plane getPlane]( [param:Plane target] )</h3>
  80. <p>
  81. [page:Plane target] — il risultato sarà copiato in questo Plane.<br /><br />
  82. Calcola il [page:Plane piano] in base al triangolo.
  83. </p>
  84. <h3>[method:Vector2 getInterpolation]( [param:Vector3 point], [param:Vector2 v1] | [param:Vector3 v1] | [param:Vector4 v1], [param:Vector2 v2] | [param:Vector3 v2] | [param:Vector4 v3], [param:Vector2 v3] | [param:Vector3 v3] | [param:Vector4 v3], [param:Vector2 target] )</h3>
  85. <p>
  86. [page:Vector3 point] - Il punto sul triangolo.<br />
  87. [page:Vector2 v1] - La valore del primo vertice del triangolo.<br />
  88. [page:Vector2 v2] - La valore del secondo vertice del triangolo.<br />
  89. [page:Vector2 v3] - La valore del terzo vertice del triangolo.<br />
  90. [page:Vector2 target] — il risultato sarà copiato in questo Vector.<br /><br />
  91. Restituisce le valore interpolato baricentricamente per il punto specificato sul triangolo.
  92. </p>
  93. <h3>[method:Boolean intersectsBox]( [param:Box3 box] )</h3>
  94. <p>
  95. [page:Box3 box] - Box per il controllo dell'intersezione.<br /><br />
  96. Determina se il triangolo interseca [page:Box3 box] oppure no.
  97. </p>
  98. <h3>[method:Boolean isFrontFacing]( [param:Vector3 direction] )</h3>
  99. <p>
  100. [page:Vector3 direction] - La distanza da testare.<br /><br />
  101. Determina se il triangolo è orientato verso la direzione data o no.
  102. </p>
  103. <h3>[method:this set]( [param:Vector3 a], [param:Vector3 b], [param:Vector3 c] ) [param:Triangle this]</h3>
  104. <p>
  105. Imposta le proprietà [page:.a a], [page:.b b] e [page:.c c] del triangolo ai [page:Vector3 vector3] passati.<br>
  106. Si noti che questo metodo copia solamente i valori da un dato oggetto.
  107. </p>
  108. <h3>[method:this setFromAttributeAndIndices]( [param:BufferAttribute attribute], [param:Integer i0], [param:Integer i1], [param:Integer i2] ) [param:Triangle this]</h3>
  109. <p>
  110. attribute - [page:BufferAttribute] dei dati del vertice <br />
  111. i0 - [page:Integer] indice <br />
  112. i1 - [page:Integer] indice <br />
  113. i2 - [page:Integer] indice<br /><br />
  114. Imposta i vertici del triangolo dai dati dei vertici dell'attributo buffer.
  115. </p>
  116. <h3>[method:this setFromPointsAndIndices]( [param:Array points], [param:Integer i0], [param:Integer i1], [param:Integer i2] ) [param:Triangle this]</h3>
  117. <p>
  118. points - [page:Array] di [page:Vector3] <br />
  119. i0 - [page:Integer] indice <br />
  120. i1 - [page:Integer] indice <br />
  121. i2 - [page:Integer] indice<br /><br />
  122. Imposta i vettori del triangolo ai vettori nell'array.
  123. </p>
  124. <h2>Source</h2>
  125. <p>
  126. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  127. </p>
  128. </body>
  129. </html>