ArrowHelper.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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">An 3D arrow Object.</div>
  13. <h2>Example</h2>
  14. <code>var dir = new THREE.Vector3( 1, 0, 0 );
  15. var origin = new THREE.Vector3( 0, 0, 0 );
  16. var length = 1;
  17. var hex = 0xffff00;
  18. var arrowHelper = new THREE.ArrowHelper( dir, origin, length, hex );
  19. scene.add( arrowHelper );
  20. </code>
  21. <h2>Constructor</h2>
  22. <h3>[name]([page:Vector3 dir], [page:Vector3 origin], [page:Number length], [page:Number hex], [page:Number headLength], [page:Number headWidth] )</h3>
  23. <div>
  24. dir -- Vector3 -- direction from origin <br />
  25. origin -- Vector3 <br />
  26. length -- scalar <br />
  27. hex -- hexadecimal value to define color ex:0xffff00<br />
  28. headLength -- The length of the head of the arrow<br />
  29. headWidth -- The length of the width of the arrow
  30. </div>
  31. <div>
  32. This creates an arrow starting in origin in the direction dir for a certain length. It is also possible to change color.
  33. </div>
  34. <h2>Properties</h2>
  35. <h3>.[page:Line line]</h3>
  36. <div>
  37. Contains the line part of the arrowHelper.
  38. </div>
  39. <h3>.[page:Mesh cone]</h3>
  40. <div>
  41. Contains the cone part of the arrowHelper.
  42. </div>
  43. <h2>Methods</h2>
  44. <h3>.setColor([page:Number hex])</h3>
  45. <div>
  46. hex -- The hexadicmal value of the color
  47. </div>
  48. <div>
  49. Sets the color of the arrowHelper.
  50. </div>
  51. <h3>.setLength([page:Number length])</h3>
  52. <div>
  53. length -- The desired length
  54. </div>
  55. <div>
  56. Sets the length of the arrowhelper.
  57. </div>
  58. <h3>.setDirection([page:vector3 dir])</h3>
  59. <div>
  60. dir -- The desired direction in euler format.
  61. </div>
  62. <div>
  63. Sets the direction of the arrowhelper.
  64. </div>
  65. <h2>Source</h2>
  66. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  67. </body>
  68. </html>