ArrowHelper.html 2.0 KB

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