ArrowHelper.html 2.7 KB

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