ArrowHelper.html 2.6 KB

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