|
@@ -11,427 +11,406 @@
|
|
|
<h1>[name]</h1>
|
|
|
|
|
|
<p class="desc">
|
|
|
- This is the base class for most objects in three.js and provides a set of properties and methods
|
|
|
- for manipulating objects in 3D space.<br /><br />
|
|
|
+ 该类是 three.js 中大多数对象的基类。它提供了一组属性和方法用于在 3D 空间下对对象进行操作。<br /><br />
|
|
|
|
|
|
- Note that this can be used for grouping objects via the [page:.add]( object ) method
|
|
|
- which adds the object as a child, however it is better to use [page:Group] for this.
|
|
|
+ 注意,通过 [page:.add]( object ) 方法,该类可以被应用于成组的对象。然而更好的方式是使用 [page:Group]。
|
|
|
</p>
|
|
|
|
|
|
|
|
|
- <h2>Constructor</h2>
|
|
|
+ <h2>构造函数</h2>
|
|
|
|
|
|
|
|
|
<h3>[name]()</h3>
|
|
|
<p>
|
|
|
- The constructor takes no arguments.
|
|
|
+ 构造函数没有任何参数。
|
|
|
</p>
|
|
|
|
|
|
|
|
|
- <h2>Properties</h2>
|
|
|
+ <h2>属性</h2>
|
|
|
|
|
|
<h3>[property:Boolean castShadow]</h3>
|
|
|
- <p>Whether the object gets rendered into shadow map. Default is *false*.</p>
|
|
|
+ <p> 当前物体是否需要在阴影图 (shadow map)中被渲染,默认值为 *false*。</p>
|
|
|
|
|
|
<h3>[property:Object3D children]</h3>
|
|
|
- <p>Array with object's children. See [page:Group] for info on manually grouping objects.</p>
|
|
|
+ <p> 子物体的队列。将对象成组的方法详见 [page:Group]。</p>
|
|
|
|
|
|
<h3>[property:Boolean frustumCulled]</h3>
|
|
|
<p>
|
|
|
- When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object.
|
|
|
- Otherwise the object gets rendered every frame even if it isn't visible. Default is *true*.
|
|
|
+ 当该值被设置时,在每帧渲染该物体前,都会检查物体是否在视锥内。
|
|
|
+ 否则,物体在每帧时都会被渲染,即使物体不可见。默认值为 *true*。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Integer id]</h3>
|
|
|
- <p>readonly – Unique number for this object instance.</p>
|
|
|
+ <p>只读 – 当前物体唯一标识符。</p>
|
|
|
|
|
|
<h3>[property:Boolean isObject3D]</h3>
|
|
|
<p>
|
|
|
- Used to check whether this or derived classes are Object3Ds. Default is *true*.<br /><br />
|
|
|
+ 用于判断当前类或其派生类是 Object3D 对象。默认值为 *true*。<br /><br />
|
|
|
|
|
|
- You should not change this, as it is used internally for optimisation.
|
|
|
+ 该值被用于内部优化,不应该被更改。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Layers layers]</h3>
|
|
|
<p>
|
|
|
- The layer membership of the object. The object is only visible if it has at least one
|
|
|
- layer in common with the [page:Camera] in use.
|
|
|
+ 当前物体所属图层信息。只有当该物体与摄像机至少共享一个图层时,该物体才可见。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Matrix4 matrix]</h3>
|
|
|
- <p>The local transform matrix.</p>
|
|
|
+ <p> 局部空间下的转移矩阵。</p>
|
|
|
|
|
|
<h3>[property:Boolean matrixAutoUpdate]</h3>
|
|
|
<p>
|
|
|
- When this is set, it calculates the matrix of position, (rotation or quaternion) and
|
|
|
- scale every frame and also recalculates the matrixWorld property. Default is [page:Object3D.DefaultMatrixAutoUpdate] (true).
|
|
|
+ 当设置该值时,对象会重新计算 matrixWorld 属性值,计算位置矩阵、旋转矩阵,并且在每帧都进行缩放。
|
|
|
+ 默认值 [page:Object3D.DefaultMatrixAutoUpdate] 为 true。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Matrix4 matrixWorld]</h3>
|
|
|
<p>
|
|
|
- The global transform of the object. If the Object3D has no parent, then it's identical to
|
|
|
- the local transform [page:.matrix].
|
|
|
+ 对象的全局变换矩阵。如果 Object3D 没有父对象,则该矩阵与局部变换矩阵 [page:.matrix] 相同。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Boolean matrixWorldNeedsUpdate]</h3>
|
|
|
<p>
|
|
|
- When this is set, it calculates the matrixWorld in that frame and resets this property
|
|
|
- to false. Default is *false*.
|
|
|
+ 当该值设置时,对象会在这帧重新计算 matrixWorld,且将该值设置为 false。默认值为 *false*。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Matrix4 modelViewMatrix]</h3>
|
|
|
- <p>This is passed to the shader and used to calculate the position of the object.</p>
|
|
|
+ <p>
|
|
|
+ 该值被传递给着色器,用于计算对象的坐标。
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:String name]</h3>
|
|
|
- <p>Optional name of the object (doesn't need to be unique). Default is an empty string.</p>
|
|
|
+ <p> 对象的可选别名(无需全局唯一)。默认值为空字符串。</p>
|
|
|
|
|
|
<h3>[property:Matrix3 normalMatrix]</h3>
|
|
|
<p>
|
|
|
- This is passed to the shader and used to calculate lighting for the object. It is the transpose of the inverse of the upper left 3x3 sub-matrix of this object's modelViewMatrix.<br /><br />
|
|
|
-
|
|
|
- The reason for this special matrix is that simply using the modelViewMatrix could result in a non-unit length of normals (on scaling) or in a non-perpendicular direction (on non-uniform scaling).<br /><br />
|
|
|
+ 该值传递给着色器用于计算对向的光照。该矩阵等价于 modelViewMatrix 的左上 3x3 子矩阵的逆矩阵的转置。
|
|
|
|
|
|
- On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient.
|
|
|
+ 需要该矩阵的原因如下,如果单纯使用 modelViewMatrix 会导致法向量在对象缩放时长度未归一化或方向不垂直。<br /><br />
|
|
|
+ This is passed to the shader and used to calculate lighting for the object.<br /><br />
|
|
|
+ 另外 modelViewMatrix 中的位移信息在法向量计算时并不相关。因而,normalMatrix 使用 Matrix3 矩阵足矣。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:function onAfterRender]</h3>
|
|
|
<p>
|
|
|
- An optional callback that is executed immediately after the Object3D is rendered.
|
|
|
- This function is called with the following parameters: renderer, scene, camera, geometry,
|
|
|
- material, group.
|
|
|
+ 可选的回调函数,在每次 Object3D 对象渲染后会被立刻调用。
|
|
|
+ 该函数参数列表如下:renderer, scene, camera, geometry, material, group。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:function onBeforeRender]</h3>
|
|
|
<p>
|
|
|
- An optional callback that is executed immediately before the Object3D is rendered.
|
|
|
- This function is called with the following parameters: renderer, scene, camera, geometry,
|
|
|
- material, group.
|
|
|
+ 可选的回调函数,在每次 Object3D 对象渲染前会被调用。
|
|
|
+ 该函数参数列表如下:renderer, scene, camera, geometry, material, group。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Object3D parent]</h3>
|
|
|
- <p>Object's parent in the [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]. An object can have at most
|
|
|
- one parent.</p>
|
|
|
+ <p> 对象的父对象 [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]。每个对象最多可以有一个父对象。</p>
|
|
|
|
|
|
<h3>[property:Vector3 position]</h3>
|
|
|
- <p>A [page:Vector3] representing the object's local position. Default is (0, 0, 0).</p>
|
|
|
+ <p> [page:Vector3] 向量,用于表示对象的局部坐标系下的位置。默认值为 (0, 0, 0)。</p>
|
|
|
|
|
|
<h3>[property:Quaternion quaternion]</h3>
|
|
|
- <p>Object's local rotation as a [page:Quaternion Quaternion].</p>
|
|
|
+ <p> 对象的本地旋转四元组 [page:Quaternion Quaternion]。</p>
|
|
|
|
|
|
<h3>[property:Boolean receiveShadow]</h3>
|
|
|
- <p>Whether the material receives shadows. Default is *false*.</p>
|
|
|
+ <p> 判断当前材质是否接收阴影。默认值是 *false*。</p>
|
|
|
|
|
|
<h3>[property:Number renderOrder]</h3>
|
|
|
<p>
|
|
|
- This value allows the default rendering order of [link:https://en.wikipedia.org/wiki/Scene_graph scene graph]
|
|
|
- objects to be overridden although opaque and transparent objects remain sorted independently.
|
|
|
- Sorting is from lowest to highest renderOrder. Default value is *0*.
|
|
|
+ 该值允许对象的默认渲染顺序 [link:https://en.wikipedia.org/wiki/Scene_graph scene graph] 被修改。
|
|
|
+ 但不透明和透明物体依然分开进行渲染排序。渲染顺序的排序是从最低到最高。renderOrder 的默认值为 *0*。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Euler rotation]</h3>
|
|
|
<p>
|
|
|
- Object's local rotation (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]), in radians.
|
|
|
+ 物体本地坐标系下的旋转信息 (see [link:https://en.wikipedia.org/wiki/Euler_angles Euler angles]),度量单位为弧度。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Vector3 scale]</h3>
|
|
|
<p>
|
|
|
- The object's local scale. Default is [page:Vector3]( 1, 1, 1 ).
|
|
|
+ 物体本地坐标系下的缩放信息。默认值是 [page:Vector3]( 1, 1, 1 )。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Vector3 up]</h3>
|
|
|
<p>
|
|
|
- This is used by the [page:.lookAt lookAt] method, for example, to determine the orientation of the result.<br />
|
|
|
- Default is [page:Object3D.DefaultUp] - that is, ( 0, 1, 0 ).
|
|
|
+ 该值被用于 [page:.lookAt lookAt] 方法。例如,用于判断对象朝向。<br />
|
|
|
+ 默认值 [page:Object3D.DefaultUp] 为 ( 0, 1, 0 )。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:object userData]</h3>
|
|
|
<p>
|
|
|
- An object that can be used to store custom data about the Object3D. It should not hold
|
|
|
- references to functions as these will not be cloned.
|
|
|
+ 用于存储 Object3D 的定制化数据的对象。该对象不应该保存任何函数的引用,这些值在对象被克隆时不会被拷贝。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:String uuid]</h3>
|
|
|
<p>
|
|
|
- [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
|
|
|
- This gets automatically assigned, so this shouldn't be edited.
|
|
|
+ 当前对象实例的 [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID]。
|
|
|
+ 该值会被自动赋值。不应该被修改。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Boolean visible]</h3>
|
|
|
- <p>Object gets rendered if *true*. Default is *true*.</p>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ <p> 如果该值为 *true*,则对象会被显示。默认值为 *true*。</p>
|
|
|
|
|
|
- <h2>Static Properties</h2>
|
|
|
+ <h2>静态属性</h2>
|
|
|
<p>
|
|
|
- Static properties and methods are defined per class rather than per instance of that class.
|
|
|
- This means that changing [page:Object3D.DefaultUp] or [page:Object3D.DefaultMatrixAutoUpdate]
|
|
|
- will change the values of [page:.up up] and [page:.matrixAutoUpdate matrixAutoUpdate] for
|
|
|
- <em>every</em> instance of Object3D (or derived classes) created after the change has
|
|
|
- been made (already created Object3Ds will not be affected).
|
|
|
+ 不同于非静态属性和方法是按照对象定义的,静态属性和方法是按类定义的,即同一个类的不同实例间是共享静态属性及方法的。
|
|
|
+ 这意味着改变 [page:Object3D.DefaultUp] 或 [page:Object3D.DefaultMatrixAutoUpdate],将会改变在这之后创建的
|
|
|
+ <em>每个</em> Object3D 实例(或其派生类的示例)的 [page:.up up] 和 [page:.matrixAutoUpdate matrixAutoUpdate]
|
|
|
+ 的值。已经被创建的 Object3D 实例不受影响。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Vector3 DefaultUp]</h3>
|
|
|
<p>
|
|
|
- The default [page:.up up] direction for objects, also used as the default position for [page:DirectionalLight],
|
|
|
- [page:HemisphereLight] and [page:Spotlight] (which creates lights shining from the top down).<br />
|
|
|
- Set to ( 0, 1, 0 ) by default.
|
|
|
+ 当前对象的默认的 [page:.up up] 方向,同样被用于 [page:DirectionalLight]、[page:HemisphereLight]、和
|
|
|
+ [page:Spotlight](光线方向从上至下) 的默认空间位置。<br />
|
|
|
+ 默认值为 ( 0, 1, 0 ) 。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Vector3 DefaultMatrixAutoUpdate]</h3>
|
|
|
<p>
|
|
|
- The default setting for [page:.matrixAutoUpdate matrixAutoUpdate] for newly created Object3Ds.<br />
|
|
|
-
|
|
|
+ 新创建的 Object3D 的 [page:.matrixAutoUpdate matrixAutoUpdate] 的默认值。<br />
|
|
|
</p>
|
|
|
|
|
|
+ <h2>方法</h2>
|
|
|
|
|
|
- <h2>Methods</h2>
|
|
|
-
|
|
|
- <h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
|
|
|
+ <h3>[page:EventDispatcher EventDispatcher] 可用于此类的方法。</h3>
|
|
|
|
|
|
<h3>[method:null add]( [param:Object3D object], ... )</h3>
|
|
|
<p>
|
|
|
- Adds *object* as child of this object. An arbitrary number of objects may be added. Any current parent on an
|
|
|
- object passed in here will be removed, since an object can have at most one parent.<br /><br />
|
|
|
+ 将参数指定的 *object* 添加到当前对象。参数指定的对象会被添加一个随机数。由于每个对象只能有一个父对象,
|
|
|
+ 在被设置新的父对象后,参数对象的原父对象将会被移除,并有当前对象替代。<br /><br />
|
|
|
|
|
|
- See [page:Group] for info on manually grouping objects.
|
|
|
+ 手动将对象成组详情见 [page:Group]。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:null applyMatrix]( [param:Matrix4 matrix] )</h3>
|
|
|
- <p>Applies the matrix transform to the object and updates the object's position, rotation and scale.</p>
|
|
|
+ <p> 将参数指定的矩阵应用于对象,并且依据矩阵对对象进行位移、旋转和缩放。</p>
|
|
|
|
|
|
<h3>[method:Object3D applyQuaternion]( [param:Quaternion quaternion] )</h3>
|
|
|
- <p>Applies the rotation represented by the quaternion to the object.</p>
|
|
|
+ <p> 将参数指定的四元数应用于对象,并对对象进行旋转。</p>
|
|
|
|
|
|
<h3>[method:Object3D clone]( [param:Boolean recursive] )</h3>
|
|
|
<p>
|
|
|
- recursive -- if true, descendants of the object are also cloned. Default is true.<br /><br />
|
|
|
+ recursive -- 如果为 true, 连同子对象一起克隆。默认值为 true.<br /><br />
|
|
|
|
|
|
- Returns a clone of this object and optionally all descendants.
|
|
|
+ 返回该对象的克隆,并且依据参数可能同时返回子对象的克隆。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:this copy]( [param:Object3D object], [param:Boolean recursive] )</h3>
|
|
|
<p>
|
|
|
- recursive -- if true, descendants of the object are also copied. Default is true.<br /><br />
|
|
|
+ recursive -- 如果为 true, 参数指定的对象连同子对象一起被复制。默认值为 true.<br /><br />
|
|
|
|
|
|
- Copy the given object into this object.
|
|
|
+ 将指定对象拷贝到当前对象。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Object3D getObjectById]( [param:Integer id] )</h3>
|
|
|
<p>
|
|
|
- id -- Unique number of the object instance<br /><br />
|
|
|
+ id -- 对象实例的唯一数字标识符。<br /><br />
|
|
|
|
|
|
- Searches through the object's children and returns the first with a matching id.<br />
|
|
|
- Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
|
|
|
+ 搜索对象的所有子对象,并返回第一个 id 与参数匹配的对象。<br />
|
|
|
+ 注意,对象的 id 按照时间顺序依次生生成:1,2,3,...每有一个新物体被创建则 id 增加 1。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Object3D getObjectByName]( [param:String name] )</h3>
|
|
|
<p>
|
|
|
- name -- String to match to the children's Object3D.name property. <br /><br />
|
|
|
+ name -- 匹配子对象 Object3D.name 属性的字符串。 <br /><br />
|
|
|
|
|
|
- Searches through the object's children and returns the first with a matching name.<br />
|
|
|
- Note that for most objects the name is an empty string by default. You will
|
|
|
- have to set it manually to make use of this method.
|
|
|
+ 搜索对象的所有子对象,并返回第一个 Object3D.name 属性与参数匹配的对象。<br />
|
|
|
+ 注意,对于大多数对象来说对象名称保持默认值,是一个空的字符串。需要你手动设置才会有意义。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Object3D getObjectByProperty]( [param:String name], [param:Float value] )</h3>
|
|
|
<p>
|
|
|
- name -- the property name to search for. <br />
|
|
|
- value -- value of the given property. <br /><br />
|
|
|
+ name -- 要检索的属性的名称。 <br />
|
|
|
+ value -- 要匹配的属性的值。 <br /><br />
|
|
|
|
|
|
- Searches through the object's children and returns the first with a property that matches the value given.
|
|
|
+ 搜索对象的子对象返回第一个属性名和属性值都匹配的对象。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Vector3 getWorldPosition]( [param:Vector3 target] )</h3>
|
|
|
<p>
|
|
|
- [page:Vector3 target] — the result will be copied into this Vector3. <br /><br />
|
|
|
+ [page:Vector3 target] — 结果将被复制到这个三维矢量中。 <br /><br />
|
|
|
|
|
|
- Returns a vector representing the position of the object in world space.
|
|
|
+ 返回一个代表对象全局坐标的三维矢量。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Quaternion getWorldQuaternion]( [param:Quaternion target] )</h3>
|
|
|
<p>
|
|
|
- [page:Quaternion target] — the result will be copied into this Quaternion. <br /><br />
|
|
|
+ [page:Quaternion target] — 结果将被复制到这个四元数中. <br /><br />
|
|
|
|
|
|
- Returns a quaternion representing the rotation of the object in world space.
|
|
|
+ 返回代表对象全局旋转的四元数。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Vector3 getWorldScale]( [param:Vector3 target] )</h3>
|
|
|
<p>
|
|
|
- [page:Vector3 target] — the result will be copied into this Vector3. <br /><br />
|
|
|
+ [page:Vector3 target] — 结果将被复制到这个三维矢量中。 <br /><br />
|
|
|
|
|
|
- Returns a vector of the scaling factors applied to the object for each axis in world space.
|
|
|
+ 返回代表对象每个轴向的全局缩放参数的三维矢量。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Vector3 getWorldDirection]( [param:Vector3 target] )</h3>
|
|
|
<p>
|
|
|
- [page:Vector3 target] — the result will be copied into this Vector3. <br /><br />
|
|
|
+ [page:Vector3 target] — 结果将被复制到这个三维矢量中。 <br /><br />
|
|
|
|
|
|
- Returns a vector representing the direction of object's positive z-axis in world space.
|
|
|
+ 返回代表对象全局坐标系下 z 轴朝向的三维矢量。
|
|
|
</p>
|
|
|
|
|
|
-
|
|
|
<h3>[method:Vector3 localToWorld]( [param:Vector3 vector] )</h3>
|
|
|
<p>
|
|
|
- vector - A vector representing a position in local (object) space.<br /><br />
|
|
|
+ vector - 代表本地(局部)坐标位置的三维矢量。<br /><br />
|
|
|
|
|
|
- Converts the vector from local space to world space.
|
|
|
+ 将参数指定的本地坐标矢量转换为全局坐标。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:null lookAt]( [param:Vector3 vector] )</br>
|
|
|
[method:null lookAt]( [param:Float x], [param:Float y], [param:Float z] )</h3>
|
|
|
<p>
|
|
|
- vector - A vector representing a position in world space.<br /><br />
|
|
|
- Optionally, the [page:.x x], [page:.y y] and [page:.z z] components of the world space position.<br /><br />
|
|
|
+ vector - 代表全局坐标位置的三维矢量。<br /><br />
|
|
|
+ 另外, 参数可以由全局坐标的第一维 ([page:.x x]), 第二维([page:.y y]) 和 第三维([page:.z z])组成的参数列表代替。<br /><br />
|
|
|
|
|
|
- Rotates the object to face a point in world space.<br /><br />
|
|
|
+ 旋转物体使得其朝向参数指定的全局坐标。<br /><br />
|
|
|
|
|
|
- This method does not support objects with rotated and/or translated parent(s).
|
|
|
+ 该方法旋转仅旋转对象及子对象,不会影响父对象的旋转或位移。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Array raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
|
|
|
<p>
|
|
|
- Abstract (empty) method to get intersections between a casted ray and this object.
|
|
|
- Subclasses such as [page:Mesh], [page:Line], and [page:Points] implement this method in order
|
|
|
- to use raycasting.
|
|
|
+ 抽象(空)方法,用于获取射线与对象的碰撞信息。
|
|
|
+ 为使用射线检测,[page:Mesh], [page:Line], [page:Points] 子类实现了该方法。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:null remove]( [param:Object3D object], ... )</h3>
|
|
|
<p>
|
|
|
- Removes *object* as child of this object. An arbitrary number of objects may be removed.
|
|
|
+ 将当前对象下,参数指定的子对象进行删除。该方法可能删除任意多个对象。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:this rotateOnAxis]( [param:Vector3 axis], [param:Float angle] )</h3>
|
|
|
<p>
|
|
|
- axis -- A normalized vector in object space. <br />
|
|
|
- angle -- The angle in radians.<br /><br />
|
|
|
+ axis -- 局部坐标系下的归一化向量。 <br />
|
|
|
+ angle -- 以弧度代表的角度信息。<br /><br />
|
|
|
|
|
|
- Rotate an object along an axis in object space. The axis is assumed to be normalized.
|
|
|
+ 在局部坐标系下按照参数给定向量对物体进行旋转。参数 axis 为归一化的向量。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:this rotateOnWorldAxis]( [param:Vector3 axis], [param:Float angle] )</h3>
|
|
|
<p>
|
|
|
- axis -- A normalized vector in world space. <br />
|
|
|
- angle -- The angle in radians.<br /><br />
|
|
|
+ axis -- 全局坐标系下的归一化向量。 <br />
|
|
|
+ angle -- 以弧度代表的角度信息。<br /><br />
|
|
|
|
|
|
- Rotate an object along an axis in world space. The axis is assumed to be normalized.
|
|
|
- Method Assumes no rotated parent.
|
|
|
+ 在全局坐标系下按照参数给定向量对物体进行旋转。参数 axis 为归一化的向量。
|
|
|
+ 该方法不会影响父对象旋转。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:this rotateX]( [param:Float rad] )</h3>
|
|
|
<p>
|
|
|
- rad - the angle to rotate in radians.<br /><br />
|
|
|
-
|
|
|
- Rotates the object around x axis in local space.
|
|
|
+ rad - 以弧度代表的旋转角度信息。<br /><br />
|
|
|
+ 在局部坐标系下根据参数,绕 x 轴旋转物体。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:this rotateY]( [param:Float rad] )</h3>
|
|
|
<p>
|
|
|
- rad - the angle to rotate in radians.<br /><br />
|
|
|
-
|
|
|
- Rotates the object around y axis in local space.
|
|
|
+ rad - 以弧度代表的旋转角度信息。<br /><br />
|
|
|
+ 在局部坐标系下根据参数,绕 x 轴旋转物体。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:this rotateZ]( [param:Float rad] )</h3>
|
|
|
<p>
|
|
|
- rad - the angle to rotate in radians.<br /><br />
|
|
|
-
|
|
|
- Rotates the object around z axis in local space.
|
|
|
+ rad - 以弧度代表的旋转角度信息。<br /><br />
|
|
|
+ 在局部坐标系下根据参数,绕 x 轴旋转物体。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:null setRotationFromAxisAngle]( [param:Vector3 axis], [param:Float angle] )</h3>
|
|
|
<p>
|
|
|
- axis -- A normalized vector in object space. <br />
|
|
|
- angle -- angle in radians<br /><br />
|
|
|
+ axis -- 局部坐标系下的归一化向量。 <br />
|
|
|
+ angle -- 以弧度代表的角度信息。<br /><br />
|
|
|
|
|
|
- Calls [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] )
|
|
|
- on the [page:.quaternion].
|
|
|
+ 该方法将会在 [page:.quaternion] 中,调用
|
|
|
+ [page:Quaternion.setFromAxisAngle setFromAxisAngle]( [page:Float axis], [page:Float angle] )。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:null setRotationFromEuler]( [param:Euler euler] )</h3>
|
|
|
<p>
|
|
|
- euler -- Euler angle specifying rotation amount.<br />
|
|
|
+ euler -- 以欧拉角代表的旋转角度信息。<br />
|
|
|
|
|
|
- Calls [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler])
|
|
|
- on the [page:.quaternion].
|
|
|
+ 该方法将会在 [page:.quaternion] 中,调用
|
|
|
+ [page:Quaternion.setRotationFromEuler setRotationFromEuler]( [page:Euler euler])。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:null setRotationFromMatrix]( [param:Matrix4 m] )</h3>
|
|
|
<p>
|
|
|
- m -- rotate the quaternion by the rotation component of the matrix.<br />
|
|
|
+ m -- 按照参数给定矩阵旋转对象四元数。<br />
|
|
|
|
|
|
- Calls [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m])
|
|
|
- on the [page:.quaternion].<br /><br />
|
|
|
+ 该方法将会在 [page:.quaternion] 中,调用
|
|
|
+ [page:Quaternion.setFromRotationMatrix setFromRotationMatrix]( [page:Matrix4 m])。<br /><br />
|
|
|
|
|
|
- Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
|
|
|
+ 注意,该方法假设参数 m 矩阵的左上 3x3 表示非缩放的旋转信息。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:null setRotationFromQuaternion]( [param:Quaternion q] )</h3>
|
|
|
<p>
|
|
|
- q -- normalized Quaternion.<br /><br />
|
|
|
+ q -- 归一化的四元数。<br /><br />
|
|
|
|
|
|
- Copy the given quaternion into [page:.quaternion].
|
|
|
+ 将参数指定四元数拷贝到 [page:.quaternion]。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:null toJSON]( [param:Quaternion q] )</h3>
|
|
|
<p>
|
|
|
- Convert the object to JSON format.
|
|
|
+ 将对象转化为 JSON 格式。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:this translateOnAxis]( [param:Vector3 axis], [param:Float distance] )</h3>
|
|
|
<p>
|
|
|
- axis -- A normalized vector in object space.<br />
|
|
|
- distance -- The distance to translate.<br /><br />
|
|
|
+ axis -- 局部坐标系下的归一化向量。<br />
|
|
|
+ distance -- 需要被位移的距离。<br /><br />
|
|
|
|
|
|
- Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
|
|
|
+ 将物体沿参数给定方向移动指定距离。假设方向向量已经被归一化。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:this translateX]( [param:Float distance] )</h3>
|
|
|
- <p>Translates object along x axis in object space by *distance* units.</p>
|
|
|
+ <p> 将对象沿 X 轴移动参数 *distance* 指定距离。</p>
|
|
|
|
|
|
<h3>[method:this translateY]( [param:Float distance] )</h3>
|
|
|
- <p>Translates object along y axis in object space by *distance* units.</p>
|
|
|
+ <p> 将对象沿 Y 轴移动参数 *distance* 指定距离。</p>
|
|
|
|
|
|
<h3>[method:this translateZ]( [param:Float distance] )</h3>
|
|
|
- <p>Translates object along z axis in object space by *distance* units.</p>
|
|
|
+ <p> 将对象沿 Z 轴移动参数 *distance* 指定距离。</p>
|
|
|
|
|
|
<h3>[method:null traverse]( [param:Function callback] )</h3>
|
|
|
<p>
|
|
|
- callback - A function with as first argument an object3D object.<br /><br />
|
|
|
+ callback - 回调函数,第一个参数为 Object3D 对象。<br /><br />
|
|
|
|
|
|
- Executes the callback on this object and all descendants.
|
|
|
+ 在该对象及所有子对象上执行该函数。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:null traverseVisible]( [param:Function callback] )</h3>
|
|
|
<p>
|
|
|
- callback - A function with as first argument an object3D object.<br /><br />
|
|
|
+ callback - 回调函数,第一个参数为 Object3D 对象。<br /><br />
|
|
|
|
|
|
- Like traverse, but the callback will only be executed for visible objects.
|
|
|
- Descendants of invisible objects are not traversed.
|
|
|
+ 如同 traverse 函数,该函数只会在可见的对象及子对象上被调用。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:null traverseAncestors]( [param:Function callback] )</h3>
|
|
|
<p>
|
|
|
- callback - A function with as first argument an object3D object.<br /><br />
|
|
|
+ callback - 回调函数,第一个参数为 Object3D 对象。<br /><br />
|
|
|
|
|
|
- Executes the callback on all ancestors.
|
|
|
+ 在父对象及所有祖先上被调用。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:null updateMatrix]()</h3>
|
|
|
- <p>Update the local transform.</p>
|
|
|
+ <p>更新局部变换矩阵。</p>
|
|
|
|
|
|
<h3>[method:null updateMatrixWorld]( [param:Boolean force] )</h3>
|
|
|
- <p>Update the global transform of the object and its children.</p>
|
|
|
+ <p>更新当前对象及子对象的全局变换信息。</p>
|
|
|
|
|
|
|
|
|
<h3>[method:Vector3 worldToLocal]( [param:Vector3 vector] )</h3>
|
|
|
<p>
|
|
|
- vector - A world vector.<br /><br />
|
|
|
+ vector - 全局坐标向量。<br /><br />
|
|
|
|
|
|
- Updates the vector from world space to local space.
|
|
|
+ 将参数给定坐标从全局坐标转换为局部坐标。
|
|
|
</p>
|
|
|
|
|
|
- <h2>Source</h2>
|
|
|
+ <h2>资源</h2>
|
|
|
|
|
|
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
|
</body>
|