Euler.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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
  14. its various axes in specified amounts per axis, and a specified axis
  15. order.
  16. </p>
  17. <p>
  18. Iterating through a [name] instance will yield its components (x, y, z,
  19. order) in the corresponding order.
  20. </p>
  21. <h2>Code Example</h2>
  22. <code>
  23. const a = new THREE.Euler( 0, 1, 1.57, 'XYZ' );
  24. const b = new THREE.Vector3( 1, 0, 1 );
  25. b.applyEuler(a);
  26. </code>
  27. <h2>Constructor</h2>
  28. <h3>
  29. [name]( [param:Float x], [param:Float y], [param:Float z], [param:String order] )
  30. </h3>
  31. <p>
  32. [page:Float x] - (optional) the angle of the x axis in radians. Default is
  33. `0`.<br />
  34. [page:Float y] - (optional) the angle of the y axis in radians. Default is
  35. `0`.<br />
  36. [page:Float z] - (optional) the angle of the z axis in radians. Default is
  37. `0`.<br />
  38. [page:String order] - (optional) a string representing the order that the
  39. rotations are applied, defaults to 'XYZ' (must be upper case).<br /><br />
  40. </p>
  41. <h2>Properties</h2>
  42. <h3>[property:Boolean isEuler]</h3>
  43. <p>Read-only flag to check if a given object is of type [name].</p>
  44. <h3>[property:String order]</h3>
  45. <p>
  46. The order in which to apply rotations. Default is 'XYZ', which means that
  47. the object will first be rotated around its X axis, then its Y axis and
  48. finally its Z axis. Other possibilities are: 'YZX', 'ZXY', 'XZY', 'YXZ'
  49. and 'ZYX'. These must be in upper case.<br /><br />
  50. Three.js uses `intrinsic` Tait-Bryan angles. This means that rotations are
  51. performed with respect to the `local` coordinate system. That is, for
  52. order 'XYZ', the rotation is first around the local-X axis (which is the
  53. same as the world-X axis), then around local-Y (which may now be different
  54. from the world Y-axis), then local-Z (which may be different from the
  55. world Z-axis).<br /><br />
  56. </p>
  57. <h3>[property:Float x]</h3>
  58. <p>The current value of the x component.<br /><br /></p>
  59. <h3>[property:Float y]</h3>
  60. <p>The current value of the y component.<br /><br /></p>
  61. <h3>[property:Float z]</h3>
  62. <p>The current value of the z component.<br /><br /></p>
  63. <h2>Methods</h2>
  64. <h3>[method:this copy]( [param:Euler euler] )</h3>
  65. <p>Copies value of [page:Euler euler] to this euler.</p>
  66. <h3>[method:Euler clone]()</h3>
  67. <p>Returns a new Euler with the same parameters as this one.</p>
  68. <h3>[method:Boolean equals]( [param:Euler euler] )</h3>
  69. <p>Checks for strict equality of this euler and [page:Euler euler].</p>
  70. <h3>[method:this fromArray]( [param:Array array] )</h3>
  71. <p>
  72. [page:Array array] of length 3 or 4. The optional 4th argument corresponds
  73. to the [page:.order order].<br /><br />
  74. Assigns this euler's [page:.x x] angle to `array[0]`. <br />
  75. Assigns this euler's [page:.y y] angle to `array[1]`. <br />
  76. Assigns this euler's [page:.z z] angle to `array[2]`. <br />
  77. Optionally assigns this euler's [page:.order order] to `array[3]`.
  78. </p>
  79. <h3>[method:this reorder]( [param:String newOrder] )</h3>
  80. <p>
  81. Resets the euler angle with a new order by creating a quaternion from this
  82. euler angle and then setting this euler angle with the quaternion and the
  83. new order. <br /><br />
  84. <em>*Warning*: this discards revolution information.</em>
  85. </p>
  86. <h3>
  87. [method:this set]( [param:Float x], [param:Float y], [param:Float z], [param:String order] )
  88. </h3>
  89. <p>
  90. [page:.x x] - the angle of the x axis in radians.<br />
  91. [page:.y y] - the angle of the y axis in radians.<br />
  92. [page:.z z] - the angle of the z axis in radians.<br />
  93. [page:.order order] - (optional) a string representing the order that the
  94. rotations are applied.<br /><br />
  95. Sets the angles of this euler transform and optionally the [page:.order order].
  96. </p>
  97. <h3>
  98. [method:this setFromRotationMatrix]( [param:Matrix4 m], [param:String order] )
  99. </h3>
  100. <p>
  101. [page:Matrix4 m] - a [page:Matrix4] of which the upper 3x3 of matrix is a
  102. pure [link:https://en.wikipedia.org/wiki/Rotation_matrix rotation matrix]
  103. (i.e. unscaled).<br />
  104. [page:.order order] - (optional) a string representing the order that the
  105. rotations are applied.<br />
  106. Sets the angles of this euler transform from a pure rotation matrix based
  107. on the orientation specified by order.
  108. </p>
  109. <h3>
  110. [method:this setFromQuaternion]( [param:Quaternion q], [param:String order] )
  111. </h3>
  112. <p>
  113. [page:Quaternion q] - a normalized quaternion.<br />
  114. [page:.order order] - (optional) a string representing the order that the
  115. rotations are applied.<br />
  116. Sets the angles of this euler transform from a normalized quaternion based
  117. on the orientation specified by [page:.order order].
  118. </p>
  119. <h3>
  120. [method:this setFromVector3]( [param:Vector3 vector], [param:String order] )
  121. </h3>
  122. <p>
  123. [page:Vector3 vector] - [page:Vector3].<br />
  124. [page:.order order] - (optional) a string representing the order that the
  125. rotations are applied.<br /><br />
  126. Set the [page:.x x], [page:.y y] and [page:.z z], and optionally update
  127. the [page:.order order].
  128. </p>
  129. <h3>
  130. [method:Array toArray]( [param:Array array], [param:Integer offset] )
  131. </h3>
  132. <p>
  133. [page:Array array] - (optional) array to store the euler in.<br />
  134. [page:Integer offset] (optional) offset in the array.<br />
  135. Returns an array of the form [[page:.x x], [page:.y y], [page:.z z],
  136. [page:.order order ]].
  137. </p>
  138. <h2>Source</h2>
  139. <p>
  140. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  141. </p>
  142. </body>
  143. </html>