Triangle.html 3.5 KB

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