ArrowHelper.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. [page:Object3D] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">An 3D arrow object for visualizing directions.</p>
  14. <h2>Code Example</h2>
  15. <code>
  16. var dir = new THREE.Vector3( 1, 2, 0 );
  17. //normalize the direction vector (convert to vector of length 1)
  18. dir.normalize();
  19. var origin = new THREE.Vector3( 0, 0, 0 );
  20. var length = 1;
  21. var hex = 0xffff00;
  22. var arrowHelper = new THREE.ArrowHelper( dir, origin, length, hex );
  23. scene.add( arrowHelper );
  24. </code>
  25. <h2>Examples</h2>
  26. <p>
  27. [example:webgl_shadowmesh WebGL / shadowmesh]
  28. </p>
  29. <h2>Constructor</h2>
  30. <h3>[name]([param:Vector3 dir], [param:Vector3 origin], [param:Number length], [param:Number hex], [param:Number headLength], [param:Number headWidth] )</h3>
  31. <p>
  32. [page:Vector3 dir] -- direction from origin. Must be a unit vector. <br />
  33. [page:Vector3 origin] -- Point at which the arrow starts.<br />
  34. [page:Number length] -- length of the arrow. Default is *1*.<br />
  35. [page:Number hex] -- hexadecimal value to define color. Default is 0xffff00.<br />
  36. [page:Number headLength] -- The length of the head of the arrow. Default is 0.2 * length.<br />
  37. [page:Number headWidth] -- The width of the head of the arrow. Default is 0.2 * headLength.<br />
  38. </p>
  39. <h2>Properties</h2>
  40. <p>See the base [page:Object3D] class for common properties.</p>
  41. <h3>[property:Line line]</h3>
  42. <p>Contains the line part of the arrowHelper.</p>
  43. <h3>[property:Mesh cone]</h3>
  44. <p>Contains the cone part of the arrowHelper.</p>
  45. <h2>Methods</h2>
  46. <p>See the base [page:Object3D] class for common methods.</p>
  47. <h3>[method:null setColor]([param:Color color])</h3>
  48. <p>
  49. color -- The desired color.<br /><br />
  50. Sets the color of the arrowHelper.
  51. </p>
  52. <h3>[method:null setLength]([param:Number length], [param:Number headLength], [param:Number headWidth])</h3>
  53. <p>
  54. length -- The desired length.<br />
  55. headLength -- The length of the head of the arrow.<br />
  56. headWidth -- The width of the head of the arrow.<br /><br />
  57. Sets the length of the arrowhelper.
  58. </p>
  59. <h3>[method:null setDirection]([param:Vector3 dir])</h3>
  60. <p>
  61. dir -- The desired direction. Must be a unit vector.<br /><br />
  62. Sets the direction of the arrowhelper.
  63. </p>
  64. <h2>Source</h2>
  65. <p>
  66. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  67. </p>
  68. </body>
  69. </html>