ArrowHelper.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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">用于模拟方向的3维箭头对象.</p>
  14. <h2>代码示例</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>例子</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>构造函数</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] -- 基于箭头原点的方向. 必须为单位向量. <br />
  35. [page:Vector3 origin] -- 箭头的原点.<br />
  36. [page:Number length] -- 箭头的长度. 默认为 *1*.<br />
  37. [page:Number hex] -- 定义的16进制颜色值. 默认为 0xffff00.<br />
  38. [page:Number headLength] -- 箭头头部(锥体)的长度. 默认为箭头长度的0.2倍(0.2 * length).<br />
  39. [page:Number headWidth] -- The width of the head of the arrow. Default is 0.2 * headLength.
  40. </p>
  41. <h2>属性</h2>
  42. <p>请到基类 [page:Object3D] 页面查看公共属性.</p>
  43. <h3>[property:Line line]</h3>
  44. <p>包含箭头辅助对象的线段部分.</p>
  45. <h3>[property:Mesh cone]</h3>
  46. <p>包含箭头辅助对象的锥体部分.</p>
  47. <h2>方法</h2>
  48. <p>请到基类 [page:Object3D] 页面查看公共方法.</p>
  49. <h3>[method:null setColor]([param:Color color])</h3>
  50. <p>
  51. color -- 所需的颜色。<br /><br />
  52. 设置箭头辅助对象的颜色.
  53. </p>
  54. <h3>[method:null setLength]([param:Number length], [param:Number headLength], [param:Number headWidth])</h3>
  55. <p>
  56. length -- 要设置的长度.<br />
  57. headLength -- 要设置的箭头头部(锥体)的长度.<br />
  58. headWidth -- The width of the head of the arrow.<br /><br />
  59. 设置箭头辅助对象的长度.
  60. </p>
  61. <h3>[method:null setDirection]([param:Vector3 dir])</h3>
  62. <p>
  63. dir -- 要设置的方向. 必须为单位向量.<br /><br />
  64. 设置箭头辅助对象的方向.
  65. </p>
  66. <h2>源码</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>