Euler.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">
  12. A class representing [link:http://en.wikipedia.org/wiki/Euler_angles Euler Angles].<br /><br />
  13. Euler angles describe a rotational transformation by rotating an object on its various
  14. axes in specified amounts per axis, and a specified axis order.
  15. </p>
  16. <h2>Code Example</h2>
  17. <code>const a = new THREE.Euler( 0, 1, 1.57, 'XYZ' );
  18. const b = new THREE.Vector3( 1, 0, 1 );
  19. b.applyEuler(a);
  20. </code>
  21. <h2>Constructor</h2>
  22. <h3>[name]( [param:Float x], [param:Float y], [param:Float z], [param:String order] )</h3>
  23. <p>
  24. [page:Float x] - (optional) the angle of the x axis in radians. Default is *0*.<br />
  25. [page:Float y] - (optional) the angle of the y axis in radians. Default is *0*.<br />
  26. [page:Float z] - (optional) the angle of the z axis in radians. Default is *0*.<br />
  27. [page:String order] - (optional) a string representing the order that the rotations are applied,
  28. defaults to 'XYZ' (must be upper case).<br /><br />
  29. </p>
  30. <h2>Properties</h2>
  31. <h3>[property:String order]</h3>
  32. <p>
  33. The order in which to apply rotations. Default is 'XYZ', which means that the object will first be
  34. rotated around its X axis, then its Y axis and finally its Z axis. Other possibilities are:
  35. 'YZX', 'ZXY', 'XZY', 'YXZ' and 'ZYX'. These must be in upper case.<br /><br />
  36. Three.js uses <em>intrinsic</em> Tait-Bryan angles. This means that rotations are performed with respect
  37. to the <em>local</em> coordinate system. That is, for order 'XYZ', the rotation is first around the local-X
  38. axis (which is the same as the world-X axis), then around local-Y (which may now be different from the
  39. world Y-axis), then local-Z (which may be different from the world Z-axis).<br /><br />
  40. </p>
  41. <h3>[property:Float x]</h3>
  42. <p>
  43. The current value of the x component.<br /><br />
  44. </p>
  45. <h3>[property:Float y]</h3>
  46. <p>
  47. The current value of the y component.<br /><br />
  48. </p>
  49. <h3>[property:Float z]</h3>
  50. <p>
  51. The current value of the z component.<br /><br />
  52. </p>
  53. <h2>Methods</h2>
  54. <h3>[method:Euler copy]( [param:Euler euler] )</h3>
  55. <p>Copies value of [page:Euler euler] to this euler.</p>
  56. <h3>[method:Euler clone]()</h3>
  57. <p>Returns a new Euler with the same parameters as this one.</p>
  58. <h3>[method:Boolean equals]( [param:Euler euler] )</h3>
  59. <p>Checks for strict equality of this euler and [page:Euler euler].</p>
  60. <h3>[method:Euler fromArray]( [param:Array array] )</h3>
  61. <p>
  62. [page:Array array] of length 3 or 4. The optional 4th argument corresponds to the [page:.order order].<br /><br />
  63. Assigns this euler's [page:.x x] angle to array[0]. <br />
  64. Assigns this euler's [page:.y y] angle to array[1]. <br />
  65. Assigns this euler's [page:.z z] angle to array[2]. <br />
  66. Optionally assigns this euler's [page:.order order] to array[3].
  67. </p>
  68. <h3>[method:Euler reorder]( [param:String newOrder] )</h3>
  69. <p>
  70. Resets the euler angle with a new order by creating a quaternion from this euler angle
  71. and then setting this euler angle with the quaternion and the new order. <br /><br />
  72. <em>WARNING</em>: this discards revolution information.
  73. </p>
  74. <h3>[method:Euler set]( [param:Float x], [param:Float y], [param:Float z], [param:String order] )</h3>
  75. <p>
  76. [page:.x x] - the angle of the x axis in radians.<br />
  77. [page:.y y] - the angle of the y axis in radians.<br />
  78. [page:.z z] - the angle of the z axis in radians.<br />
  79. [page:.order order] - (optional) a string representing the order that the rotations are applied.<br /><br />
  80. Sets the angles of this euler transform and optionally the [page:.order order].
  81. </p>
  82. <h3>[method:Euler setFromRotationMatrix]( [param:Matrix4 m], [param:String order] )</h3>
  83. <p>
  84. [page:Matrix4 m] - a [page:Matrix4] of which the upper 3x3 of matrix is a pure
  85. [link:https://en.wikipedia.org/wiki/Rotation_matrix rotation matrix] (i.e. unscaled).<br />
  86. [page:.order order] - (optional) a string representing the order that the rotations are applied.<br />
  87. Sets the angles of this euler transform from a pure rotation matrix based on the orientation
  88. specified by order.
  89. </p>
  90. <h3>[method:Euler setFromQuaternion]( [param:Quaternion q], [param:String order] )</h3>
  91. <p>
  92. [page:Quaternion q] - a normalized quaternion.<br />
  93. [page:.order order] - (optional) a string representing the order that the rotations are applied.<br />
  94. Sets the angles of this euler transform from a normalized quaternion based on the orientation
  95. specified by [page:.order order].
  96. </p>
  97. <h3>[method:Euler setFromVector3]( [param:Vector3 vector], [param:String order] )</h3>
  98. <p>
  99. [page:Vector3 vector] - [page:Vector3].<br />
  100. [page:.order order] - (optional) a string representing the order that the rotations are applied.<br /><br />
  101. Set the [page:.x x], [page:.y y] and [page:.z z], and optionally update the [page:.order order].
  102. </p>
  103. <h3>[method:Array toArray]( [param:Array array], [param:Integer offset] )</h3>
  104. <p>
  105. [page:Array array] - (optional) array to store the euler in.<br />
  106. [page:Integer offset] (optional) offset in the array.<br />
  107. Returns an array of the form [[page:.x x], [page:.y y], [page:.z z], [page:.order order ]].
  108. </p>
  109. <h3>[method:Vector3 toVector3]( [param:Vector3 optionalResult] )</h3>
  110. <p>
  111. [page:Vector3 optionalResult] — (optional) If specified, the result will be copied into this Vector,
  112. otherwise a new one will be created. <br /><br />
  113. Returns the Euler's [page:.x x], [page:.y y] and [page:.z z] properties as a [page:Vector3].
  114. </p>
  115. <h2>Source</h2>
  116. <p>
  117. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  118. </p>
  119. </body>
  120. </html>