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