Triangle.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. <h1>[name]</h1>
  11. <div class="desc">A geometric triangle as defined by three vectors.</div>
  12. <h2>Constructor</h2>
  13. <h3>[name]([page:Vector3 a], [page:Vector3 b], [page:Vector3 c])</h3>
  14. <div>
  15. a -- [page:Vector3] <br />
  16. b -- [page:Vector3] <br />
  17. c -- [page:Vector3]
  18. </div>
  19. <div>
  20. Sets the triangle's vectors to the passed vectors.
  21. </div>
  22. <h2>Properties</h2>
  23. <h3>[property:Vector3 a]</h3>
  24. <div>
  25. The first [page:Vector3] of the triangle.
  26. </div>
  27. <h3>[property:Vector3 b]</h3>
  28. <div>
  29. The second [page:Vector3] of the triangle.
  30. </div>
  31. <h3>[property:Vector3 c]</h3>
  32. <div>
  33. The third [page:Vector3] of the triangle.
  34. </div>
  35. <h2>Methods</h2>
  36. <h3>[method:Triangle setFromPointsAndIndices]([page:Array points], [page:Integer i0], [page:Integer i1], [page:Integer i2]) [page:Triangle this]</h3>
  37. <div>
  38. points -- [page:Array] of [page:Vector3]s <br />
  39. i0 -- [page:Integer] index <br />
  40. i1 -- [page:Integer] index <br />
  41. i2 -- [page:Integer] index
  42. </div>
  43. <div>
  44. Sets the triangle's vectors to the vectors in the array.
  45. </div>
  46. <h3>[method:Triangle set]([page:Vector3 a], [page:Vector3 b], [page:Vector3 c]) [page:Triangle this]</h3>
  47. <div>
  48. a -- [page:Vector3] <br />
  49. b -- [page:Vector3] <br />
  50. c -- [page:Vector3]
  51. </div>
  52. <div>
  53. Sets the triangle's vectors to the passed vectors.
  54. </div>
  55. <h3>[method:Vector3 normal]([page:Vector3 optionalTarget])</h3>
  56. <div>
  57. optionalTarget -- Optional [page:Vector3] target to set the result.
  58. </div>
  59. <div>
  60. Return the calculated normal of the triangle.
  61. </div>
  62. <h3>[method:Vector3 barycoordFromPoint]([page:Vector3 point], [page:Vector3 optionalTarget])</h3>
  63. <div>
  64. point -- [page:Vector3] <br />
  65. optionalTarget -- Optional [page:Vector3] target to set the result.
  66. </div>
  67. <div>
  68. Return a barycentric coordinate from the given vector. <br/><br/>
  69. [link:http://commons.wikimedia.org/wiki/File:Barycentric_coordinates_1.png](Picture of barycentric coordinates)
  70. </div>
  71. <h3>[method:Triangle clone]()</h3>
  72. <div>
  73. Return a new copy of this triangle.
  74. </div>
  75. <h3>[method:Float area]()</h3>
  76. <div>
  77. Return the area of the triangle.
  78. </div>
  79. <h3>[method:Vector3 midpoint]([page:Vector3 optionalTarget])</h3>
  80. <div>
  81. optionalTarget -- Optional [page:Vector3] target to set the result.
  82. </div>
  83. <div>
  84. Return the midpoint of the triangle. Optionally sets a target vector.
  85. </div>
  86. <h3>[method:Boolean equals]([page:Triangle triangle])</h3>
  87. <div>
  88. triangle -- [page:Triangle]
  89. </div>
  90. <div>
  91. Checks to see if two triangles are equal (share the same vectors).
  92. </div>
  93. <h3>[method:Plane plane]([page:Plane optionalTarget])</h3>
  94. <div>
  95. optionalTarget -- Optional [page:Plane] target to set the result.
  96. </div>
  97. <div>
  98. Return a [page:Plane plane] based on the triangle. Optionally sets a target plane.
  99. </div>
  100. <h3>[method:Boolean containsPoint]([page:Vector3 point])</h3>
  101. <div>
  102. point -- [page:Vector3]
  103. </div>
  104. <div>
  105. Checks to see if the passed vector is within the triangle.
  106. </div>
  107. <h3>[method:Triangle copy]([page:Triangle triangle])</h3>
  108. <div>
  109. triangle -- [page:Triangle]
  110. </div>
  111. <div>
  112. Copies the values of the vertices of the passed triangle to this triangle.
  113. </div>
  114. <h2>Source</h2>
  115. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  116. </body>
  117. </html>