|
11 | 11 | <h1>[name]</h1> |
12 | 12 |
|
13 | 13 | <p class="desc"> |
14 | | - A class representing [link:http://en.wikipedia.org/wiki/Euler_angles Euler Angles].<br /><br /> |
15 | | - |
16 | | - Euler angles describe a rotational transformation by rotating an object on its various |
17 | | - axes in specified amounts per axis, and a specified axis order. |
| 14 | + 表示 [link:http://en.wikipedia.org/wiki/Euler_angles Euler] 的类。<br /><br /> |
| 15 | + 欧拉角描述一个旋转变换,通过指定轴顺序和其各个轴向上的指定旋转角度来旋转一个物体。 |
18 | 16 | </p> |
19 | 17 |
|
20 | | - <h2>Example</h2> |
| 18 | + <h2>示例(Example)</h2> |
21 | 19 |
|
22 | 20 | <code>var a = new THREE.Euler( 0, 1, 1.57, 'XYZ' ); |
23 | 21 | var b = new THREE.Vector3( 1, 0, 1 ); |
24 | 22 | b.applyEuler(a); |
25 | 23 | </code> |
26 | 24 |
|
27 | 25 |
|
28 | | - <h2>Constructor</h2> |
| 26 | + <h2>构造器(Constructor)</h2> |
29 | 27 |
|
30 | 28 |
|
31 | 29 | <h3>[name]( [param:Float x], [param:Float y], [param:Float z], [param:String order] )</h3> |
32 | 30 | <p> |
33 | | - [page:Float x] - (optional) the angle of the x axis in radians. Default is *0*.<br /> |
34 | | - [page:Float y] - (optional) the angle of the y axis in radians. Default is *0*.<br /> |
35 | | - [page:Float z] - (optional) the angle of the z axis in radians. Default is *0*.<br /> |
36 | | - [page:String order] - (optional) a string representing the order that the rotations are applied, |
37 | | - defaults to 'XYZ' (must be upper case).<br /><br /> |
| 31 | + [page:Float x] - (optional) 用弧度表示x轴旋转量。 默认值是 *0*。<br /> |
| 32 | + [page:Float y] - (optional) 用弧度表示y轴旋转量。 默认值是 *0*。<br /> |
| 33 | + [page:Float z] - (optional) 用弧度表示z轴旋转量。 默认值是 *0*。<br /> |
| 34 | + [page:String order] - (optional) 表示旋转顺序的字符串,默认为'XYZ'(必须是大写)。<br /><br /> |
38 | 35 |
|
39 | 36 | </p> |
40 | 37 |
|
41 | 38 |
|
42 | | - <h2>Properties</h2> |
| 39 | + <h2>属性(Properties)</h2> |
43 | 40 |
|
44 | 41 | <h3>[property:Boolean isEuler]</h3> |
45 | 42 | <p> |
46 | | - Used to check whether this or derived classes are Eulers. Default is *true*.<br /><br /> |
47 | | - |
48 | | - You should not change this, as it used internally for optimisation. |
| 43 | + 用于判定此对象或者此类的派生对象是否是欧拉角。默认值为 *true*。<br /><br /> |
| 44 | + |
| 45 | + 不应该改变该值,因为它在内部用于优化。 |
49 | 46 | </p> |
50 | 47 |
|
51 | 48 | <h3>[property:String order]</h3> |
52 | 49 | <p> |
53 | | - The order in which to apply rotations. Default is 'XYZ', which means that the object will first be |
54 | | - rotated around its X axis, then its Y axis and finally its Z axis. Other possibilities are: |
55 | | - 'YZX', 'ZXY', 'XZY', 'YXZ' and 'ZYX'. These must be in upper case.<br /><br /> |
| 50 | + order值应用于旋转顺序。默认值为 'XYZ',这意味着对象将首先是 |
| 51 | + 绕X轴旋转,然后是Y轴,最后是Z轴。其他可能性包括: |
| 52 | + 'YZX', 'ZXY', 'XZY', 'YXZ'和'ZYX'。这些必须是大写字母。<br /><br /> |
| 53 | + Three.js 使用<em>intrinsic</em> Tait-Bryan angles(Yaw、Pitch、Roll)。 |
| 54 | + 这意味着旋转是在<em>本地</em>坐标系下进行的。也就是说,对于“XYZ”订单,首先是围绕local-X轴旋转(与world- x轴相同), |
| 55 | + 然后是local-Y(现在可能与world y轴不同),然后是local-Z(可能与world z轴不同)。<br /><br /> |
56 | 56 |
|
57 | | - Three.js uses <em>intrinsic</em> Tait-Bryan angles. This means that rotations are performed with respect |
58 | | - to the <em>local</em> coordinate system. That is, for order 'XYZ', the rotation is first around the local-X |
59 | | - axis (which is the same as the world-X axis), then around local-Y (which may now be different from the |
60 | | - world Y-axis), then local-Z (which may be different from the world Z-axis).<br /><br /> |
61 | | - |
62 | | - If the order is changed, [page:.onChangeCallback onChangeCallback] will be called. |
| 57 | + 如果order值被改变,[page:.onChangeCallback onChangeCallback] 会被调用。 |
63 | 58 | </p> |
64 | 59 |
|
65 | 60 | <h3>[property:Float x]</h3> |
66 | 61 | <p> |
67 | | - The current value of the x component.<br /><br /> |
| 62 | + 当前x分量的值。<br /><br /> |
68 | 63 |
|
69 | | - If this is changed, [page:.onChangeCallback onChangeCallback] will be called. |
| 64 | + 如果这个值发生变化,[page:.onChangeCallback onChangeCallback] 会被调用。 |
70 | 65 | </p> |
71 | 66 |
|
72 | 67 | <h3>[property:Float y]</h3> |
73 | 68 | <p> |
74 | | - The current value of the y component.<br /><br /> |
| 69 | + 当前y分量的值。<br /><br /> |
75 | 70 |
|
76 | | - If this is changed, [page:.onChangeCallback onChangeCallback] will be called. |
| 71 | + 如果这个值发生变化,[page:.onChangeCallback onChangeCallback] 会被调用。 |
77 | 72 | </p> |
78 | 73 |
|
79 | 74 | <h3>[property:Float z]</h3> |
80 | 75 | <p> |
81 | | - The current value of the z component.<br /><br /> |
| 76 | + 当前z分量的值。<br /><br /> |
82 | 77 |
|
83 | | - If this is changed, [page:.onChangeCallback onChangeCallback] will be called. |
| 78 | + 如果这个值发生变化,[page:.onChangeCallback onChangeCallback] 会被调用。 |
84 | 79 | </p> |
85 | 80 |
|
86 | | - <h2>Methods</h2> |
| 81 | + <h2>方法(Methods)</h2> |
87 | 82 |
|
88 | 83 | <h3>[method:Euler copy]( [param:Euler euler] )</h3> |
89 | | - <p>Copies value of [page:Euler euler] to this euler.</p> |
| 84 | + <p>将 [page:Euler euler] 的属性拷贝到当前对象。</p> |
90 | 85 |
|
91 | 86 | <h3>[method:Euler clone]()</h3> |
92 | | - <p>Returns a new Euler with the same parameters as this one.</p> |
| 87 | + <p>返回一个与当前参数相同的新欧拉角。</p> |
93 | 88 |
|
94 | 89 | <h3>[method:Boolean equals]( [param:Euler euler] )</h3> |
95 | | - <p>Checks for strict equality of this euler and [page:Euler euler].</p> |
| 90 | + <p>检查 [page:Euler euler] 是否与当前对象相同。</p> |
96 | 91 |
|
97 | 92 | <h3>[method:Euler fromArray]( [param:Array array] )</h3> |
98 | 93 | <p> |
99 | | - [page:Array array] of length 3 or 4. The optional 4th argument corresponds to the [page:.order order].<br /><br /> |
100 | | - |
101 | | - Assigns this euler's [page:.x x] angle to array[0]. <br /> |
102 | | - Assigns this euler's [page:.y y] angle to array[1]. <br /> |
103 | | - Assigns this euler's [page:.z z] angle to array[2]. <br /> |
104 | | - Optionally assigns this euler's [page:.order order] to array[3]. |
| 94 | + 长度为3或4的一个 [page:Array array] 。array[3] 是一个可选的 [page:.order order] 参数。<br /><br /> |
| 95 | + |
| 96 | + 将欧拉角的x分量设置为 array[0]。 <br /> |
| 97 | + 将欧拉角的x分量设置为 array[1]。 <br /> |
| 98 | + 将欧拉角的x分量设置为 array[2]。 <br /> |
| 99 | + 将array[3]设置给欧拉角的 [page:.order order] 。可选。 |
105 | 100 | </p> |
106 | 101 |
|
107 | 102 | <h3>[method:Euler onChange]( [param:Function onChangeCallback] )</h3> |
108 | 103 | <p> |
109 | | - [page:Function onChangeCallback] - set the value of the onChangeCallback() function. |
| 104 | + [page:Function onChangeCallback] - 为 onChangeCallback() 函数赋值。 |
110 | 105 | </p> |
111 | 106 |
|
112 | 107 | <h3>[method:Euler onChangeCallback]( )</h3> |
113 | 108 | <p> |
114 | | - By default this is an empty function, however it can be set via [page:.onChange onChange]().<br /> |
115 | | - It gets called after changing the [page:.x x], [page:.y y], [page:.z z] or [page:.order order] properties, |
116 | | - and also after calling most setter functions (see those for details). |
| 109 | + 默认情况下,这个函数为空,但是它可以通过[page:.onChange onChange]()来设置。<br /> |
| 110 | + 在更改 [page:.x x], [page:.y y], [page:.z z] 或 [page:.order order] 属性之后调用它, |
| 111 | + 在调用大多数setter函数之后也会调用它(详细信息请参阅那些函数)。 |
117 | 112 | </p> |
118 | 113 |
|
119 | 114 | <h3>[method:Euler reorder]( [param:String newOrder] )</h3> |
120 | 115 | <p> |
121 | | - Resets the euler angle with a new order by creating a quaternion from this euler angle |
122 | | - and then setting this euler angle with the quaternion and the new order. <br /><br /> |
| 116 | + 通过这个欧拉角创建一个四元数,然后用这个四元数和新顺序设置这个欧拉角。 <br /><br /> |
123 | 117 |
|
124 | | - <em>WARNING</em>: this discards revolution information. |
| 118 | + <em>警告</em>: 这将弃用旋转信息。 |
125 | 119 | </p> |
126 | 120 |
|
127 | 121 | <h3>[method:Euler set]( [param:Float x], [param:Float y], [param:Float z], [param:String order] )</h3> |
128 | 122 | <p> |
129 | | - [page:.x x] - the angle of the x axis in radians.<br /> |
130 | | - [page:.y y] - the angle of the y axis in radians.<br /> |
131 | | - [page:.z z] - the angle of the z axis in radians.<br /> |
132 | | - [page:.order order] - (optional) a string representing the order that the rotations are applied.<br /><br /> |
| 123 | + [page:.x x] - 用弧度表示x轴旋转量。<br /> |
| 124 | + [page:.y y] - 用弧度表示y轴旋转量。<br /> |
| 125 | + [page:.z z] - 用弧度表示z轴旋转量。<br /> |
| 126 | + [page:.order order] - (optional) 表示旋转顺序的字符串。<br /><br /> |
133 | 127 |
|
134 | | - Sets the angles of this euler transform and optionally the [page:.order order] and then call [page:.onChangeCallback onChangeCallback](). |
| 128 | + 设置该欧拉变换的角度和旋转顺序 [page:.order order] ,然后调用 [page:.onChangeCallback onChangeCallback]()。 |
135 | 129 | </p> |
136 | 130 |
|
137 | 131 | <h3>[method:Euler setFromRotationMatrix]( [param:Matrix4 m], [param:String order], [param:Boolean update] )</h3> |
138 | 132 | <p> |
139 | | - [page:Matrix4 m] - a [page:Matrix4] of which the upper 3x3 of matrix is a pure |
140 | | - [link:https://en.wikipedia.org/wiki/Rotation_matrix rotation matrix] (i.e. unscaled).<br /> |
141 | | - [page:.order order] - (optional) a string representing the order that the rotations are applied.<br /> |
142 | | - [page:Boolean update] - (optional) whether to call [page:.onChangeCallback onChangeCallback]() after applying |
143 | | - the matrix.<br /><br /> |
| 133 | + [page:Matrix4 m] - [page:Matrix4] 矩阵上面的3x3部分是一个纯旋转矩阵[link:https://en.wikipedia.org/wiki/Rotation_matrix rotation matrix] |
| 134 | + (也就是不发生缩放)<br /> |
| 135 | + [page:.order order] - (可选参数) 表示旋转顺序的字符串。<br /> |
| 136 | + [page:Boolean update] - (可选参数) 表示设置完变换矩阵后是否调用 [page:.onChangeCallback onChangeCallback]。<br /><br /> |
144 | 137 |
|
145 | | - Sets the angles of this euler transform from a pure rotation matrix based on the orientation |
146 | | - specified by order. |
| 138 | + 使用基于 [page:.order order] 顺序的纯旋转矩阵来设置当前欧拉角。 |
147 | 139 | </p> |
148 | 140 |
|
149 | 141 | <h3>[method:Euler setFromQuaternion]( [param:Quaternion q], [param:String order], [param:Boolean update] )</h3> |
150 | 142 | <p> |
151 | | - [page:Quaternion q] - a normalized quaternion.<br /> |
152 | | - [page:.order order] - (optional) a string representing the order that the rotations are applied.<br /> |
153 | | - [page:Boolean update] - (optional) whether to call [page:.onChangeCallback onChangeCallback]() after applying |
154 | | - the matrix.<br /><br /> |
| 143 | + [page:Quaternion q] - 归一化的四元数。<br /> |
| 144 | + [page:.order order] - (可选参数) 表示旋转顺序的字符串。<br /> |
| 145 | + [page:Boolean update] - (可选参数) 表示设置完变换矩阵后是否调用 [page:.onChangeCallback onChangeCallback]。<br /><br /> |
155 | 146 |
|
156 | | - Sets the angles of this euler transform from a normalized quaternion based on the orientation |
157 | | - specified by [page:.order order]. |
| 147 | + 根据 [page:.order order] 指定的方向,使用归一化四元数设置这个欧拉变换的角度。 |
158 | 148 | </p> |
159 | 149 |
|
160 | 150 |
|
161 | 151 | <h3>[method:Euler setFromVector3]( [param:Vector3 vector], [param:String order] )</h3> |
162 | 152 | <p> |
163 | 153 | [page:Vector3 vector] - [page:Vector3].<br /> |
164 | | - [page:.order order] - (optional) a string representing the order that the rotations are applied.<br /><br /> |
| 154 | + [page:.order order] - (可选参数) 表示旋转顺序的字符串。<br /><br /> |
165 | 155 |
|
166 | | - Set the [page:.x x], [page:.y y] and [page:.z z], and optionally update the [page:.order order]. [page:.onChangeCallback onChangeCallback]() |
167 | | - is called after these changes are made. |
| 156 | + 设置 [page:.x x], [page:.y y] and [page:.z z] 并且选择性更新 [page:.order order]。 |
| 157 | + 更改完成之后调用 [page:.onChangeCallback onChangeCallback]()。 |
168 | 158 | </p> |
169 | 159 |
|
170 | 160 |
|
171 | 161 | <h3>[method:Array toArray]( [param:Array array], [param:Integer offset] )</h3> |
172 | 162 | <p> |
173 | | - [page:Array array] - (optional) array to store the euler in.<br /> |
174 | | - [page:Integer offset] (optional) offset in the array.<br /> |
| 163 | + [page:Array array] - (可选参数) 存储欧拉角的数组。<br /> |
| 164 | + [page:Integer offset] (可选参数) 数组的偏移量。<br /> |
175 | 165 |
|
176 | | - Returns an array of the form [[page:.x x], [page:.y y], [page:.z z], [page:.order order ]]. |
| 166 | + 返回一个数组:[[page:.x x], [page:.y y], [page:.z z], [page:.order order ]]。 |
177 | 167 | </p> |
178 | 168 |
|
179 | 169 | <h3>[method:Vector3 toVector3]( [param:Vector3 optionalResult] )</h3> |
180 | 170 | <p> |
181 | | - [page:Vector3 optionalResult] — (optional) If specified, the result will be copied into this Vector, |
182 | | - otherwise a new one will be created. <br /><br /> |
| 171 | + [page:Vector3 optionalResult] — (可选参数) 如果指定了该参数结果将会被复制给该参数,否者会创建一个新的 Vector3 <br /><br /> |
183 | 172 |
|
184 | | - Returns the Euler's [page:.x x], [page:.y y] and [page:.z z] properties as a [page:Vector3]. |
| 173 | + 以 [page:Vector3] 的形式返回欧拉角的 [page:.x x], [page:.y y] 和 [page:.z z]。 |
185 | 174 | </p> |
186 | 175 |
|
187 | 176 |
|
188 | | - <h2>Source</h2> |
| 177 | + <h2>源码(Source)</h2> |
189 | 178 |
|
190 | 179 | [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] |
191 | 180 | </body> |
|
0 commit comments