未验证 提交 f638d621 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #15053 from nicholas-yangding/translation-zh

Translation zh
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../" />
......@@ -9,37 +9,37 @@
</head>
<body>
<h1>Polyfills</h1>
<h1>差异化支持(腻子)</h1>
<p class="desc">Three.js includes polyfills for the following functions and constants.</p>
<p class="desc">Three.js 包含以下方法和常量的差异化支持.</p>
<h3>[page:Number.EPSILON Number.EPSILON]</h3>
<p>
The difference between one and the smallest value greater than one that can be represented as a Number.
表示1和大于1的最小差值,可表示为 Number.
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON MDN reference].
</p>
<h3>[page:Math.sign Math.sign]( [page:Number x] )</h3>
<p>
If the argument is a positive number, negative number, positive zero or negative zero,
the function will return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned.
如果参数为 正数,负数,正零 或 负零,
该方法将分别返回 1, -1, 0 或 -0 . 否则, 返回 NaN.
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign MDN reference].
</p>
<h3>[page:Function.prototype.name Function.prototype.name]( [page:Number x] )</h3>
<p>
Returns the name of a function, or (before ES6 implementations) an empty string for anonymous functions.
返回方法的名字, 或 (在 ES6 实现之前) 为匿名方法返回一个空字符串.
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name MDN reference].
</p>
<h3>[page:Object.assign Object.assign]( [page:Object target], [page:Object ...sources] )</h3>
<p>
The Object.assign() method is used to copy the values of all enumerable own properties from one or more source objects to a target object.
It will return the target object.
Object.assign() 方法用于从一个或多个源对象拷贝所有可枚举自身属性到目标对象.
该方法将返回目标对象.
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign MDN reference].
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/polyfills.js src/polyfills.js]
</body>
......
......@@ -13,6 +13,7 @@
<h1>阵列摄像机([name])</h1>
<p class="desc">
[name] 可以被用来更加高效地用一组已经预定义好的摄像机来渲染一个场景。 这对于VR场景的渲染来说,是非常重要的一个性能体现。<br />
一个 [name] 的实例中总是包含着一组子摄像机,应当为每一个子摄像机定义*bound*(边界)这个属性,该属性决定了由该子摄像机所渲染的视口区域的大小。
</p>
......@@ -30,17 +31,17 @@
<h2>属性</h2>
<p>请参阅其基类 [page:PerspectiveCamera] 来查看共有属性。</p>
<p>请参阅基类[page:PerspectiveCamera]的公共属性。</p>
<h3>[property:Array cameras]</h3>
<p>
一个包含多个摄像机的数组。
摄像机组。
</p>
<h2>方法</h2>
<p>请参阅其基类 [page:PerspectiveCamera] 来查看共有方法。</p>
<p>请参阅基类[page:PerspectiveCamera]的公共方法。</p>
<h2></h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -13,20 +13,24 @@
<h1>摄像机([name])</h1>
<p class="desc">
摄像机的抽象基类,你创建一个摄像机总会继承这个类。
摄像机的抽象基类。在构建新摄像机时,应始终继承此类。
</p>
<h2>构造器</h2>
<h2>构造函数</h2>
<h3>[name]()</h3>
<p>
创建一个新的[name](摄像机)。注意:这个类并不是被直接调用的;你所想要的或许是一个 [page:PerspectiveCamera](透视摄像机)或者 [page:OrthographicCamera](正交摄像机)。
</p>
<h2>属性</h2>
<p>请参阅其基类[page:Object3D]来查看共有属性。</p>
<h3>[property:Boolean isCamera]</h3>
......@@ -35,16 +39,20 @@
<br /><br />
你不应当对这个属性进行改变,因为它在内部由渲染器使用,以用于优化。
</p>
<h3>[property:Layers layers]</h3>
<p>
摄像机是一个[page:Layers layers]的成员. 这是一个从[page:Object3D]继承而来的属性。<br /><br />
当摄像机的视点被渲染的时候,物体必须和当前被看到的摄像机共享至少一个层。
</p>
<h3>[property:Matrix4 matrixWorldInverse]</h3>
<p>
这是matrixWorld矩阵的逆矩阵。 MatrixWorld包含了相机的世界变换矩阵。
</p>
......@@ -61,15 +69,19 @@
<h3>[method:Camera clone]( )</h3>
<p>
返回一个具有和当前相机的属性一样的新的相机。
</p>
<h3>[method:Camera copy]( [param:Camera source], [param:Boolean recursive] )</h3>
<p>
将源摄像机的属性复制到新摄像机中。
</p>
<h3>[method:Vector3 getWorldDirection]( [param:Vector3 target] )</h3>
<p>
[page:Vector3 target] — 调用该函数的结果将复制给该Vector3对象。<br /><br />
返回一个能够表示当前摄像机所正视的世界空间方向的[page:Vector3]对象。
......
......@@ -12,6 +12,7 @@
<h1>立方相机([name])</h1>
<p class="desc">创建6个摄像机,并将它们所拍摄的场景渲染到[page:WebGLRenderTargetCube]上。</p>
<h2>示例</h2>
......@@ -40,17 +41,21 @@
</code>
<h2>构造器</h2>
<h3>[name]( [param:Number near], [param:Number far], [param:Number cubeResolution] )</h3>
<p>
near -- 远剪切面的距离<br />
far -- 近剪切面的距离<br />
cubeResolution -- 设置立方体边缘的长度
</p>
<p>
构造一个包含6个[page:PerspectiveCamera PerspectiveCameras](透视摄像机)的立方摄像机,并将其拍摄的场景渲染到一个[page:WebGLRenderTargetCube]上。
</p>
......@@ -67,6 +72,7 @@
<p>请参阅其基类[page:Object3D]来查看其共有方法。</p>
<h3>[method:null update]( [param:WebGLRenderer renderer], [param:Scene scene] )</h3>
<p>
renderer -- 当前的WebGL渲染器<br />
......@@ -80,6 +86,7 @@
<p>
这个方法用来来清除[page:CubeCamera.renderTarget renderTarget]的颜色、深度和/或模板缓冲区。
颜色缓冲区设置为渲染器当前的“清除”色。参数默认值均为*true*。
</p>
<h2>源代码</h2>
......
......@@ -41,11 +41,14 @@
scene.add( camera );</code>
<h2>构造器</h2>
<h3>[name]( [param:Number left], [param:Number right], [param:Number top], [param:Number bottom], [param:Number near], [param:Number far] )</h3>
<p>
left — 摄像机视锥体左侧面。<br />
right — 摄像机视锥体右侧面。<br />
top — 摄像机视锥体上侧面。<br />
......@@ -54,6 +57,7 @@ scene.add( camera );</code>
far — 摄像机视锥体远端面。<br /><br />
这些参数一起定义了摄像机的[link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum](视锥体)。
</p>
......@@ -71,6 +75,7 @@ scene.add( camera );</code>
<p>
摄像机视锥体远端面,其默认值为*2000*。<br /><br />
其值的有效范围介于[page:.near near](摄像机视锥体近端面)和无穷大之间。
</p>
<h3>[property:Boolean isOrthographicCamera]</h3>
......@@ -130,6 +135,7 @@ scene.add( camera );</code>
<h3>[method:null updateProjectionMatrix]()</h3>
<p>
更新摄像机投影矩阵。在任何参数被改变以后必须被调用。
</p>
<h3>[method:JSON toJSON]()</h3>
......
......@@ -191,6 +191,7 @@ camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
<h3>[method:JSON toJSON]()</h3>
<p>
使用JSON格式来返回摄像机数据。
</p>
......
......@@ -49,7 +49,6 @@
<h3>[property:PerspectiveCamera cameraR]</h3>
<p>右摄像机,它被加入到了[page:Layers layer 2]中 —— 需要被右摄像机渲染的物体也应当要加入到这一层中。</p>
<h2>方法</h2>
<h3>[method:null update]( [param:PerspectiveCamera camera] )</h3>
......
......@@ -11,204 +11,187 @@
<h1>[name]</h1>
<p class="desc">
This class stores data for an attribute (such as vertex positions, face indices, normals,
colors, UVs, and any custom attributes ) associated with a [page:BufferGeometry], which allows
for more efficient passing of data to the GPU. See that page for details and a usage example.<br /><br />
这个类用于存储与[page:BufferGeometry]相关联的 attribute(例如顶点位置向量,面片索引,法向量,颜色值,UV坐标以及任何自定义 attribute )。
利用 BufferAttribute,可以更高效的向GPU传递数据。详情和例子见该页。<br /><br />
Data is stored as vectors of any length (defined by [page:BufferAttribute.itemSize itemSize]),
and in general in the methods outlined below if passing in an index, this is automatically
multiplied by the vector length.
在 BufferAttribute 中,数据被存储为任意长度的矢量(通过[page:BufferAttribute.itemSize itemSize]进行定义),下列函数如无特别说明,
函数参数中的index会自动乘以矢量长度进行计算。
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:TypedArray array], [param:Integer itemSize], [param:Boolean normalized] )</h3>
<p>
[page:TypedArray array] -- Must be a [link:https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/TypedArray TypedArray].
Used to instantiate the buffer. <br />
This array should have
[page:TypedArray array] -- 必须是 [link:https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/TypedArray TypedArray].
类型,用于实例化缓存。<br />
该队列应该包含:
<code>itemSize * numVertices</code>
elements, where numVertices is the number of vertices in the associated [page:BufferGeometry BufferGeometry].<br /><br />
个元素,numVertices 是 [page:BufferGeometry BufferGeometry]中的顶点数目<br /><br />
[page:Integer itemSize] -- the number of values of the array that should be associated with
a particular vertex. For instance, if this
attribute is storing a 3-component vector (such as a position, normal, or color), then itemSize should be 3.
[page:Integer itemSize] --
队列中与顶点相关的数据值的大小。举例,如果 attribute 存储的是三元组(例如顶点空间坐标、法向量或颜色值)则itemSize的值应该是3。
<br /><br />
[page:Boolean normalized] -- (optional) Indicates how the underlying data in the buffer maps
to the values in the GLSL code. For instance, if [page:TypedArray array] is an instance of
UInt16Array, and [page:Boolean normalized] is true, the values 0 - +65535 in the array
data will be mapped to 0.0f - +1.0f in the GLSL attribute. An Int16Array (signed) would map
from -32767 - +32767 to -1.0f - +1.0f. If [page:Boolean normalized] is false, the values
will be converted to floats which contain the exact value, i.e. 32767 becomes 32767.0f.
[page:Boolean normalized] -- (可选) 指明缓存中的数据如何与GLSL代码中的数据对应。例如,如果[page:TypedArray array]是
UInt16Array类型,且[page:Boolean normalized]的值是 true,则队列中的值将会从 0 - +65535 映射为 GLSL 中的 0.0f - +1.0f。
如果[page:TypedArray array]是 Int16Array (有符号),则值将会从 -32767 - +32767 映射为 -1.0f - +1.0f。若 [page:Boolean normalized]
的值为 false,则数据映射不会归一化,而会直接映射为 float 值,例如,32767 将会映射为 32767.0f.
</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:TypedArray array]</h3>
<p>
The [page:TypedArray array] holding data stored in the buffer.
在 [page:TypedArray array] 中保存着缓存中的数据。
</p>
<h3>[property:Integer count]</h3>
<p>
Stores the [page:BufferAttribute.array array]'s length divided by the [page:BufferAttribute.itemSize itemSize].<br /><br />
保存 [page:BufferAttribute.array array] 除以 [page:BufferAttribute.itemSize itemSize] 之后的大小。<br /><br />
If the buffer is storing a 3-component vector (such as a position, normal, or color),
then this will count the number of such vectors stored.
若缓存存储三元组(例如顶点位置、法向量、颜色值),则该值应等于队列中三元组的个数。
</p>
<h3>[property:Boolean dynamic]</h3>
<p>
Whether the buffer is dynamic or not. Default is *false*.<br />
不论缓存是否是动态的,默认值都将是 *false*<br />
If false, the GPU is informed that contents of the buffer are likely to be used often and not change often.
This corresponds to the [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData gl.STATIC_DRAW] flag.<br />
if true, the GPU is informed that contents of the buffer are likely to be used often and change often.
This corresponds to the [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData gl.DYNAMIC_DRAW] flag.
如果该值为 false,即告知 GPU 缓存中的数据会经常使用但不经常变化。
该值与 [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData gl.STATIC_DRAW] 标志位相一致。<br />
如果该值为 true,即告知 GPU 缓存中的数据会经常使用且经常变化。
该值与 [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData gl.DYNAMIC_DRAW] 标志位相一致。
</p>
<h3>[property:Boolean isBufferAttribute]</h3>
<p>
Used to check whether this or derived classes are BufferAttributes. Default is *true*.<br /><br />
指示当前类或派生类是 BufferAttributes. 默认值为 *true*.<br /><br />
You should not change this, as it used internally for optimisation.
开发者不应当改变该值,该值用于内部实现优化。
</p>
<h3>[property:Integer itemSize]</h3>
<p>The length of vectors that are being stored in the [page:BufferAttribute.array array].</p>
<p>保存在 [page:BufferAttribute.array array] 中矢量的长度。</p>
<h3>[property:String name]</h3>
<p>
Optional name for this attribute instance. Default is an empty string.
该 attribute 实例的别名,默认值为空字符串。
</p>
<h3>[property:Boolean needsUpdate]</h3>
<p>
Flag to indicate that this attribute has changed and should be re-sent to the GPU.
Set this to true when you modify the value of the array.<br /><br />
Setting this to true also increments the [page:BufferAttribute.version version].
该标志位指明当前 attribute 已经被修改过,且需要再次送入 GPU 处理。当开发者改变了该队列的值,则标志位需要设置为 true。<br /><br />
将标志位设为 true 同样会增加 [page:BufferAttribute.version version] 的值。
</p>
<h3>[property:Boolean normalized]</h3>
<p>
Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
See the constructor above for details.
指明缓存中数据在转化为GLSL着色器代码中数据时是否需要被归一化。详见构造函数中的说明。
</p>
<h3>[property:Function onUploadCallback]</h3>
<p>
A callback function that is executed after the Renderer has transfered the attribute array data to the GPU.
attribute 数据传输到GPU后的回调函数。
</p>
<h3>[property:Object updateRange]</h3>
<p>Object containing:<br />
[page:Integer offset]: Default is *0*. Position at whcih to start update.<br />
[page:Integer count]: Default is *-1*, which means don't use update ranges. <br /><br />
<p>对象包含如下成员:<br />
[page:Integer offset]: 默认值为 *0*。 指明更新的起始位置。<br />
[page:Integer count]: 默认值为 *-1*,表示不指定更新范围。<br /><br />
This can be used to only update some components of stored vectors (for example, just the component
related to color).
该值只可以被用于更新某些矢量数据(例如,颜色相关数据)。
</p>
<h3>[property:Integer version]</h3>
<p>A version number, incremented every time the [page:BufferAttribute.needsUpdate needsUpdate] property is set to true.</p>
<p>版本号,当 [page:BufferAttribute.needsUpdate needsUpdate] 被设置为 true 时,该值会自增。</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:BufferAttribute clone]() </h3>
<p>Return a copy of this bufferAttribute.</p>
<p>返回该 BufferAttribute 的拷贝。</p>
<h3>[method:BufferAttribute copyArray]( array ) </h3>
<p>Copy the array given here (which can be a normal array or TypedArray) into
[page:BufferAttribute.array array].<br /><br />
See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]
for notes on requirements if copying a TypedArray.
<p>将参数中所给定的普通队列或 TypedArray 拷贝到 [page:BufferAttribute.array array] 中。<br /><br />
拷贝 TypedArray 相关注意事项详见 [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]。
</p>
<h3>[method:null copyAt] ( [param:Integer index1], [param:BufferAttribute bufferAttribute], [param:Integer index2] ) </h3>
<p>Copy a vector from bufferAttribute[index2] to [page:BufferAttribute.array array][index1].</p>
<p>将一个矢量从 bufferAttribute[index2] 拷贝到 [page:BufferAttribute.array array][index1] 中。</p>
<h3>[method:BufferAttribute copyColorsArray]( [param:Array colors] ) </h3>
<p>Copy an array representing RGB color values into [page:BufferAttribute.array array].</p>
<p>将一个存储 RGB 颜色值的队列拷贝到 [page:BufferAttribute.array array] 中。</p>
<h3>[method:BufferAttribute copyVector2sArray]( [param:Array vectors] ) </h3>
<p>Copy an array representing [page:Vector2]s into [page:BufferAttribute.array array].</p>
<p>将一个存储 [page:Vector2] 的队列拷贝到 [page:BufferAttribute.array array] 中。</p>
<h3>[method:BufferAttribute copyVector3sArray]( [param:Array vectors] ) </h3>
<p>Copy an array representing [page:Vector3]s into [page:BufferAttribute.array array].</p>
<p>将一个存储 [page:Vector3] 的队列拷贝到 [page:BufferAttribute.array array] 中。</p>
<h3>[method:BufferAttribute copyVector4sArray]( [param:Array vectors] ) </h3>
<p>Copy an array representing [page:Vector4]s into [page:BufferAttribute.array array].</p>
<p>将一个存储 [page:Vector4] 的队列拷贝到 [page:BufferAttribute.array array] 中。</p>
<h3>[method:Number getX]( [param:Integer index] ) </h3>
<p>Returns the x component of the vector at the given index.</p>
<p>获取给定索引的矢量的第一维元素 (即 X 值)。</p>
<h3>[method:Number getY]( [param:Integer index] ) </h3>
<p>Returns the y component of the vector at the given index.</p>
<p>获取给定索引的矢量的第二维元素 (即 Y 值)。</p>
<h3>[method:Number getZ]( [param:Integer index] ) </h3>
<p>Returns the z component of the vector at the given index.</p>
<p>获取给定索引的矢量的第三维元素 (即 Z 值)。</p>
<h3>[method:Number getW]( [param:Integer index] ) </h3>
<p>Returns the w component of the vector at the given index.</p>
<p>获取给定索引的矢量的第四维元素 (即 W 值)。</p>
<h3>[method:null onUpload]( [param:Function callback] ) </h3>
<p>
Sets the value of the onUploadCallback property.<br /><br />
In the [example:webgl_buffergeometry WebGL / Buffergeometry] this is used to free memory
after the buffer has been transfered to the GPU.
<p>见 onUploadCallback 属性。<br /><br />
在 [example:webgl_buffergeometry WebGL / Buffergeometry] 中,该方在缓存数据传递给 GPU 后,用于释放内存。
</p>
<h3>[method:BufferAttribute set] ( [param:Array value], [param:Integer offset] ) </h3>
<p>
value -- an [page:Array] or [page:TypedArray] from which to copy values. <br />
offset -- (optional) index of the [page:BufferAttribute.array array] at which to start copying.<br /><br />
value -- 被拷贝的 [page:Array] 或 [page:TypedArray] 类型的数据。 <br />
offset -- (可选) [page:BufferAttribute.array array] 中开始拷贝的位置索引。<br /><br />
Calls [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] )
on the [page:BufferAttribute.array array].<br /><br />
对 [page:BufferAttribute.array array],调用 [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set TypedArray.set]( [page:Array value], [page:Integer offset] )
方法。<br /><br />
In particular, see that page for requirements on [page:Array value]
being a [page:TypedArray].
特别的, 对将 [page:Array value] 转为 [page:TypedArray] 的要求详见上述链接。
</p>
<h3>[method:BufferAttribute setArray] ( [param:TypedArray array] ) </h3>
<p>
[page:BufferAttribute.array array] to the TypedArray passed in here.<br /><br />
[page:BufferAttribute.array array] 被赋值的 TypedArray 队列。<br /><br />
After setting the array, [page:BufferAttribute.needsUpdate needsUpdate] should be set to true.
队列被复制后,[page:BufferAttribute.needsUpdate needsUpdate] 应当被设置为 true。
</p>
<h3>[method:BufferAttribute setDynamic] ( [param:Boolean value] ) </h3>
<p>Set [page:BufferAttribute.dynamic dynamic] to value.</p>
<p>将 [page:BufferAttribute.dynamic dynamic] 设置为 value.</p>
<h3>[method:BufferAttribute setX]( [param:Integer index], [param:Float x] ) </h3>
<p>Sets the x component of the vector at the given index.</p>
<p>设置给定索引的矢量的第一维数据(设置 X 值)。</p>
<h3>[method:BufferAttribute setY]( [param:Integer index], [param:Float y] ) </h3>
<p>Sets the y component of the vector at the given index.</p>
<p>设置给定索引的矢量的第二维数据(设置 Y 值)。</p>
<h3>[method:BufferAttribute setZ]( [param:Integer index], [param:Float z] ) </h3>
<p>Sets the z component of the vector at the given index.</p>
<p>设置给定索引的矢量的第三维数据(设置 Z 值)。</p>
<h3>[method:BufferAttribute setW]( [param:Integer index], [param:Float w] ) </h3>
<p>Sets the w component of the vector at the given index.</p>
<p>设置给定索引的矢量的第四维数据(设置 W 值)。</p>
<h3>[method:BufferAttribute setXY]( [param:Integer index], [param:Float x], [param:Float y] ) </h3>
<p>Sets the x and y components of the vector at the given index.</p>
<p>设置给定索引的矢量的第一、二维数据(设置 X 和 Y 值)。</p>
<h3>[method:BufferAttribute setXYZ]( [param:Integer index], [param:Float x], [param:Float y], [param:Float z] ) </h3>
<p>Sets the x, y and z components of the vector at the given index.</p>
<p>设置给定索引的矢量的第一、二、三维数据(设置 X、Y 和 Z 值)。</p>
<h3>[method:BufferAttribute setXYZW]( [param:Integer index], [param:Float x], [param:Float y], [param:Float z], [param:Float w] ) </h3>
<p>Sets the x, y, z and w components of the vector at the given index.</p>
<p>设置给定索引的矢量的第一、二、三、四维数据(设置 X、Y、Z 和 W 值)。</p>
<h2>Source</h2>
<h2>资源</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -9,78 +9,76 @@
</head>
<body>
<h1>[name]</h1>
<p class="desc">
Object for keeping track of time. This uses <a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance/now">performance.now()</a>
if it is available, otherwise it reverts to the less accurate <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date/now">Date.now()</a>.
该对象用于跟踪时间。如果<a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance/now">performance.now()</a>可用,则
Clock 对象通过该方法实现,否则通过歉精准的<a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date/now">Date.now()</a>实现。
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Boolean autoStart] )</h3>
<p>
autoStart — (optional) whether to automatically start the clock. Default is true.
autoStart — (可选) 是否要自动开启时钟。默认值是 true。
</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:Boolean autoStart]</h3>
<p>
If set, starts the clock automatically when the first update is called. Default is true.
如果设置为 true,则在第一次 update 时开启时钟。默认值是 true。
</p>
<h3>[property:Float startTime]</h3>
<p>
Holds the time at which the clock's [page:Clock.start start] method was last called.
存储时钟最后一次调用 [page:Clock.start start] 方法的时间。
</p>
<h3>[property:Float oldTime]</h3>
<p>
Holds the time at which the clock's [page:Clock.start start], [page:Clock.getElapsedTime getElapsedTime] or [page:Clock.getDelta getDelta]
methods were last called.
存储时钟最后一次调用 [page:Clock.start start], [page:Clock.getElapsedTime getElapsedTime] 或 [page:Clock.getDelta getDelta] 方法的时间。
</p>
<h3>[property:Float elapsedTime]</h3>
<p>
Keeps track of the total time that the clock has been running.
保存时钟运行的总时长。
</p>
<h3>[property:Boolean running]</h3>
<p>
Whether the clock is running or not.
判断时钟是否在运行。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:null start]()</h3>
<p>
Starts clock. Also sets the [page:Clock.startTime startTime] and [page:Clock.oldTime oldTime]
to the current time, sets [page:Clock.elapsedTime elapsedTime] to *0* and [page:Clock.running running] to *true*.
启动时钟。同时将 [page:Clock.startTime startTime] 和 [page:Clock.oldTime oldTime] 设置为当前时间。
设置 [page:Clock.elapsedTime elapsedTime] 为 *0*,并且设置 [page:Clock.running running] 为 *true*.
</p>
<h3>[method:null stop]()</h3>
<p>
Stops clock and sets [page:Clock.oldTime oldTime] to the current time.
停止时钟。同时将 [page:Clock.oldTime oldTime] 设置为当前时间。
</p>
<h3>[method:Float getElapsedTime]()</h3>
<p>
Get the seconds passed since the clock started and sets [page:Clock.oldTime oldTime] to the current time.<br />
If [page:Clock.autoStart autoStart] is *true* and the clock is not running, also starts the clock.
获取自时钟启动后的秒数,摒弃将 [page:Clock.oldTime oldTime] 设置为当前时间。<br />
如果 [page:Clock.autoStart autoStart] 设置为 *true* 且时钟并未运行,则该方法同时启动时钟。
</p>
<h3>[method:Float getDelta]()</h3>
<p>
Get the seconds passed since the time [page:Clock.oldTime oldTime] was set and sets [page:Clock.oldTime oldTime] to the current time.<br />
If [page:Clock.autoStart autoStart] is *true* and the clock is not running, also starts the clock.
获取自 [page:Clock.oldTime oldTime] 设置后到当前的秒数。 同时将 [page:Clock.oldTime oldTime] 设置为当前时间。<br/>
如果 [page:Clock.autoStart autoStart] 设置为 *true* 且时钟并未运行,则该方法同时启动时钟。
</p>
<h2>Source</h2>
<h2>资源</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -11,97 +11,92 @@
<h1>[name]</h1>
<p class="desc">
This class is used internally to convert from [page:Geometry] to [page:BufferGeometry].
该类在内部被用于 [page:Geometry] 到 [page:BufferGeometry] 的转换。
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]()</h3>
<p>This creates a new [name].</p>
<p>创建一个新的 [name] 对象。</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:Integer id]</h3>
<p>Unique number for this [name] instance.</p>
<p>当前 [name] 实例的唯一数字标识。</p>
<h3>[property:String name]</h3>
<p>Optional name. Default is the empty string.</p>
<p>可选名称. 默认值是空字符串。</p>
<h3>[property:Array type]</h3>
<p>String 'DirectGeometry'.</p>
<p>返回 'DirectGeometry' 字符串。</p>
<h3>[property:Array vertices]</h3>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<p>被初始化为一个空队列, 该属性由 [page:.fromGeometry]() 赋值。</p>
<h3>[property:Array normals]</h3>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<p>被初始化为一个空队列, 该属性由 [page:.fromGeometry]() 赋值。</p>
<h3>[property:Array colors]</h3>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<p>被初始化为一个空队列, 该属性由 [page:.fromGeometry]() 赋值。</p>
<h3>[property:Array uvs]</h3>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<p>被初始化为一个空队列, 该属性由 [page:.fromGeometry]() 赋值。</p>
<h3>[property:Array uvs2]</h3>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<p>被初始化为一个空队列, 该属性由 [page:.fromGeometry]() 赋值。</p>
<h3>[property:Array groups]</h3>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<p>被初始化为一个空队列, 该属性由 [page:.fromGeometry]() 赋值。</p>
<h3>[property:Array morphTargets]</h3>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<p>被初始化为一个空队列, 该属性由 [page:.fromGeometry]() 赋值。</p>
<h3>[property:Array skinWeights]</h3>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<p>被初始化为一个空队列, 该属性由 [page:.fromGeometry]() 赋值。</p>
<h3>[property:Array skinIndices]</h3>
<p>Initialiased as an empty array, this is populated by [page:.fromGeometry]().</p>
<p>被初始化为一个空队列, 该属性由 [page:.fromGeometry]() 赋值。</p>
<h3>[property:Box3 boundingBox]</h3>
<p>
Bounding box for the bufferGeometry, which can be calculated with
[page:.computeBoundingBox](). Default is *null*.
对应 bufferGeometry 的外边界矩形,该值可通过 [page:.computeBoundingBox]() 计算。默认值是 *null*。
</p>
<h3>[property:Sphere boundingSphere]</h3>
<p>
Bounding sphere for the bufferGeometry, which can be calculated with
[page:.computeBoundingSphere](). Default is *null*.
对应 bufferGeometry 的外边界球,该值可通过 [page:.computeBoundingSphere]() 计算。默认值是 *null*。
</p>
<h3>[property:Boolean verticesNeedUpdate]</h3>
<p>Default is false.</p>
<p>默认值为 false。</p>
<h3>[property:Boolean normalsNeedUpdate]</h3>
<p>Default is false.</p>
<p>默认值为 false。</p>
<h3>[property:Boolean colorsNeedUpdate]</h3>
<p>Default is false.</p>
<p>默认值为 false。</p>
<h3>[property:Boolean uvsNeedUpdate]</h3>
<p>Default is false.</p>
<p>默认值为 false。</p>
<h3>[property:Boolean groupsNeedUpdate]</h3>
<p>Default is false.</p>
<p>默认值为 false。</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[property:null computeGroups]( [param:Geometry geometry] )</h3>
<p>
Compute the parts of the geometry that have different materialIndex.
See [page:BufferGeometry.groups].
计算几何体中有不同 materialIndex 的部分,详见 [page:BufferGeometry.groups]。
</p>
<h3>[property:null fromGeometry]( [param:Geometry geometry] )</h3>
<p>Pass in a [page:Geometry] instance for conversion.</p>
<p>传入一个需要转换的 [page:Geometry] 实例。</p>
<h2>Source</h2>
<h2>资源</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -11,14 +11,14 @@
<h1>[name]</h1>
<p class="desc">
JavaScript events for custom objects.<br />
自定义对象的 JavaScript 事件。<br />
[link:https://github.com/mrdoob/eventdispatcher.js Eventdispatcher on GitHub]
</p>
<h2>Example</h2>
<h2>示例</h2>
<code>
// Adding events to a custom object
// 为自定义对象添加事件
var Car = function () {
......@@ -30,11 +30,11 @@ var Car = function () {
};
// Mixing the EventDispatcher.prototype with the custom object prototype
// 将 EventDispatcher.prototype 与自定义对象 prototype 进行混合
Object.assign( Car.prototype, EventDispatcher.prototype );
// Using events with the custom object
// 使用自定义对象的事件
var car = new Car();
......@@ -47,53 +47,53 @@ car.addEventListener( 'start', function ( event ) {
car.start();
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]()</h3>
<p>
Creates EventDispatcher object.
创建 EventDispatcher 对象。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:null addEventListener]( [param:String type], [param:Function listener] )</h3>
<p>
type - The type of event to listen to.<br />
listener - The function that gets called when the event is fired.
type - 需要添加监听的事件类型。<br />
listener - 事件发生时被调用到的函数。
</p>
<p>
Adds a listener to an event type.
为指定事件增加监听函数。
</p>
<h3>[method:Boolean hasEventListener]( [param:String type], [param:Function listener] )</h3>
<p>
type - The type of event to listen to.<br />
listener - The function that gets called when the event is fired.
type - 需要被监听的事件类型。<br />
listener - 事件发生时被调用到的函数。
</p>
<p>
Checks if listener is added to an event type.
检查监听函数是否已经添加到指定事件。
</p>
<h3>[method:null removeEventListener]( [param:String type], [param:Function listener] )</h3>
<p>
type - The type of the listener that gets removed.<br />
listener - The listener function that gets removed.
type - 需要移除监听的事件类型。<br />
listener - 需要被移除的监听函数。
</p>
<p>
Removes a listener from an event type.
从指定事件类型中移除监听函数。
</p>
<h3>[method:null dispatchEvent]( [param:object event] )</h3>
<p>
event - The event that gets fired.
event - 将被触发的事件。
</p>
<p>
Fire an event type.
触发一个事件。
</p>
<h2>Source</h2>
<h2>资源</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -11,13 +11,12 @@
<h1>[name]</h1>
<p class="desc">
Triangular face used in [page:Geometry]. These are created automatically for all
standard geometry types, however if you are building a custom geometry you will have to
create them manually.
在 [page:Geometry] 中被使用到的三角面片。这些三角面片会为所有标准几何体自动创建。
然而,如果你正在构建一个自定义几何体,你需要手动创建这些三角面片。
</p>
<h2>Examples</h2>
<h2>示例</h2>
<p>[example:misc_ubiquity_test ubiquity / test ]</p>
<p>[example:svg_sandbox svg / sandbox ]</p>
......@@ -28,22 +27,22 @@
<code>
var material = new THREE.MeshStandardMaterial( { color : 0x00cc00 } );
//create a triangular geometry
//创建仅有一个三角面片的几何体
var geometry = new THREE.Geometry();
geometry.vertices.push( new THREE.Vector3( -50, -50, 0 ) );
geometry.vertices.push( new THREE.Vector3( 50, -50, 0 ) );
geometry.vertices.push( new THREE.Vector3( 50, 50, 0 ) );
//create a new face using vertices 0, 1, 2
//利用顶点 0, 1, 2 创建一个面
var normal = new THREE.Vector3( 0, 1, 0 ); //optional
var color = new THREE.Color( 0xffaa00 ); //optional
var materialIndex = 0; //optional
var face = new THREE.Face3( 0, 1, 2, normal, color, materialIndex );
//add the face to the geometry's faces array
//将创建的面添加到几何体的面的队列
geometry.faces.push( face );
//the face normals and vertex normals can be calculated automatically if not supplied above
//如果没有特别指明,面和顶点的法向量可以通过如下代码自动计算
geometry.computeFaceNormals();
geometry.computeVertexNormals();
......@@ -51,83 +50,80 @@ scene.add( new THREE.Mesh( geometry, material ) );
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Integer a], [param:Integer b], [param:Integer c], [param:Vector3 normal], [param:Color color], [param:Integer materialIndex] )</h3>
<p>
a — Vertex A index.<br />
b — Vertex B index.<br />
c — Vertex C index.<br /><br />
a — 顶点 A 的索引。<br />
b — 顶点 B 的索引。<br />
c — 顶点 C 的索引。<br /><br />
normal — (optional) Face normal ([page:Vector3 Vector3]) or array of vertex normals.
If a single vector is passed in, this sets [page:.normal], otherwise if an array of three
vectors is passed in this sets [page:.vertexNormals]<br /><br />
normal — (可选) 面的法向量 ([page:Vector3 Vector3]) 或顶点法向量队列。
如果参数传入单一矢量,则用该量设置面的法向量 [page:.normal],如果传入的是包含三个矢量的队列,
则用该量设置 [page:.vertexNormals]<br /><br />
color — (optional) Face [page:Color color] or array of vertex [page:Color colors].
If a single vector is passed in, this sets [page:.color], otherwise if an array of three
vectors is passed in this sets [page:.vertexColors]<br /><br />
color — (可选) 面的颜色值 [page:Color color] 或顶点颜色值的队列。
如果参数传入单一矢量,则用该量设置 [page:.color],如果传入的是包含三个矢量的队列,
则用该量设置 [page:.vertexColors]<br /><br />
materialIndex — (optional) which index of an array of materials to associate
with the face.
materialIndex — (可选) 材质队列中与该面对应的材质的索引。
</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:Integer a]</h3>
<p>
Vertex A index.
顶点 A 的索引。
</p>
<h3>[property:Integer b]</h3>
<p>
Vertex B index.
顶点 B 的索引。
</p>
<h3>[property:Integer c]</h3>
<p>
Vertex C index.
顶点 C 的索引。
</p>
<h3>[property:Vector3 normal]</h3>
<p>
Face normal - vector showing the direction of the Face3. If calculated automatically
(using [page:Geometry.computeFaceNormals]), this is the normalized cross product of two edges of the
triangle. Default is *(0, 0, 0)*.
面的法向量 - 矢量展示 Face3 的方向。如果该量是通过调用 [page:Geometry.computeFaceNormals] 自动计算的,
该值等于归一化的两条边的差积。默认值是 *(0, 0, 0)*。
</p>
<h3>[property:Color color]</h3>
<p>
Face color - for this to be used a material's [page:Material.vertexColors vertexColors] property
must be set to [page:Materials THREE.FaceColors].
面的颜色值 - 在被用于指定材质的 [page:Material.vertexColors vertexColors] 属性时,该值必须被设置为
[page:Materials THREE.FaceColors]。
</p>
<h3>[property:Array vertexNormals]</h3>
<p>
Array of 3 [page:Vector3 vertex normals].
包含三个 [page:Vector3 vertex normals] 的队列。
</p>
<h3>[property:Array vertexColors]</h3>
<p>
Array of 3 vertex colors - for these to be used a material's [page:Material.vertexColors vertexColors] property
must be set to [page:Materials THREE.VertexColors].
包含 3 个顶点颜色值的队列 - 在被用于指定材质的 [page:Material.vertexColors vertexColors] 属性时,该值必须被设置为
[page:Materials THREE.VertexColors]。
</p>
<h3>[property:Integer materialIndex]</h3>
<p>
Material index (points to an index in the associated array of materials). Default is *0*.
材质队列中与该面相关的材质的索引。默认值为 *0*。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:Face3 clone]()</h3>
<p>Creates a new clone of the Face3 object.</p>
<p>克隆该 Face3 对象。</p>
<h3>[method:Face3 copy]( [param:Face3 face3] )</h3>
<p>Copy the paramaters of another Face3 into this.</p>
<p>将参数指定的 Face3 对象的数据拷贝到当前对象。</p>
<h2>Source</h2>
<h2>资源</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
此差异已折叠。
......@@ -13,31 +13,31 @@
<h1>[name]</h1>
<p class="desc">
An instanced version of [page:BufferAttribute].
[page:BufferAttribute] 的实例化版本。
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:TypedArray array], [param:Integer itemSize], [param:Number meshPerAttribute] )</h3>
<p>
</p>
<h2>Properties</h2>
See [page:BufferAttribute] for inherited properties.
<h2>属性</h2>
继承属性详见 [page:BufferAttribute]。
<h3>[property:Number meshPerAttribute]</h3>
<p>
Default is *1*.
默认值为 *1*。
</p>
<h3>[property:Boolean isInstancedBufferAttribute]</h3>
<p>
Default is *true*.
默认值为 *true*.
</p>
<h2>Methods</h2>
<p>See [page:BufferAttribute] for inherited methods.</p>
<h2>方法</h2>
<p>继承方法详见 [page:BufferAttribute]。</p>
<h2>Source</h2>
<h2>资源</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -13,29 +13,29 @@
<h1>[name]</h1>
<p class="desc">
An instanced version of [page:BufferGeometry].
[page:BufferGeometry] 的实例化版本。
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( )</h3>
<p>
<p> 默认构造函数没有参数。
</p>
<h2>Properties</h2>
See [page:BufferGeometry] for inherited properties.
<h2>属性</h2>
继承属性详见 [page:BufferGeometry]。
<h3>[property:Number maxInstancedCount]</h3>
<p>
Default is *undefined*.
默认值是 *undefined*。
</p>
<h3>[property:Boolean isInstancedBufferGeometry]</h3>
<p>
Default is *true*.
默认值是 *true*。
</p>
<h2>Methods</h2>
<p>See [page:BufferAttribute] for inherited methods.</p>
<h2>方法</h2>
<p>继承方法详见 [page:BufferAttribute]。</p>
<h3>[property:Number addGroup]( start, count, materialIndex )</h3>
<p>
......@@ -43,7 +43,7 @@
</p>
<h2>Source</h2>
<h2>资源</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -13,35 +13,35 @@
<h1>[name]</h1>
<p class="desc">
An instanced version of [page:InterleavedBuffer].
[page:InterleavedBuffer] 的实例化版本。
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:TypedArray array], [param:Integer itemSize], [param:Number meshPerAttribute] )</h3>
<p>
</p>
<h2>Properties</h2>
<h2>属性</h2>
<p>
See [page:InterleavedBuffer] for inherited properties.
继承属性详见 [page:InterleavedBuffer]。
</p>
<h3>[property:Number meshPerAttribute]</h3>
<p>
Default is *1*.
默认值是 *1*。
</p>
<h3>[property:Boolean isInstancedInterleavedBuffer]</h3>
<p>
Default is *true*.
默认值是 *true*。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<p>
See [page:InterleavedBuffer] for inherited methods.
继承方法详见 [page:InterleavedBuffer]。
</p>
<h2>Source</h2>
<h2>资源</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -11,108 +11,108 @@
<h1>[name]</h1>
<p class="desc">
"Interleaved" means that multiple attributes, possibly of different types, (e.g., position, normal, uv, color) are packed into a single array buffer.
"交叉存储" 表明多个类型的 attributes (例如,顶点位置、法向量、UV 和颜色值)被存储到一个队列中。
<br/><br/>
An introduction into interleaved arrays can be found here: [link:https://blog.tojicode.com/2011/05/interleaved-array-basics.html Interleaved array basics]
如下链接有对交叉存储更详细的介绍: [link:https://blog.tojicode.com/2011/05/interleaved-array-basics.html Interleaved array basics]
</p>
<h2>Example</h2>
<h2>示例</h2>
<p>[example:webgl_buffergeometry_points_interleaved webgl / buffergeometry / points / interleaved]</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:TypedArray array], [param:Integer stride] )</h3>
<p>
[page:TypedArray array] -- A typed array with a shared buffer. Stores the geometry data.<br/>
[page:Integer stride] -- The number of typed-array elements per vertex.
[page:TypedArray array] -- 一个基于共享缓存的类型化队列。该队列存储几何体相关数据。<br/>
[page:Integer stride] -- 每个顶点占用类型化队列的多少个元素。
</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:Array array]</h3>
<p>
A typed array with a shared buffer. Stores the geometry data.
一个基于共享缓存的类型化队列。该队列存储几何体相关数据。
</p>
<h3>[property:Integer stride]</h3>
<p>
The number of typed-array elements per vertex.
每个顶点占用类型化队列的多少个元素。
</p>
<h3>[property:Integer count]</h3>
<p>
Gives the total number of elements in the array.
类型化队列中,所有元素的数目。
</p>
<h3>[property:Boolean dynamic]</h3>
<p>
Default is *false*.
默认值为 *false*。
</p>
<h3>[property:Object updateRange]</h3>
<p>
Object containing offset and count.
对象存储着需要更新的数据的偏移量和数量。
</p>
<h3>[property:Number updateRange.offset]</h3>
<p>
Default is *0*.
默认值为 *0*。
</p>
<h3>[property:Number updateRange.count]</h3>
<p>
Default is *-1*.
默认值为 *-1*。
</p>
<h3>[property:Integer version]</h3>
<p>
A version number, incremented every time the needsUpdate property is set to true.
版本号,每次 needsUpdate 属性设置为 true 时,版本号增加。
</p>
<h3>[property:Integer isInterleavedBuffer]</h3>
<p>
Default is *true*.
默认值为 *true*。
</p>
<h3>[property:Integer needsUpdate]</h3>
<p>
Default is *false*. Setting this to true increments [page:InterleavedBuffer.version version].
默认值为 *false*。该值被设置为 true 时,会导致 [page:InterleavedBuffer.version version] 增加。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:InterleavedBuffer setArray] ( [param:TypedArray array] ) </h3>
<p>
array - must be a Typed Array.
array - 必须是一个类型化的队列。
</p>
<h3>[method:InterleavedBuffer setDynamic] ( [param:Boolean value] ) </h3>
<p>
Set [page:InterleavedBuffer.dynamic dynamic] to value.
根据输入参数设置 [page:InterleavedBuffer.dynamic dynamic] 的值。
</p>
<h3>[method:InterleavedBuffer copy]( [param:InterleavedBuffer source] ) </h3>
<p>
Copies another [name] to this [name].
将参数指定的 [name] 拷贝到当前 [name]。
</p>
<h3>[method:InterleavedBuffer copyAt]( [param:Integer index1], [param:InterleavedBuffer attribute], [param:Integer index2] ) </h3>
<p>Copies data from attribute[index2] to [page:InterleavedBuffer.array array][index1].</p>
<p> 将数据从 attribute[index2] 拷贝到 [page:InterleavedBuffer.array array][index1]。</p>
<h3>[method:InterleavedBuffer set]( [param:TypedArray value], [param:Integer offset] ) </h3>
<p>
value - The source (typed) array.<br/>
offset - The offset into the target array at which to begin writing values from the source array. Default is *0*.<br/><br />
value - 被拷贝的源(类型化)队列。<br/>
offset - 源队列中,数据开始拷贝的偏移量。默认值是 *0*.<br/><br />
Stores multiple values in the buffer, reading input values from a specified array.
将源队列数据拷贝到目标队列缓存中。
</p>
<h3>[method:InterleavedBuffer clone]() </h3>
<p>
Creates a clone of this [name].
克隆当前 [name]。
</p>
<h2>Source</h2>
<h2>资源</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -15,89 +15,86 @@
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:InterleavedBuffer interleavedBuffer], [param:Integer itemSize], [param:Integer offset], [param:Boolean normalized] )</h3>
<p>
</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:InterleavedBuffer data]</h3>
<p>
The [page:InterleavedBuffer InterleavedBuffer] instance passed in the constructor.
传入构造函数的 [page:InterleavedBuffer InterleavedBuffer] 实例。
</p>
<h3>[property:TypedArray array]</h3>
<p>
The value of [page:InterleavedBufferAttribute.data data].array.
[page:InterleavedBufferAttribute.data data].array 的值。
</p>
<h3>[property:Integer count]</h3>
<p>
The value of [page:InterleavedBufferAttribute.data data].count.
[page:InterleavedBufferAttribute.data data].count 的值。
If the buffer is storing a 3-component item (such as a position, normal, or color),
then this will count the number of such items stored.
所缓存的矢量的个数。如果缓存的矢量是一个三元组(例如,位置、法向量或颜色),则该值计算上述三元组的个数。
</p>
<h3>[property:Integer itemSize]</h3>
<p>
How many values make up each item.
队列中每个矢量有多少个元素构成。
</p>
<h3>[property:Integer offset]</h3>
<p>
The offset in the underlying array buffer where an item starts.
缓存队列中每个元素的起始位置的偏移量。
</p>
<h3>[property:Boolean normalized]</h3>
<p>
Default is *true*.
默认值为 *true*。
</p>
<h3>[property:Boolean isInterleavedBufferAttribute]</h3>
<p>
Default is *true*.
默认值为 *true*。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:Number getX]( [param:Integer index] ) </h3>
<p>Returns the x component of the item at the given index.</p>
<p>返回给定索引矢量的第一个元素 (X 值)。</p>
<h3>[method:Number getY]( [param:Integer index] ) </h3>
<p>Returns the y component of the item at the given index.</p>
<p>返回给定索引矢量的第二个元素 (Y 值)。</p>
<h3>[method:Number getZ]( [param:Integer index] ) </h3>
<p>Returns the z component of the item at the given index.</p>
<p>返回给定索引矢量的第三个元素 (Z 值)。</p>
<h3>[method:Number getW]( [param:Integer index] ) </h3>
<p>Returns the w component of the item at the given index.</p>
<p>返回给定索引矢量的第四个元素 (W 值)。</p>
<h3>[method:null setX]( [param:Integer index], [param:Float x] ) </h3>
<p>Sets the x component of the item at the given index.</p>
<p>通过给定参数,设置指定索引矢量的第一个元素 (X 值)。</p>
<h3>[method:null setY]( [param:Integer index], [param:Float y] ) </h3>
<p>Sets the y component of the item at the given index.</p>
<p>通过给定参数,设置指定索引矢量的第二个元素 (Y 值)。</p>
<h3>[method:null setZ]( [param:Integer index], [param:Float z] ) </h3>
<p>Sets the z component of the item at the given index.</p>
<p>通过给定参数,设置指定索引矢量的第三个元素 (Z 值)。</p>
<h3>[method:null setW]( [param:Integer index], [param:Float w] ) </h3>
<p>Sets the w component of the item at the given index.</p>
<p>通过给定参数,设置指定索引矢量的第四个元素 (W 值)。</p>
<h3>[method:null setXY]( [param:Integer index], [param:Float x], [param:Float y] ) </h3>
<p>Sets the x and y components of the item at the given index.</p>
<p>通过给定参数,设置指定索引矢量的第一、二个元素 (X 和 Y 值)。</p>
<h3>[method:null setXYZ]( [param:Integer index], [param:Float x], [param:Float y], [param:Float z] ) </h3>
<p>Sets the x, y and z components of the item at the given index.</p>
<p>通过给定参数,设置指定索引矢量的第一、二、三个元素 (X Y 和 Z 值)。</p>
<h3>[method:null setXYZW]( [param:Integer index], [param:Float x], [param:Float y], [param:Float z], [param:Float w] ) </h3>
<p>Sets the x, y, z and w components of the item at the given index.</p>
<p>通过给定参数,设置指定索引矢量的第一、二、三、四个元素 (X Y Z 和 W 值)。</p>
<h2>Source</h2>
<h2>资源</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -11,71 +11,71 @@
<h1>[name]</h1>
<p class="desc">
A [page:Layers] object assigns an [page:Object3D] to 1 or more of 32 layers numbered 0 to 31
- internally the layers are stored as a [link:https://en.wikipedia.org/wiki/Mask_(computing) bit mask], and by default all
Object3Ds are a member of layer 0.<br /><br />
[page:Layers] 对象为 [page:Object3D] 分配 1个到 32 个图层。32个图层从 0 到 31 编号标记。
在内部实现上,每个图层对象被存储为一个 [link:https://en.wikipedia.org/wiki/Mask_(computing) bit mask],
默认的,所有 [page:Object3D] 对象都存储在第 0 个图层上。<br /><br />
This can be used to control visibility - an object must share a layer with a [page:Camera camera] to be visible when that camera's
view is renderered.<br /><br />
图层对象可以用于控制对象的显示。当 [page:Camera camera] 的内容被渲染时与其共享图层相同的物体会被显示。每个对象都需要与一个
[page:Camera camera] 共享图层。<br /><br />
All classes that inherit from [page:Object3D] have an [page:Object3D.layers] property which is an instance of this class.
每个继承自 [page:Object3D] 的对象都有一个 [page:Object3D.layers] 对象。
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]()</h3>
<p>
Create a new Layers object, with membership initially set to layer 0.
创建一个新的图层对象,该对象默认与第 0 图层关联。
</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:Integer mask]</h3>
<p>
A bit mask storing which of the 32 layers this layers object is currently a member of.
用 bit mask 表示当前图层对象与 0 - 31 中的哪些图层相对应。所属层所对应的比特位为 1,其他位位 0。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:null disable]( [param:Integer layer] )</h3>
<p>
layer - an integer from 0 to 31.<br /><br />
layer - 一个 0 - 31 的整数。<br /><br />
Remove membership of this *layer*.
删除图层对象与参数指定图层的对应关系。
</p>
<h3>[method:null enable]( [param:Integer layer] )</h3>
<p>
layer - an integer from 0 to 31.<br /><br />
layer - 一个 0 - 31 的整数。<br /><br />
Add membership of this *layer*.
增加图层对象与参数指定图层的对应关系。
</p>
<h3>[method:null set]( [param:Integer layer] )</h3>
<p>
layer - an integer from 0 to 31.<br /><br />
layer - 一个 0 - 31 的整数。<br /><br />
Set membership to *layer*, and remove membership all other layers.
删除图层对象已有的所有对应关系,增加与参数指定的图层的对应关系。
</p>
<h3>[method:Boolean test]( [param:Layers layers] )</h3>
<p>
layers - a Layers object<br /><br />
layers - 一个图层对象。<br /><br />
Returns true if this and the passed *layers* object are members of the same set of layers.
如果传入图层对象与当前对象属于相同的一组图层,则返回 true,否则返回 false。
</p>
<h3>[method:null toggle]( [param:Integer layer] )</h3>
<p>
layer - an integer from 0 to 31.<br /><br />
layer - 一个 0 - 31 的整数。<br /><br />
Toggle membership of *layer*.
根据参数切换对象所属图层。
</p>
<h2>Source</h2>
<h2>资源</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -403,7 +403,6 @@
<h3>[method:Vector3 worldToLocal]( [param:Vector3 vector] )</h3>
<p>
vector - 一个世界向量.<br /><br />
将世界空间中的向量转换为局部空间向量。
</p>
......
......@@ -22,8 +22,7 @@
function onMouseMove( event ) {
// calculate mouse position in normalized device coordinates
// (-1 to +1) for both components
// 将鼠标位置归一化为设备坐标。x 和 y 方向的取值范围是 (-1 to +1)
mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
......@@ -32,10 +31,10 @@
function render() {
// update the picking ray with the camera and mouse position
// 通过摄像机和鼠标位置更新射线
raycaster.setFromCamera( mouse, camera );
// calculate objects intersecting the picking ray
// 计算物体和射线的焦点
var intersects = raycaster.intersectObjects( scene.children );
for ( var i = 0; i < intersects.length; i++ ) {
......@@ -80,6 +79,7 @@
[page:Float far] —— 返回的所有结果都比far近。far不能小于near,其默认值为Infinity(正无穷。)</p>
<p>
这将创建一个新的raycaster对象。<br />
</p>
......@@ -93,7 +93,9 @@
<h3>[property:float linePrecision]</h3>
<p>
raycaster与[page:Line](线)物体相交时的精度因数。
</p>
<h3>[property:float near]</h3>
......
......@@ -10,11 +10,12 @@
<body>
<h1>[name]</h1>
<p class="desc">Uniforms are global [link:https://www.opengl.org/documentation/glsl/ GLSL] variables. They are passed to shader programs.
<p class="desc">Uniforms 是 [link:https://www.opengl.org/documentation/glsl/ GLSL] 着色器中的全局变量。
</p>
<h3>Example</h3>
<h3>示例</h3>
<p>
在声明一个 [page:ShaderMaterial] 的 Uniform 变量时,该变量被值或对象声明。
When declaring a uniform of a [page:ShaderMaterial], it is declared by value or by object.
</p>
<code>
......@@ -24,24 +25,21 @@
}
</code>
<h3>Uniform types</h3>
<h3>Uniform 种类</h3>
<p>
Each uniform must have a *value* property. The type of the value must correspond to the
type of the uniform variable in the GLSL code as specified for the primitive GLSL types
in the table below. Uniform structures and arrays are also supported. GLSL arrays of primitive
type must either be specified as an array of the corresponding THREE objects or as a flat
array containing the data of all the objects. In other words; GLSL primitives in arrays
must not be represented by arrays. This rule does not apply transitively.
An array of *vec2* arrays, each with a length of five vectors, must be an array of arrays,
of either five [page:Vector2] objects or ten *number*s.
每个 Uniform 必须包括一个 *value* 属性。value 的类型必须和下表中 GLSL 的基本类型相对应。同样,Uniform 的结构体和队列
也是支持的。 GLSL基本类型队列必须要么被显示声明为一个 THREE 对象的队列,要么被声明为一个包含所有对象数据的队列。这就是说,
队列中的 GLSL 基础类型不能再是一个队列。举例,一个有 5 个 *vec2* 元素的队列,必须是一个包含 5 个 [page:Vector2] 的队列数组,
或包含 10 个 *number* 的队列。
</p>
<table>
<caption><a id="uniform-types">Uniform types</a></caption>
<caption><a id="uniform-types">Uniform 类型</a></caption>
<thead>
<tr>
<th>GLSL type</th>
<th>JavaScript type</th>
<th>GLSL 类型</th>
<th>JavaScript 类型</th>
</tr>
</thead>
<tbody>
......@@ -179,34 +177,36 @@
</table>
<p>
(*) Same for an (innermost) array (dimension) of the same GLSL type, containing the components of all vectors or matrices in the array.
(*) 与最内层队列中 GSLS 的类型保持一致。包含队列中所有矢量的元素或矩阵中的元素。
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Object value] )</h3>
<p>
value -- An object containing the value to set up the uniform. It's type must be one of the Uniform Types described above.
value -- 包含需要设置 Uniform 数据的对象。 数据类型必须是上述类型中的一种。
</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:Object value]</h3>
<p>
Current value of the uniform.
当前 uniform 的值。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:Uniform clone]()</h3>
<p>
Returns a clone of this uniform.<br />
If the uniform's value property is an [page:Object] with a clone() method, this is used, otherwise the value is copied by assigment.
Array values are shared between cloned [page:Uniform]s.<br /><br />
See [example:webgldeferred_animation WebGL deferred animation] for an example of this method in use.
返回该 Uniform 的克隆。<br />
如果 Uniform 的 value 属性是一个带 clone() 方法的 [page:Object],则克隆该对象时,value 的 clone() 方法也会被调用,否则克隆时只会使用赋值语句。
队列中的值会在该 Uniform 和 被克隆对象间共享。<br /><br />
该方法的使用示例详见 [example:webgldeferred_animation WebGL deferred animation]。
</p>
<h2>Source</h2>
<h2>资源</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -13,7 +13,7 @@
<h1>BufferAttribute Types</h1>
<p class="desc">
There are nine types of [page:BufferAttribute] available in three.js. These correspond to the JavaScript
在 three.js 中一共有 9 种 [page:BufferAttribute]。每种和 JavaScript 中的类型相对应。
[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#Syntax Typed Arrays].
</p>
......@@ -29,7 +29,7 @@
THREE.Int8BufferAttribute
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
All of the above are called in the same way.
<h3>TypedBufferAttribute( [param:Array array], [param:Integer itemSize], [param:Boolean normalized] )</h3>
......@@ -41,15 +41,15 @@
normalized -- (optional) indicates how the underlying data in the buffer maps to the values in the GLSL code.
</p>
<h2>Properties</h2>
<h2>属性</h2>
See the [page:BufferAttribute] page for inherited properties.
继承属性详见 [page:BufferAttribute]。
<h2>Methods</h2>
<h2>方法</h2>
See the [page:BufferAttribute] page for inherited methods.
继承方法详见 [page:BufferAttribute]。
<h2>Source</h2>
<h2>资源</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js src/core/BufferAttribute.js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -12,10 +12,10 @@
<h1>[name]</h1>
<p class="desc">An 3D arrow object for visualizing directions.</p>
<p class="desc">用于模拟方向的3维箭头对象.</p>
<h2>Example</h2>
<h2>例子</h2>
<div>[example:webgl_geometries WebGL / geometries]</div>
<div>[example:webgl_geometry_normals WebGL / geometry / normals]</div>
......@@ -37,61 +37,61 @@
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]([param:Vector3 dir], [param:Vector3 origin], [param:Number length], [param:Number hex], [param:Number headLength], [param:Number headWidth] )</h3>
<p>
[page:Vector3 dir] -- direction from origin. Must be a unit vector. <br />
[page:Vector3 origin] -- Point at which the arrow starts.<br />
[page:Number length] -- length of the arrow. Default is *1*.<br />
[page:Number hex] -- hexadecimal value to define color. Default is 0xffff00.<br />
[page:Number headLength] -- The length of the head of the arrow. Default is 0.2 * length.<br />
[page:Number headWidth] -- The length of the width of the arrow. Default is 0.2 * headLength.
[page:Vector3 dir] -- 基于箭头原点的方向. 必须为单位向量. <br />
[page:Vector3 origin] -- 箭头的原点.<br />
[page:Number length] -- 箭头的长度. 默认为 *1*.<br />
[page:Number hex] -- 定义的16进制颜色值. 默认为 0xffff00.<br />
[page:Number headLength] -- 箭头头部(锥体)的长度. 默认为箭头长度的0.2倍(0.2 * length).<br />
[page:Number headWidth] -- 箭头的宽度. 默认为箭头头部(锥体)长度的0.2倍(0.2 * headLength).
</p>
<h2>Properties</h2>
<p>See the base [page:Object3D] class for common properties.</p>
<h2>属性</h2>
<p>请到基类 [page:Object3D] 页面查看公共属性.</p>
<h3>[property:Line line]</h3>
<p>Contains the line part of the arrowHelper.</p>
<p>包含箭头辅助对象的线段部分.</p>
<h3>[property:Mesh cone]</h3>
<p>Contains the cone part of the arrowHelper.</p>
<p>包含箭头辅助对象的锥体部分.</p>
<h2>Methods</h2>
<p>See the base [page:Object3D] class for common methods.</p>
<h2>方法</h2>
<p>请到基类 [page:Object3D] 页面查看公共方法.</p>
<h3>[method:null setColor]([param:Number hex])</h3>
<p>
hex -- The hexadecimal value of the color.<br /><br />
hex -- 16进制颜色值.<br /><br />
Sets the color of the arrowHelper.
设置箭头辅助对象的颜色.
</p>
<h3>[method:null setLength]([param:Number length], [param:Number headLength], [param:Number headWidth])</h3>
<p>
length -- The desired length.<br />
headLength -- The length of the head of the arrow.<br />
headWidth -- The length of the width of the arrow.<br /><br />
length -- 要设置的长度.<br />
headLength -- 要设置的箭头头部(锥体)的长度.<br />
headWidth -- 要设置的箭头的宽度.<br /><br />
Sets the length of the arrowhelper.
设置箭头辅助对象的长度.
</p>
<h3>[method:null setDirection]([param:Vector3 dir])</h3>
<p>
dir -- The desired direction. Must be a unit vector.<br /><br />
dir -- 要设置的方向. 必须为单位向量.<br /><br />
Sets the direction of the arrowhelper.
设置箭头辅助对象的方向.
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -12,11 +12,11 @@
<h1>[name]</h1>
<p class="desc">An axis object to visualize the 3 axes in a simple way. <br />
The X axis is red. The Y axis is green. The Z axis is blue.</p>
<p class="desc">用于简单模拟3个坐标轴的对象. <br />
红色代表 X 轴. 绿色代表 Y 轴. 蓝色代表 Z 轴.</p>
<h2>Example</h2>
<h2>例子</h2>
<div>[example:webgl_geometries WebGL / geometries]</div>
<div>[example:webgl_geometries2 WebGL / geometries2]</div>
......@@ -30,21 +30,21 @@ var axesHelper = new THREE.AxesHelper( 5 );
scene.add( axesHelper );
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Number size] )</h3>
<p>
[page:Number size] -- (optional) size of the lines representing the axes. Default is *1*.
[page:Number size] -- (可选的) 表示代表轴的线段长度. 默认为 *1*.
</p>
<h2>Properties</h2>
<p>See the base [page:LineSegments] class for common properties.</p>
<h2>属性</h2>
<p>请到基类 [page:LineSegments] 页面查看公共属性.</p>
<h2>Methods</h2>
<p>See the base [page:LineSegments] class for common methods.</p>
<h2>方法</h2>
<p>请到基类 [page:LineSegments] 页面查看公共方法.</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -13,11 +13,11 @@
<h1>[name]</h1>
<p class="desc">
Helper object to visualize a [page:Box3].
模拟3维包围盒 [page:Box3] 的辅助对象.
</p>
<h2>Example</h2>
<h2>例子</h2>
<code>
var box = new THREE.Box3();
......@@ -28,36 +28,36 @@
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Box3 box], [param:Color color] )</h3>
<p>
[page:Box3 box] -- the Box3 to show.<br />
[page:Color color] -- (optional) the box's color. Default is 0xffff00.<br /><br />
[page:Box3 box] -- 被模拟的3维包围盒.<br />
[page:Color color] -- (可选的) 线框盒子的颜色. 默认为 0xffff00.<br /><br />
Creates a new wireframe box that represents the passed Box3.
创建一个新的线框盒子用以表示指定的3维包围盒.
</p>
<h2>Properties</h2>
<p>See the base [page:LineSegments] class for common properties.</p>
<h2>属性</h2>
<p>请到基类 [page:LineSegments] 页面查看公共属性.</p>
<h3>[property:Box3 box]</h3>
<p>The Box3 being visualized.</p>
<p>被模拟的3维包围盒.</p>
<h2>Methods</h2>
<p>See the base [page:LineSegments] class for common methods.</p>
<h2>方法</h2>
<p>请到基类 [page:LineSegments] 页面查看公共方法.</p>
<h3>[method:void updateMatrixWorld]( [param:Boolean force] )</h3>
<p>
This overrides the method in the base [page:Object3D] class so that it
also updates the wireframe box to the extent of the [page:Box3Helper.box .box]
property.
重写基类 [page:Object3D] 的该方法以便于
同时更新线框辅助对象与 [page:Box3Helper.box .box]
属性保持一致.
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -13,14 +13,14 @@
<h1>[name]</h1>
<p class="desc">
Helper object to show the world-axis-aligned bounding box around an object.
用于展示对象世界轴心对齐的包围盒的辅助对象.
Note that the object must have a [page:Geometry] or [page:BufferGeometry] for this to work,
so it won't work with [page:Sprite Sprites].
注意:要想能正常运行,目标对象必须包含 [page:Geometry] 或 [page:BufferGeometry] ,
所以当目标对象是精灵 [page:Sprite Sprites] 时将不能正常运行.
</p>
<h2>Example</h2>
<h2>例子</h2>
<div>[example:webgl_helpers WebGL / helpers]</div>
<div>[example:webgl_loader_nrrd WebGL / loader / nrrd]</div>
......@@ -35,39 +35,39 @@
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Object3D object], [param:Color color] )</h3>
<p>
[page:Object3D object] -- (optional) the object3D to show the world-axis-aligned boundingbox.<br />
[page:Color color] -- (optional) hexadecimal value that defines the box's color. Default is 0xffff00.<br /><br />
[page:Object3D object] -- (可选的) 被展示世界轴心对齐的包围盒的对象.<br />
[page:Color color] -- (可选的) 线框盒子的16进制颜色值. 默认为 0xffff00.<br /><br />
Creates a new wireframe box that bounds the passed object. Internally this uses [page:Box3.setFromObject]
to calculate the dimensions. Note that this includes any children.
创建一个新的线框盒子包围指定的对象. 内部使用 [page:Box3.setFromObject]
方法来计算尺寸. 注意:此线框盒子将包围对象的所有子对象.
</p>
<h2>Properties</h2>
<p>See the base [page:LineSegments] class for common properties.</p>
<h2>属性</h2>
<p>请到基类 [page:LineSegments] 页面查看公共属性.</p>
<h2>Methods</h2>
<p>See the base [page:LineSegments] class for common methods.</p>
<h2>方法</h2>
<p>请到基类 [page:LineSegments] 页面查看公共方法.</p>
<h3>[method:null update]()</h3>
<p>
Updates the helper's geometry to match the dimensions
of the object, including any children. See [page:Box3.setFromObject].
更新辅助对象的几何体,与目标对象尺寸
保持一致, 包围目标对象所有子对象. 请查看 [page:Box3.setFromObject].
</p>
<h3>[method:BoxHelper setFromObject]( [param:Object3D object] )</h3>
<p>
[page:Object3D object] - [page:Object3D] to create the helper of.<br /><br />
[page:Object3D object] - 用于创建辅助对象的目标 [page:Object3D] 对象.<br /><br />
Updates the wireframe box for the passed object.
更新指定对象的线框盒子.
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -13,11 +13,11 @@
<h1>[name]</h1>
<p class="desc">
This helps with visualizing what a camera contains in its frustum.<br />
It visualizes the frustum of a camera using a [page:LineSegments].
用于模拟相机视锥体的辅助对象.<br />
它使用 [page:LineSegments] 来模拟相机视锥体.
</p>
<h2>Example</h2>
<h2>例子</h2>
<div>[example:webgl_camera WebGL / camera]</div>
<div>[example:webgl_geometry_extrude_splines WebGL / extrude / splines]</div>
......@@ -29,50 +29,50 @@ scene.add( helper );
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Camera camera] )</h3>
<p>
[page:Camera camera] -- The camera to visualize.<br /><br />
[page:Camera camera] -- 被模拟的相机.<br /><br />
This create a new [Name] for the specified camera.
为指定相机创建一个新的相机辅助对象 [Name] .
</p>
<h2>Properties</h2>
<p>See the base [page:LineSegments] class for common properties.</p>
<h2>属性</h2>
<p>请到基类 [page:LineSegments] 页面查看公共属性.</p>
<h3>[property:Camera camera]</h3>
<p>The camera being visualized.</p>
<p>被模拟的相机.</p>
<h3>[property:object pointMap]</h3>
<p>This contains the points used to visualize the camera.</p>
<p>包含用于模拟相机的点.</p>
<h3>[property:object matrix]</h3>
<p>Reference to the [page:Object3D.matrixWorld camera.matrixWorld].</p>
<p>请参考相机的世界矩阵 [page:Object3D.matrixWorld camera.matrixWorld].</p>
<h3>[property:object matrixAutoUpdate]</h3>
<p>
See [page:Object3D.matrixAutoUpdate]. Set to *false* here as the helper is using the
camera's [page:Object3D.matrixWorld matrixWorld].
请查看 [page:Object3D.matrixAutoUpdate]. 这里设置为 *false* 表示辅助对象
使用相机的 [page:Object3D.matrixWorld matrixWorld].
</p>
<h2>Methods</h2>
<p>See the base [page:LineSegments] class for common methods.</p>
<h2>方法</h2>
<p>请到基类 [page:LineSegments] 页面查看公共方法.</p>
<h3>[method:null update]()</h3>
<p>Updates the helper based on the projectionMatrix of the camera.</p>
<p>基于相机的投影矩阵更新辅助对象.</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -13,12 +13,12 @@
<h1>[name]</h1>
<p class="desc">
Helper object to assist with visualizing a [page:DirectionalLight]'s effect on the scene.
用于模拟场景中平行光 [page:DirectionalLight] 的辅助对象.
This consists of plane and a line representing the light's position and direction.
其中包含了表示光位置的平面和表示光方向的线段.
</p>
<h2>Example</h2>
<h2>例子</h2>
<code>
var light = new THREE.DirectionalLight( 0xFFFFFF );
......@@ -29,56 +29,56 @@
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:DirectionalLight light], [param:Number size], [param:Hex color] )</h3>
<p>
[page:DirectionalLight light]-- The light to be visualized. <br /><br />
[page:DirectionalLight light]-- 被模拟的光源. <br /><br />
[page:Number size] -- (optional) dimensions of the plane. Default is *1*.<br /><br />
[page:Number size] -- (可选的) 平面的尺寸. 默认为 *1*.<br /><br />
[page:Hex color] -- (optional) if this is not the set the helper will take the color of the light.
[page:Hex color] -- (可选的) 如果没有设置颜色将使用光源的颜色.
</p>
<h2>Properties</h2>
<p>See the base [page:Object3D] class for common properties.</p>
<h2>属性</h2>
<p>请到基类 [page:Object3D] 页面查看公共属性.</p>
<h3>[property:Line lightPlane]</h3>
<p>Contains the line mesh showing the location of the directional light.</p>
<p>包含表示平行光方向的线网格.</p>
<h3>[property:DirectionalLight light]</h3>
<p>Reference to the [page:DirectionalLight directionalLight] being visualized.</p>
<p>被模拟的光源. 请参考 [page:DirectionalLight directionalLight] .</p>
<h3>[property:object matrix]</h3>
<p>Reference to the light's [page:Object3D.matrixWorld matrixWorld].</p>
<p>请参考光源的世界矩阵 [page:Object3D.matrixWorld matrixWorld].</p>
<h3>[property:object matrixAutoUpdate]</h3>
<p>
See [page:Object3D.matrixAutoUpdate]. Set to *false* here as the helper is using the
light's [page:Object3D.matrixWorld matrixWorld].
请查看 [page:Object3D.matrixAutoUpdate] 页面. 这里设置为 *false* 表示辅助对象
使用光源的 [page:Object3D.matrixWorld matrixWorld].
</p>
<h3>[property:hex color]</h3>
<p>
The color parameter passed in the constructor. Default is *undefined*. If this is changed,
the helper's color will update the next time [page:.update update] is called.
构造函数中传入的颜色值. 默认为 *undefined*. 如果改变该值,
辅助对象的颜色将在下一次 [page:.update update] 被调用时更新.
</p>
<h2>Methods</h2>
<p>See the base [page:Object3D] class for common properties.</p>
<h2>方法</h2>
<p>请到基类 [page:Object3D] 页面查看公共方法.</p>
<h3>[method:null dispose]()</h3>
<p>Dispose of the directionalLightHelper.</p>
<p>销毁该平行光辅助对象.</p>
<h3>[method:null update]()</h3>
<p>Updates the helper to match the position and direction of the [page:.light directionalLight] being visualized.</p>
<p>更新辅助对象,与模拟的 [page:.light directionalLight] 光源的位置和方向保持一致.</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -13,16 +13,16 @@
<h1>[name]</h1>
<p class="desc">
Renders [page:ArrowHelper arrows] to visualize an object's [page:Face3 face] normals.
Requires that face normals have been specified on all [page:Face3 faces] or calculated
with [page:Geometry.computeFaceNormals computeFaceNormals]. <br /><br />
渲染箭头辅助对象 [page:ArrowHelper arrows] 来模拟面 [page:Face3 face] 的法线.
需要所有面 [page:Face3 faces] 都指定了法线 或
通过 [page:Geometry.computeFaceNormals computeFaceNormals] 方法计算面的法线. <br /><br />
Note that this only works with the objects whose geometry is an instance of [page:Geometry].
For [page:BufferGeometry] use a [page:VertexNormalsHelper] instead.
注意:仅几何体为 [page:Geometry] 类型的对象能正常运行.
对于 [page:BufferGeometry] 类型几何体的对象请使用 [page:VertexNormalsHelper] 代替.
<p>
<h2>Example</h2>
<h2>例子</h2>
<div>[example:webgl_helpers WebGL / helpers]</div>
......@@ -37,44 +37,44 @@
scene.add( helper );
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Object3D object], [param:Number size], [param:Color color], [param:Number linewidth] )</h3>
<p>
[page:Object3D object] -- object for which to render face normals.<br />
[page:Number size] -- (optional) length of the arrows. Default is *1*.<br />
[page:Hex color] -- (optional) hex color of the arrows. Default is *0xffff00*.<br />
[page:Number linewidth] -- (optional) width of the arrow lines. Default is *1*.
[page:Object3D object] -- 要渲染面法线辅助的对象.<br />
[page:Number size] -- (可选的) 箭头的长度. 默认为 *1*.<br />
[page:Hex color] -- (可选的) 箭头的颜色. 默认为 *0xffff00*.<br />
[page:Number linewidth] -- (可选的) 箭头线段的宽度. 默认为 *1*.
</p>
<h2>Properties</h2>
<p>See the base [page:LineSegments] class for common properties.</p>
<h2>属性</h2>
<p>请到基类 [page:LineSegments] 页面查看公共属性.</p>
<h3>[property:object matrixAutoUpdate]</h3>
<p>
See [page:Object3D.matrixAutoUpdate]. Set to *false* here as the helper is using the
objects's [page:Object3D.matrixWorld matrixWorld].
请查看 [page:Object3D.matrixAutoUpdate]. 这里设置为 *false* 表示辅助对象
使用对象的世界矩阵 [page:Object3D.matrixWorld matrixWorld].
</p>
<h3>[property:Object3D object]</h3>
<p>The object for which the face normals are being visualized.</p>
<p>被渲染面法线辅助的对象.</p>
<h3>[property:Number size]</h3>
<p>Length of the arrows. Default is *1*.</p>
<p>箭头的长度. 默认为 *1*.</p>
<h2>Methods</h2>
<p>See the base [page:LineSegments] class for common methods.</p>
<h2>方法</h2>
<p>请到基类 [page:LineSegments] 页面查看公共方法.</p>
<h3>[method:null update]()</h3>
<p>Updates the face normal preview based on movement of the object.</p>
<p>基于对象的运动更新面法线辅助对象.</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -12,10 +12,10 @@
<h1>[name]</h1>
<p class="desc">The GridHelper is an object to define grids. Grids are two-dimensional arrays of lines.</p>
<p class="desc">坐标格辅助对象. 坐标格实际上是2维线数组.</p>
<h2>Example</h2>
<h2>例子</h2>
<code>var size = 10;
var divisions = 10;
......@@ -26,20 +26,20 @@
[example:webgl_helpers Example using various helpers]
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:number size], [param:Number divisions], [param:Color colorCenterLine], [param:Color colorGrid] )</h3>
<p>
size -- The size of the grid. Default is 10. <br />
divisions -- The number of divisions across the grid. Default is 10. <br />
colorCenterLine -- The color of the centerline. This can be a [page:Color], a hexadecimal value and an CSS-Color name. Default is 0x444444 <br />
colorGrid -- The color of the lines of the grid. This can be a [page:Color], a hexadecimal value and an CSS-Color name. Default is 0x888888
size -- 坐标格尺寸. 默认为 10. <br />
divisions -- 坐标格细分次数. 默认为 10. <br />
colorCenterLine -- 中线颜色. 值可以为 [page:Color] 类型, 16进制 和 CSS 颜色名. 默认为 0x444444 <br />
colorGrid -- 坐标格网格线颜色. 值可以为 [page:Color] 类型, 16进制 和 CSS 颜色名. 默认为 0x888888
</p>
<p>
Creates a new [name] of size 'size' and divided into 'divisions' segments per side. Colors are optional.
创建一个尺寸为 'size' 和 每个维度细分 'divisions' 次的坐标格. 颜色可选.
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -13,10 +13,11 @@
<h1>[name]</h1>
<p class="desc">
Creates a visual aid consisting of a spherical [page:Mesh] for a [page:HemisphereLight HemisphereLight].
创建一个虚拟的球形网格 [page:Mesh] 的辅助对象来模拟
半球形光源 [page:HemisphereLight HemisphereLight].
</p>
<h3>Example</h3>
<h3>例子</h3>
<code>
var light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );
......@@ -27,51 +28,51 @@ scene.add( helper );
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:HemisphereLight light], [param:Number sphereSize], [param:Hex color] )</h3>
<p>
[page:HemisphereLight light] -- The light being visualized. <br /><br />
[page:HemisphereLight light] -- 被模拟的光源. <br /><br />
[page:Number size] -- The size of the mesh used to visualize the light.<br /><br />
[page:Number size] -- 用于模拟光源的网格尺寸.<br /><br />
[page:Hex color] -- (optional) if this is not the set the helper will take the color of the light.
[page:Hex color] -- (可选的) 如果没有赋值辅助对象将使用光源的颜色.
</p>
<h2>Properties</h2>
<p>See the base [page:Object3D] class for common properties.</p>
<h2>属性</h2>
<p>请到基类 [page:Object3D] 页面查看公共属性.</p>
<h3>[property:HemisphereLight light]</h3>
<p>Reference to the HemisphereLight being visualized.</p>
<p>被模拟的半球形光源.</p>
<h3>[property:object matrix]</h3>
<p>Reference to the hemisphereLight's [page:Object3D.matrixWorld matrixWorld].</p>
<p>请参考半球形光源的世界矩阵 [page:Object3D.matrixWorld matrixWorld].</p>
<h3>[property:object matrixAutoUpdate]</h3>
<p>
See [page:Object3D.matrixAutoUpdate]. Set to *false* here as the helper is using the
hemisphereLight's [page:Object3D.matrixWorld matrixWorld].
请查看 [page:Object3D.matrixAutoUpdate]. 这里设置为 *false* 表示辅助对象
使用半球形光源的 [page:Object3D.matrixWorld matrixWorld].
</p>
<h3>[property:hex color]</h3>
<p>
The color parameter passed in the constructor. Default is *undefined*. If this is changed, the helper's color will update
the next time [page:.update update] is called.
构造函数中传入的颜色值. 默认为 *undefined*. 如果改变该值,
辅助对象的颜色将在下一次 [page:.update update] 被调用时更新.
</p>
<h2>Methods</h2>
<p>See the base [page:Object3D] class for common methods.</p>
<h2>方法</h2>
<p>请到基类 [page:Object3D] 页面查看公共方法.</p>
<h3>[method:null dispose]()</h3>
<p>Dispose of the hemisphereLightHelper.</p>
<p>销毁该半球形光源辅助对象.</p>
<h3>[method:null update]()</h3>
<p>Updates the helper to match the position and direction of the [page:.light].</p>
<p>更新辅助对象,与 [page:.light] 属性的位置和方向保持一致.</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -13,11 +13,11 @@
<h1>[name]</h1>
<p class="desc">
Helper object to visualize a [page:Plane].
用于模拟平面 [page:Plane] 的辅助对象.
</p>
<h2>Example</h2>
<h2>例子</h2>
<code>
var plane = new THREE.Plane( new THREE.Vector3( 1, 1, 0.2 ), 3 );
......@@ -26,39 +26,39 @@
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Plane plane], [param:Float size], [param:Color hex] )</h3>
<p>
[page:Plane plane] -- the plane to visualize.<br />
[page:Float size] -- (optional) side length of plane helper. Default is 1.<br />
[page:Color color] -- (optional) the color of the helper. Default is 0xffff00.<br /><br />
[page:Plane plane] -- 被模拟的平面.<br />
[page:Float size] -- (可选的) 辅助对象的单边长度. 默认为 1.<br />
[page:Color color] -- (可选的) 辅助对象的颜色. 默认为 0xffff00.<br /><br />
Creates a new wireframe representation of the passed plane.
创建一个线框辅助对象来表示指定平面.
</p>
<h2>Properties</h2>
<p>See the base [page:LineSegments] class for common properties.</p>
<h2>属性</h2>
<p>请到基类 [page:LineSegments] 页面查看公共属性.</p>
<h3>[property:Plane plane]</h3>
<p>The [page:Plane plane] being visualized.</p>
<p>被模拟的平面 [page:Plane plane] .</p>
<h3>[property:Float size]</h3>
<p>The side lengths of plane helper.</p>
<p>辅助对象的单边长度.</p>
<h2>Methods</h2>
<p>See the base [page:LineSegments] class for common methods.</p>
<h2>方法</h2>
<p>请到基类 [page:LineSegments] 页面查看公共方法.</p>
<h3>[method:void updateMatrixWorld]( [param:Boolean force] )</h3>
<p>
This overrides the method in the base [page:Object3D] class so that it also
updates the helper object according to the [page:PlaneHelper.plane .plane] and
[page:PlaneHelper.size .size] properties.
重写基类 [page:Object3D] 的该方法以便于
同时更新线框辅助对象与 [page:PlaneHelper.plane .plane] 和
[page:PlaneHelper.size .size] 属性保持一致.
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -13,12 +13,12 @@
<h1>[name]</h1>
<p class="desc">
This displays a helper object consisting of a spherical [page:Mesh] for visualizing
a [page:PointLight].
创建一个虚拟的球形网格 [page:Mesh] 的辅助对象来模拟
点光源 [page:PointLight].
</p>
<h2>Example</h2>
<h2>例子</h2>
[example:webgl_helpers WebGL / helpers]
......@@ -35,49 +35,49 @@
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:PointLight light], [param:Float sphereSize], [param:Hex color] )</h3>
<p>
[page:PointLight light] -- The light to be visualized. <br /><br />
[page:PointLight light] -- 要模拟的光源. <br /><br />
[page:Float sphereSize] -- (optional) The size of the sphere helper. Default is *1*.<br /><br />
[page:Float sphereSize] -- (可选的) 球形辅助对象的尺寸. 默认为 *1*.<br /><br />
[page:Hex color] -- (optional) if this is not the set the helper will take the color of the light.
[page:Hex color] -- (可选的) 如果没有赋值辅助对象将使用光源的颜色.
</p>
<h2>Properties</h2>
<p>See the base [page:Mesh] class for common properties.</p>
<h2>属性</h2>
<p>请到基类 [page:Mesh] 页面查看公共属性.</p>
<h3>[property:PointLight light]</h3>
<p>The [page:PointLight] that is being visualized.</p>
<p>被模拟的点光源 [page:PointLight] .</p>
<h3>[property:object matrix]</h3>
<p>Reference to the pointLight's [page:Object3D.matrixWorld matrixWorld].</p>
<p>请参考点光源的世界矩阵 [page:Object3D.matrixWorld matrixWorld].</p>
<h3>[property:object matrixAutoUpdate]</h3>
<p>
See [page:Object3D.matrixAutoUpdate]. Set to *false* here as the helper is using the
pointLight's [page:Object3D.matrixWorld matrixWorld].
请查看 [page:Object3D.matrixAutoUpdate]. 这里设置为 *false* 表示辅助对象
使用点光源的 [page:Object3D.matrixWorld matrixWorld].
</p>
<h3>[property:hex color]</h3>
<p>
The color parameter passed in the constructor. Default is *undefined*. If this is changed, the helper's color will update
the next time [page:.update update] is called.
构造函数中传入的颜色值. 默认为 *undefined*. 如果改变该值,
辅助对象的颜色将在下一次 [page:.update update] 被调用时更新.
</p>
<h2>Methods</h2>
<p>See the base [page:Mesh] class for common methods.</p>
<h2>方法</h2>
<p>请到基类 [page:Mesh] 页面查看公共方法.</p>
<h3>[method:null dispose]()</h3>
<p>Dispose of the pointLightHelper.</p>
<p>销毁该点光源辅助对象.</p>
<h3>[method:null update]()</h3>
<p>Updates the helper to match the position of the [page:.light].</p>
<p>更新辅助对象,与 [page:.light] 属性的位置保持一致.</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -12,10 +12,10 @@
<h1>[name]</h1>
<p class="desc">The PolarGridHelper is an object to define polar grids. Grids are two-dimensional arrays of lines.</p>
<p class="desc">极坐标格辅助对象. 坐标格实际上是2维线数组.</p>
<h2>Example</h2>
<h2>例子</h2>
<code>var radius = 10;
var radials = 16;
......@@ -28,22 +28,22 @@
[example:webgl_helpers Example using various helpers]
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Number radius], [param:Number radials], [param:Number circles], [param:Number divisions], [param:Color color1], [param:Color color2] )</h3>
<p>
radius -- The radius of the polar grid. This can be any positive number. Default is 10.<br />
radials -- The number of radial lines. This can be any positive integer. Default is 16.<br />
circles -- The number of circles. This can be any positive integer. Default is 8.<br />
divisions -- The number of line segments used for each circle. This can be any positive integer that is 3 or greater. Default is 64.<br />
color1 -- The first color used for grid elements. This can be a [page:Color], a hexadecimal value and an CSS-Color name. Default is 0x444444 <br />
color2 -- The second color used for grid elements. This can be a [page:Color], a hexadecimal value and an CSS-Color name. Default is 0x888888
radius -- 极坐标格半径. 可以为任何正数. 默认为 10.<br />
radials -- 径向辐射线数量. 可以为任何正整数. 默认为 16.<br />
circles -- 圆圈的数量. 可以为任何正整数. 默认为 8.<br />
divisions -- 圆圈细分段数. 可以为任何大于或等于3的正整数. 默认为 64.<br />
color1 -- 极坐标格使用的第一个颜色. 值可以为 [page:Color] 类型, 16进制 和 CSS 颜色名. 默认为 0x444444 <br />
color2 -- 极坐标格使用的第二个颜色. 值可以为 [page:Color] 类型, 16进制 和 CSS 颜色名. 默认为 0x888888
</p>
<p>
Creates a new [name] of radius 'radius' with 'radials' number of radials and 'circles' number of circles, where each circle is smoothed into 'divisions' number of line segments. Colors are optional.
创建一个半径为'radius' 包含 'radials' 条径向辐射线 和 'circles' 个细分成 'divisions' 段的圆圈的极坐标格辅助对象. 颜色可选.
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -13,10 +13,10 @@
<h1>[name]</h1>
<p class="desc">
Creates a visual aid for a [page:RectAreaLight].
创建一个表示 [page:RectAreaLight] 的辅助对象.
</p>
<h3>Example</h3>
<h3>例子</h3>
<code>
var light = new THREE.RectAreaLight( 0xffffbb, 1.0, 5, 5 );
......@@ -27,40 +27,40 @@ scene.add( helper );
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:RectAreaLight light], [param:Hex color] )</h3>
<p>
[page:RectAreaLight light] -- The light being visualized.<br /><br />
[page:RectAreaLight light] -- 被模拟的光源.<br /><br />
[page:Hex color] -- (optional) if this is not the set the helper will take the color of the light.
[page:Hex color] -- (可选) 如果没有赋值辅助对象将使用光源的颜色.
</p>
<h2>Properties</h2>
<p>See the base [page:Object3D] class for common properties.</p>
<h2>属性</h2>
<p>请到基类 [page:Object3D] 页面查看公共属性.</p>
<h3>[property:RectAreaLight light]</h3>
<p>Reference to the RectAreaLight being visualized.</p>
<p>被模拟的区域光源.</p>
<h3>[property:hex color]</h3>
<p>
The color parameter passed in the constructor. Default is *undefined*. If this is changed, the helper's color will update
the next time [page:.update update] is called.
构造函数中传入的颜色值. 默认为 *undefined*. 如果改变该值,
辅助对象的颜色将在下一次 [page:.update update] 被调用时更新.
</p>
<h2>Methods</h2>
<p>See the base [page:Object3D] class for common methods.</p>
<h2>方法</h2>
<p>请到基类 [page:Object3D] 页面查看公共方法.</p>
<h3>[method:null dispose]()</h3>
<p>Dispose of the rectAreaLightHelper.</p>
<p>销毁该区域光源辅助对象.</p>
<h3>[method:null update]()</h3>
<p>Updates the helper to match the position and direction of the [page:.light].</p>
<p>更新辅助对象,与 [page:.light] 属性的位置和方向保持一致.</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -13,12 +13,12 @@
<h1>[name]</h1>
<p class="desc">
A helper object to assist with visualizing a [page:Skeleton Skeleton].
The helper is renderered using a [page:LineBasicMaterial LineBasicMaterial].
用来模拟骨骼 [page:Skeleton Skeleton] 的辅助对象.
该辅助对象使用 [page:LineBasicMaterial LineBasicMaterial] 材质.
</p>
<h2>Example</h2>
<h2>例子</h2>
[example:webgl_animation_skinning_blending animation / skinning / blending]<br />
[example:webgl_animation_skinning_morph animation / skinning / morph]<br />
......@@ -32,30 +32,30 @@ scene.add( helper );
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( object )</h3>
<p>
object -- can be any object that has an array of [page:Bone Bone]s as a sub object. <br />
For example, a [page:Skeleton Skeleton] or a [page:SkinnedMesh SkinnedMesh].
object -- 可以是任何拥有一组骨 [page:Bone Bone] 作为子对象的对象. <br />
比如, 一个骨骼 [page:Skeleton Skeleton] 或 一个蒙皮网格 [page:SkinnedMesh SkinnedMesh].
</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:Array bones]</h3>
<p>
The list of bones that the helper renders as [page:Line Lines].
辅助对象使用 [page:Line Lines] 渲染的骨数组.
</p>
<h3>[property:Object root]</h3>
<p>
The object passed in the constructor.
构造函数传入的对象.
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -12,16 +12,16 @@
<h1>[name]</h1>
<p class="desc">This displays a cone shaped helper object for a [page:SpotLight].</p>
<p class="desc">用于模拟聚光灯 [page:SpotLight] 的锥形辅助对象.</p>
<h2>Example</h2>
<h2>例子</h2>
<iframe src='../examples/webgl_lights_spotlight.html'></iframe>
<a target="THREE_Examples" href="../examples/#webgl_lights_spotlight">View in Examples</a><br />
<h2>Other Examples</h2>
<h2>其他例子</h2>
<div>[example:webgl_lights_spotlights lights / spotlights ]</div>
<h2>Code Example</h2>
<h2>代码示例</h2>
<code>
var spotLight = new THREE.SpotLight( 0xffffff );
spotLight.position.set( 10, 10, 10 );
......@@ -32,51 +32,51 @@
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:SpotLight light], [param:Hex color] )</h3>
<p>
[page:SpotLight light] -- The [page:SpotLight] to be visualized. <br /><br/>
[page:SpotLight light] -- 被模拟的聚光灯 [page:SpotLight] . <br /><br/>
[page:Hex color] -- (optional) if this is not the set the helper will take the color of the light.
[page:Hex color] -- (可选的) 如果没有赋值辅助对象将使用光源的颜色.
</p>
<h2>Properties</h2>
<p>See the base [page:Object3D] class for common properties.</p>
<h2>属性</h2>
<p>请到基类 [page:Object3D] 页面查看公共属性.</p>
<h3>[property:LineSegments cone]</h3>
<p>[page:LineSegments] used to visualize the light.</p>
<p>用于模拟光源的 [page:LineSegments] 类型对象.</p>
<h3>[property:SpotLight light]</h3>
<p>Reference to the [page:SpotLight] being visualized.</p>
<p>被模拟的聚光灯 [page:SpotLight] .</p>
<h3>[property:object matrix]</h3>
<p>Reference to the spotLight's [page:Object3D.matrixWorld matrixWorld].</p>
<p>请参考聚光灯的世界矩阵 [page:Object3D.matrixWorld matrixWorld].</p>
<h3>[property:object matrixAutoUpdate]</h3>
<p>
See [page:Object3D.matrixAutoUpdate]. Set to *false* here as the helper is using the
spotLight's [page:Object3D.matrixWorld matrixWorld].
请查看 [page:Object3D.matrixAutoUpdate]. 这里设置为 *false* 表示辅助对象
使用聚光灯的 [page:Object3D.matrixWorld matrixWorld].
</p>
<h3>[property:hex color]</h3>
<p>
The color parameter passed in the constructor. Default is *undefined*. If this is changed, the helper's color will update
the next time [page:.update update] is called.
构造函数中传入的颜色值. 默认为 *undefined*. 如果改变该值,
辅助对象的颜色将在下一次 [page:.update update] 被调用时更新.
</p>
<h2>Methods</h2>
<p>See the base [page:Object3D] class for common methods.</p>
<h2>方法</h2>
<p>请到基类 [page:Object3D] 页面查看公共属性.</p>
<h3>[method:null dispose]()</h3>
<p>Disposes of the light helper.</p>
<p>销毁该聚光灯辅助对象.</p>
<h3>[method:null update]()</h3>
<p>Updates the light helper.</p>
<p>更新聚光灯辅助对象.</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -13,14 +13,14 @@
<h1>[name]</h1>
<p class="desc">
Renders [page:ArrowHelper arrows] to visualize an object's vertex normal vectors.
Requires that normals have been specified in a [page:BufferAttribute custom attribute] or
have been calculated using [page:Geometry.computeVertexNormals computeVertexNormals].<br /><br />
渲染箭头辅助对象 [page:ArrowHelper arrows] 来模拟顶点的法线.
需要定义了法线缓存属性 [page:BufferAttribute custom attribute] 或
使用了 [page:Geometry.computeVertexNormals computeVertexNormals] 方法计算了顶点法线.<br /><br />
Unlike [page:FaceNormalsHelper], this works with [page:BufferGeometry].
不像面法线辅助对象 [page:FaceNormalsHelper], 该辅助对象在 [page:BufferGeometry] 上也能正常运行.
</p>
<h2>Example</h2>
<h2>例子</h2>
[example:webgl_helpers WebGL / helpers]
......@@ -36,43 +36,43 @@
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Object3D object], [param:Number size], [param:Hex color], [param:Number linewidth] )</h3>
<p>
[page:Object3D object] -- object for which to render vertex normals.<br />
[page:Number size] -- (optional) length of the arrows. Default is 1.<br />
[page:Hex color] -- hex color of the arrows. Default is 0xff0000.<br />
[page:Number linewidth] -- (optional) width of the arrow lines. Default is 1.
[page:Object3D object] -- 要渲染顶点法线辅助的对象.<br />
[page:Number size] -- (可选的) 箭头的长度. 默认为 1.<br />
[page:Hex color] -- 16进制颜色值. 默认为 0xff0000.<br />
[page:Number linewidth] -- (可选的) 箭头线段的宽度. 默认为 1.
</p>
<h2>Properties</h2>
<p>See the base [page:LineSegments] class for common properties.</p>
<h2>属性</h2>
<p>请到基类 [page:LineSegments] 页面查看公共属性.</p>
<h3>[property:object matrixAutoUpdate]</h3>
<p>
See [page:Object3D.matrixAutoUpdate]. Set to *false* here as the helper is using the
objects's [page:Object3D.matrixWorld matrixWorld].
请查看 [page:Object3D.matrixAutoUpdate]. 这里设置为 *false* 表示辅助对象
使用对象的世界矩阵 [page:Object3D.matrixWorld matrixWorld].
</p>
<h3>[property:Object3D object]</h3>
<p>The object for which the vertex normals are being visualized.</p>
<p>被渲染顶点法线辅助的对象.</p>
<h3>[property:Number size]</h3>
<p>Length of the arrows. Default is *1*.</p>
<p>箭头的长度. 默认为 *1*.</p>
<h2>Methods</h2>
<p>See the base [page:LineSegments] class for common methods.</p>
<h2>方法</h2>
<p>请到基类 [page:LineSegments] 页面查看公共方法.</p>
<h3>[method:null update]()</h3>
<p>Updates the vertex normal preview based on movement of the object.</p>
<p>基于对象的运动更新顶点法线辅助对象.</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -13,13 +13,13 @@
<h1>[name]</h1>
<p class="desc">
This light globally illuminates all objects in the scene equally.<br /><br />
环境光会均匀的照亮场景中的所有物体。<br /><br />
This light cannot be used to cast shadows as it does not have a direction.
环境光不能用来投射阴影,因为它没有方向。
</p>
<h2>Example</h2>
<h2>示例</h2>
<p>
[example:canvas_camera_orthographic camera / orthographic ]<br />
[example:canvas_interactive_voxelpainter interactive / voxelpainter ]<br />
......@@ -32,41 +32,41 @@
<code>var light = new THREE.AmbientLight( 0x404040 ); // soft white light
scene.add( light );</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Integer color], [param:Float intensity] )</h3>
<p>
[page:Integer color] - (optional) Numeric value of the RGB component of the color. Default is 0xffffff.<br />
[page:Float intensity] - (optional) Numeric value of the light's strength/intensity. Default is 1.<br /><br />
[page:Integer color] - (参数可选)颜色的rgb数值。缺省值为 0xffffff。<br />
[page:Float intensity] - (参数可选)光照的强度。缺省值为 1。<br /><br />
Creates a new [name].
创建一个环境光对象。
</p>
<h2>Properties</h2>
<h2>属性</h2>
<p>
See the base [page:Light Light] class for common properties.
公共属性请查看基类 [page:Light Light]。
</p>
<h3>[property:Boolean castShadow]</h3>
<p>
This is set to *undefined* in the constructor as ambient lights cannot cast shadows.
这个参数在对象构造的时候就被设置成了 *undefined* 。因为环境光不能投射阴影。
</p>
<h3>[property:Boolean isAmbientLight]</h3>
<p>
Used to check whether this or derived classes are ambient lights. Default is *true*.<br /><br />
用来校验这个类或者派生类是不是环境光.默认是 *true*。<br /><br />
You should not change this, as it used internally for optimisation.
不应该去改变这个变量,因为内部使用这个变量做了些优化的工作。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<p>
See the base [page:Light Light] class for common methods.
公共方法请查看基类[page:Light Light]。
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
<!DOCTYPE html>
<html lang="en">
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
......@@ -10,35 +10,31 @@
<body>
[page:Object3D] &rarr; [page:Light] &rarr;
<h1>[name]</h1>
<h1>平行光([name])</h1>
<p class="desc">
A light that gets emitted in a specific direction. This light will behave as though it is
infinitely far away and the rays produced from it are all parallel. The common use case
for this is to simulate daylight; the sun is far enough away that its position can be
considered to be infinite, and all light rays coming from it are parallel.<br /><br />
平行光是沿着特定方向发射的光。这种光的表现像是无限远,从它发出的光线都是平行的。常常用平行光来模拟太阳光
的效果; 太阳足够远,因此我们可以认为太阳的位置是无限远,所以我们认为从太阳发出的光线也都是平行的。<br /><br />
This light can cast shadows - see the [page:DirectionalLightShadow] page for details.
平行光可以投射阴影 - 跳转至 [page:DirectionalLightShadow] 查看更多细节。
</p>
<h2>A Note about Position, Target and rotation</h2>
<h2>关于位置、目标和旋转说明</h2>
<p>
A common point of confusion for directional lights is that setting the rotation has no effect.
This is because three.js's DirectionalLight is the equivalent to what is often called a 'Target
Direct Light' in other applications.<br /><br />
Three.js 的平行光常见的困惑是设置旋转没有效果。这是因为 three.js 的平行光类似与其他引擎的"目标平行光"。
<br /><br />
This means that its direction is calculated as pointing
from the light's [page:Object3D.position position] to the [page:.target target]'s position
(as opposed to a 'Free Direct Light' that just has a rotation component).<br /><br />
这意味着它的方向是从一个平行光的位置 [page:Object3D.position position] 到 [page:.target target]的位置。
(而不是一个只有旋转分量的'自由平行光')。<br /><br />
The reason for this is to allow the light to cast shadows - the [page:.shadow shadow]
camera needs a position to calculate shadows from.<br /><br />
这样做的原因是为了让光线投射阴影。 - the [page:.shadow shadow]
摄像机需要一个位置来计算阴影。<br /><br />
See the [page:.target target] property below for details on updating the target.
有关更新目标的详细信息,请参阅 [page:.target target] 下面的目标属性。
</p>
<h2>Example</h2>
<h2>示例</h2>
<p>
[example:canvas_morphtargets_horse morphtargets / horse ]<br />
[example:misc_controls_fly controls / fly ]<br />
......@@ -58,62 +54,58 @@
</code>
<h2>Constructor</h2>
<h2>构造器</h2>
<h3>[name]( [param:Integer color], [param:Float intensity] )</h3>
<p>
[page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).<br />
[page:Float intensity] - (optional) numeric value of the light's strength/intensity. Default is 1.<br /><br />
[page:Integer color] - (可选参数) 16进制表示光的颜色。 缺省值为 0xffffff (白色)。<br />
[page:Float intensity] - (可选参数) 光照的强度。缺省值为1。<br /><br />
Creates a new [name].
创建一个新的 [name]。
</p>
<h2>Properties</h2>
<h2>属性</h2>
See the base [page:Light Light] class for common properties.
公共属性请查看基类 [page:Light Light]。
<h3>[property:Boolean castShadow]</h3>
<p>
If set to *true* light will cast dynamic shadows. *Warning*: This is expensive and
requires tweaking to get shadows looking right. See the [page:DirectionalLightShadow] for details.
The default is *false*.
如果设置为 *true* 该平行光会产生动态阴影。 警告: 这样做的代价比较高而且需要一直调整到阴影看起来正确.
查看 [page:DirectionalLightShadow] 了解详细信息。该属性默认为 *false*。
</p>
<h3>[property:Boolean isDirectionalLight]</h3>
<p>
Used to check whether this or derived classes are directional lights. Default is *true*.<br /><br />
用来校验这个类或者派生类是不是平行光.默认是 *true*。<br /><br />
You should not change this, as it is used internally for optimisation.
不应该去改变这个变量,因为内部使用这个变量做了些优化的工作。
</p>
<h3>[property:Vector3 position]</h3>
<p>
This is set equal to [page:Object3D.DefaultUp] (0, 1, 0), so that the light shines from the top down.
假如这个值设置等于 [page:Object3D.DefaultUp] (0, 1, 0),那么光线将会从上往下照射。
</p>
<h3>[property:DirectionalLightShadow shadow]</h3>
<p>
A [page:DirectionalLightShadow] used to calculate shadows for this light.
这个 [page:DirectionalLightShadow] 对象用来计算该平行光产生的阴影。
</p>
<h3>[property:Object3D target]</h3>
<p>
The DirectionalLight points from its [page:.position position] to target.position. The default
position of the target is *(0, 0, 0)*.<br />
平行光的方向是从它的位置到目标位置。默认的目标位置为原点 *(0,0,0)*。<br />
*Note*: For the target's position to be changed to anything other than the default,
it must be added to the [page:Scene scene] using
注意: 对于目标的位置,要将其更改为除缺省值之外的任何位置,它必须被添加到 [page:Scene scene]
场景中去。
</p>
<code>
scene.add( light.target );
</code>
<p>
This is so that the target's [page:Object3D.matrixWorld matrixWorld] gets automatically
updated each frame.<br /><br />
It is also possible to set the target to be another object in the scene (anything with a
[page:Object3D.position position] property), like so:
这使得属性target中的 [page:Object3D.matrixWorld matrixWorld] 会每帧自动更新。
<br /><br />
它也可以设置target为场景中的其他对象(任意拥有 [page:Object3D.position position] 属性的对象), 示例如下:
</p>
<code>
var targetObject = new THREE.Object3D();
......@@ -122,21 +114,20 @@
light.target = targetObject;
</code>
<p>
The directionalLight will now track the target object.
完成上述操作后,平行光现在就可以追踪到目标对像了。
</p>
<h2>Methods</h2>
<h2>方法</h2>
See the base [page:Light Light] class for common methods.
公共方法请查看基类 [page:Light Light]。
<h3>[method:DirectionalLight copy]( [param:DirectionalLight source] )</h3>
<p>
Copies value of all the properties from the [page:DirectionalLight source] to this
DirectionalLight.
复制 source 的值到这个平行光源对象。
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -10,16 +10,16 @@
<body>
[page:Object3D] &rarr; [page:Light] &rarr;
<h1>[name]</h1>
<h1>半球光([name])</h1>
<p class="desc">
A light source positioned directly above the scene, with color fading from the
sky color to the ground color. <br /><br />
光源直接放置于场景之上,光照颜色从天空光线颜色颜色渐变到地面光线颜色。
<br /><br />
This light cannot be used to cast shadows.
半球光不能投射阴影。
</p>
<h2>Example</h2>
<h2>示例</h2>
<div>
[example:webgl_lights_hemisphere lights / hemisphere ]<br />
......@@ -35,64 +35,64 @@ var light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );
scene.add( light );
</code>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Integer skyColor], [param:Integer groundColor], [param:Float intensity] )</h3>
<p>
[page:Integer skyColor] - (optional) hexadecimal color of the sky. Default is 0xffffff.<br />
[page:Integer groundColor] - (optional) hexadecimal color of the ground. Default is 0xffffff.<br />
[page:Float intensity] - (optional) numeric value of the light's strength/intensity. Default is 1.<br /><br />
[page:Integer skyColor] - (可选参数) 天空中发出光线的颜色。 缺省值 0xffffff。<br />
[page:Integer groundColor] - (可选参数) 地面发出光线的颜色。 缺省值 0xffffff。<br />
[page:Float intensity] - (可选参数) 光照强度。 缺省值 1。<br /><br />
Creates a new [name].
创建一个半球光。
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<p>
See the base [page:Light Light] class for common properties.
公共属性请查看基类[page:Light Light]。
</p>
<h3>[property:Boolean castShadow]</h3>
<p>
This is set to *undefined* in the constructor as hemisphere lights cannot cast shadows.
该参数在构造时被设置为 *undefined* 因为半球光不能投射阴影。
</p>
<h3>[property:Float color]</h3>
<p>
The light's sky color, as passed in the constructor.
Default is a new [page:Color] set to white (0xffffff).
在构造时传递的天空发出光线的颜色。
默认会创建 [page:Color] 并设置为白色(0xffffff)。
</p>
<h3>[property:Float groundColor]</h3>
<p>
The light's ground color, as passed in the constructor.
Default is a new [page:Color] set to white (0xffffff).
在构造时传递的地面发出光线的颜色。
默认会创建 [page:Color] 并设置为白色(0xffffff)。
</p>
<h3>[property:Boolean isHemisphereLight]</h3>
<p>
Used to check whether this or derived classes are hemisphere lights. Default is *true*.<br /><br />
用来校验这个类或者派生类是不是半球光。缺省值为 *true*。<br /><br />
You should not change this, as it used internally for optimisation.
不应该去改变这个变量,因为内部使用这个变量做了些优化的工作。
</p>
<h3>[property:Vector3 position]</h3>
<p>
This is set equal to [page:Object3D.DefaultUp] (0, 1, 0), so that the light shines from the top down.
假如这个值设置等于 [page:Object3D.DefaultUp] (0, 1, 0),那么光线将会从上往下照射。
</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
See the base [page:Light Light] class for common methods.
公共方法请查看基类 [page:Light Light]。
<h3>[method:HemisphereLight copy]( [param:HemisphereLight source] )</h3>
<p>
Copies the value of [page:.color color], [page:.intensity intensity] and
[page:.groundColor groundColor] from the [page:Light source] light into this one.
从[page:Light source]复制 [page:.color color], [page:.intensity intensity] 和
[page:.groundColor groundColor] 的值到当前半球光对象中。
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -13,66 +13,66 @@
<h1>[name]</h1>
<p class="desc">
Abstract base class for lights - all other light types inherit the properties and methods
described here.
光源的基类 - 所有其他的光类型都继承了该类描述的属性和方法。
</p>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Integer color], [param:float intensity] )</h3>
<p>
[page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).<br />
[page:Float intensity] - (optional) numeric value of the light's strength/intensity. Default is 1.<br /><br />
[page:Integer color] - (可选参数) 16进制表示光的颜色。 缺省值 0xffffff (白色)。<br />
[page:Float intensity] - (可选参数) 光照强度。 缺省值 1。<br /><br />
Creates a new [name]. Note that this is not intended to be called directly (use one of derived classes instead).
创造一个新的光源。注意,这并不是直接调用的(而是使用派生类之一)。
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<p>
See the base [page:Object3D Object3D] class for common properties.
公共属性请查看基类[page:Object3D Object3D]。
</p>
<h3>[property:Color color]</h3>
<p>
Color of the light. Defaults to a new [page:Color] set to white, if not passed in the constructor.<br />
光源的颜色。如果构造的时候没有传递,默认会创建一个新的 [page:Color] 并设置为白色。
</p>
<h3>[property:Float intensity]</h3>
<p>
The light's intensity, or strength.<br />
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the product of
[page:.color color] * intensity is interpreted as luminous intensity measured in candela.<br />
Default - *1.0*.
光照的强度,或者说能量。
在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式下, [page:.color color] 和强度
的乘积被解析为以坎德拉(candela)为单位的发光强度。
默认值 - *1.0*
<br />
</p>
<h3>[property:Boolean isLight]</h3>
<p>
Used to check whether this or derived classes are lights. Default is *true*.<br /><br />
用来校验这个类或者派生类是不是平行光。默认是 *true*。<br /><br />
You should not change this, as it used internally for optimisation.
不应该去改变这个变量,因为内部使用这个变量做了些优化的工作。
</p>
<h2>Methods</h2>
<p>
See the base [page:Object3D Object3D] class for common methods.
公共方法请查看基类 [page:Object3D Object3D]。
</p>
<h3>[method:Light copy]( [param:Light source] )</h3>
<p>
Copies the value of [page:.color color] and [page:.intensity intensity] from the
[page:Light source] light into this one.
从[page:Light source]复制 [page:.color color], [page:.intensity intensity]
的值到当前光源对象中。
</p>
<h3>[method:JSON toJSON]( [param:String meta] )</h3>
<p>
Return Light data in JSON format.
以JSON格式返回光数据。
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -10,17 +10,16 @@
<body>
[page:Object3D] &rarr; [page:Light] &rarr;
<h1>[name]</h1>
<h1>点光源([name])</h1>
<p class="desc">
A light that gets emitted from a single point in all directions. A common use case for this
is to replicate the light emitted from a bare lightbulb.<br /><br />
This light can cast shadows - see [page:LightShadow] page for details.
从一个点向各个方向发射的光源。一个常见的例子是模拟一个灯泡发出的光。
<br /><br />
该光源可以投射阴影 - 跳转至 [page:LightShadow] 查看更多细节。
</p>
<h2>Example</h2>
<h2>示例</h2>
<p>
[example:canvas_lights_pointlights lights / pointlights ]<br />
......@@ -39,77 +38,76 @@ scene.add( light );
</code>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Integer color], [param:Float intensity], [param:Number distance], [param:Float decay] )</h3>
<p>
[page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).<br />
[page:Float intensity] - (optional) numeric value of the light's strength/intensity. Default is 1.<br /><br />
[page:Number distance] - The distance from the light where the intensity is 0.
When set to 0, then the light never stops. Default is 0.<br />
[page:Float decay] - The amount the light dims along the distance of the light. Default is 1.
For [page:WebGLRenderer.physicallyCorrectLights physically correct] lighting, set this to 2.<br /><br />
Creates a new [name].
[page:Integer color] - (可选参数)) 十六进制光照颜色。 缺省值 0xffffff (白色)。<br />
[page:Float intensity] - (可选参数) 光照强度。 缺省值 1。 <br /><br />
[page:Number distance] - 这个距离表示从光源到光照强度为0的位置。
当设置为0时,光永远不会消失(距离无穷大)。缺省值 0.<br />
[page:Float decay] - 沿着光照距离的衰退量。缺省值 1。
在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式中,decay = 2。<br /><br />
创建一个新的点光源(PointLight)。
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<p>
See the base [page:Light Light] class for common properties.
公共属性请查看基类[page:Light Light]。
</p>
<h3>[property:Float decay]</h3>
<p>
The amount the light dims along the distance of the light<br />
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, decay = 2 leads to physically realistic light falloff.<br/>
Default is *1*.
沿着光照距离的衰减量<br />
在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式下,decay 设置为等于2将实现现实世界的光衰减。<br/>
缺省值为 *1*。
</p>
<h3>[property:Float distance]</h3>
<p>
If non-zero, light will attenuate linearly from maximum intensity at the light's
position down to zero at this distance from the light. Default is *0.0*.
如果非零,那么光强度将会从最大值当前灯光位置处按照距离线性衰减到0。
缺省值为 *0.0*。
</p>
<h3>[property:Boolean isPointLight]</h3>
<p>
Used to check whether this or derived classes are point lights. Default is *true*.<br /><br />
用来校验这个类或者派生类是不是点光源。默认是 *true*。<br /><br />
You should not change this, as it used internally for optimisation.
不应该去改变这个变量,因为内部使用这个变量做了些优化的工作。
</p>
<h3>[property:Float power]</h3>
<p>
The light's power.<br />
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the luminous
power of the light measured in lumens. Default is *4Math.PI*. <br /><br />
This is directly related to the [page:.intensity intensity] in the ratio
<code>
光功率<br />
在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式中,
表示以"流明(光通量单位)"为单位的光功率。 缺省值 - *4Math.PI*。 <br /><br />
该值与 [page:.intensity intensity] 直接关联
<code>
power = intensity * 4&pi;
</code>
and changing this will also change the intensity.
修改该值也会导致光强度的改变。
</p>
<h3>[property:LightShadow shadow]</h3>
<p>
A [page:LightShadow] used to calculate shadows for this light.<br /><br />
The lightShadow's [page:LightShadow.camera camera]
is set to a [page:PerspectiveCamera] with [page:PerspectiveCamera.fov fov] of 90,
[page:PerspectiveCamera.aspect aspect] of 1, [page:PerspectiveCamera.near near]
clipping plane at 0.5 and [page:PerspectiveCamera.far far] clipping plane at 500.
[page:LightShadow]用与计算此光照的阴影。<br /><br />
此对象的摄像机被设置为 [page:PerspectiveCamera.fov fov] 为90度,[page:PerspectiveCamera.aspect aspect]为1
,近裁剪面 [page:PerspectiveCamera.near near] 为0,远裁剪面[page:PerspectiveCamera.far far]
为500的透视摄像机 [page:PerspectiveCamera]。
</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<p>
See the base [page:Light Light] class for common methods.
公共方法请查看基类 [page:Light Light]。
</p>
<h3>[method:PointLight copy]( [param:PointLight source] )</h3>
<p>
Copies value of all the properties from the [page:PointLight source] to this
PointLight.
将所有属性的值从源 [page:PointLight source] 复制到此点光源对象。
</p>
<h2>Source</h2>
......
......@@ -10,23 +10,22 @@
<body>
[page:Object3D] &rarr; [page:Light] &rarr;
<h1>[name]</h1>
<h1>平面光光源([name])</h1>
<p class="desc">
RectAreaLight emits light uniformly across the face a rectangular plane. This light type can be
used to simulate light sources such as bright windows or strip lighting.<br /><br />
平面光光源从一个矩形平面上均匀地发射光线。这种光源可以用来模拟像明亮的窗户或者条状灯光光源。<br /><br />
Important Notes:
注意事项:
<ul>
<li>There is no shadow support.</li>
<li>Only [page:MeshStandardMaterial MeshStandardMaterial] and [page:MeshPhysicalMaterial MeshPhysicalMaterial] are supported.</li>
<li>You have to include [link:https://threejs.org/examples/js/lights/RectAreaLightUniformsLib.js RectAreaLightUniformsLib] into your scene.</li>
<li>不支持阴影。</li>
<li>只支持 [page:MeshStandardMaterial MeshStandardMaterial] 和 [page:MeshPhysicalMaterial MeshPhysicalMaterial] 两种材质。</li>
<li>你必须在你的场景中加入 [link:https://threejs.org/examples/js/lights/RectAreaLightUniformsLib.js RectAreaLightUniformsLib] 。</li>
</ul>
</p>
<h2>Examples</h2>
<h2>示例</h2>
<p>
[example:webgl_lights_rectarealight WebGL / rectarealight ]
......@@ -47,41 +46,40 @@ scene.add( rectLightHelper );
</p>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Integer color], [param:Float intensity], [param:Float width], [param:Float height] )</h3>
<p>
[page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).<br />
[page:Float intensity] - (optional) the light's intensity, or brightness. Default is 1.<br />
[page:Float width] - (optional) width of the light. Default is 10.<br />
[page:Float height] - (optional) height of the light. Default is 10.<br /><br />
[page:Integer color] - (可选参数) 十六进制数字表示的光照颜色。缺省值为 0xffffff (白色)<br />
[page:Float intensity] - (可选参数) 光源强度/亮度 。缺省值为 1。<br />
[page:Float width] - (可选参数) 光源宽度。缺省值为 10。<br />
[page:Float height] - (可选参数) 光源高度。缺省值为 10。<br /><br />
Creates a new [name].
创建一个新的平行光。
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<p>
See the base [page:Light Light] class for common properties.
公共属性请查看基类[page:Light Light]。
</p>
<h3>[property:Boolean isRectAreaLight]</h3>
<p>
Used to check whether this or derived classes are RectAreaLights. Default is *true*.<br /><br />
用来校验这个类或者它的派生类是不是平面光光源。缺省值是 *true*。<br /><br />
You should not change this, as it used internally for optimisation.
不应该去改变这个变量,因为内部使用这个变量做了些优化的工作。
</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<p>
See the base [page:Light Light] class for common methods.
公共方法请查看基类 [page:Light Light]。
</p>
<h3>[method:RectAreaLight copy]( [param:RectAreaLight source] )</h3>
<p>
Copies value of all the properties from the [page:RectAreaLight source] to this
RectAreaLight.
将所有属性的值从源 [page:RectAreaLight source] 复制到此平面光光源对象。
</p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -10,26 +10,25 @@
<body>
[page:Object3D] &rarr; [page:Light] &rarr;
<h1>[name]</h1>
<h1>聚光灯([name])</h1>
<p class="desc">
This light gets emitted from a single point in one direction, along a cone that increases in size
the further from the light it gets. <br /><br />
聚光灯是从一个方向上的一个点发出,沿着一个圆锥体,它离光越远,它的尺寸就越大。 <br /><br />
This light can cast shadows - see the [page:SpotLightShadow] page for details.
该光源可以投射阴影 - 跳转至 [page:SpotLightShadow] 查看更多细节。
</p>
<h2>Example</h2>
<h2>示例</h2>
<iframe src='../examples/webgl_lights_spotlight.html'></iframe>
<p>
[example:webgl_lights_spotlight View in Examples ]
</p>
<h2>Other Examples</h2>
<h2>其他例子</h2>
<p>
[example:webgl_interactive_cubes_gpu interactive / cubes / gpu ]<br />
......@@ -45,7 +44,7 @@
[example:webgl_shadowmap_viewer shadowmap / viewer]
</p>
<h2>Code Example</h2>
<h2>代码示例</h2>
<code>
// white spotlight shining from the side, casting a shadow
......@@ -64,126 +63,117 @@
scene.add( spotLight );
</code>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Integer color], [param:Float intensity], [param:Float distance], [param:Radians angle], [param:Float penumbra], [param:Float decay] )</h3>
<p>
[page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).<br />
[page:Float intensity] - (optional) numeric value of the light's strength/intensity. Default is 1.<br /><br />
[page:Float distance] - Maximum distance from origin where light will shine whose intensity
is attenuated linearly based on distance from origin. <br />
[page:Radians angle] - Maximum angle of light dispersion from its direction whose upper
bound is Math.PI/2.<br />
[page:Float penumbra] - Percent of the spotlight cone that is attenuated due to penumbra.
Takes values between zero and 1. Default is zero.<br />
[page:Float decay] - The amount the light dims along the distance of the light.<br /><br />
Creates a new [name].
[page:Integer color] - (可选参数) 十六进制光照颜色。 缺省值 0xffffff (白色)。<br />
[page:Float intensity] - (可选参数) 光照强度。 缺省值 1。<br /><br />
[page:Float distance] - 从光源发出光的最大距离,其强度根据光源的距离线性衰减。 <br />
[page:Radians angle] - 光线散射角度,最大为Math.PI/2。<br />
[page:Float penumbra] - 聚光锥的半影衰减百分比。在0和1之间的值。默认为0。<br />
[page:Float decay] - 沿着光照距离的衰减量。<br /><br />
创建一个新的聚光灯。
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
See the base [page:Light Light] class for common properties.
公共属性请查看基类[page:Light Light]。
<h3>[property:Float angle]</h3>
<p>
Maximum extent of the spotlight, in radians, from its direction. Should be no more than
*Math.PI/2*. The default is *Math.PI/3*.
从聚光灯的位置以弧度表示聚光灯的最大范围。应该不超过 *Math.PI/2*。默认值为 *Math.PI/3*。
</p>
<h3>[property:Boolean castShadow]</h3>
<p>
If set to *true* light will cast dynamic shadows. *Warning*: This is expensive and
requires tweaking to get shadows looking right. See the [page:SpotLightShadow] for details.
The default is *false*.
此属性设置为 *true* 聚光灯将投射阴影。警告: 这样做的代价比较高而且需要一直调整到阴影看起来正确。
查看 [page:SpotLightShadow] 了解详细信息。
默认值为 *false*
</p>
<h3>[property:Float decay]</h3>
<p>
The amount the light dims along the distance of the light.<br />
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, decay = 2 leads to
physically realistic light falloff. The default is *1*.
沿着光照距离的衰减量<br />
在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式下,decay 设置为等于2将实现现实世界的光衰减。<br/>
缺省值为 *1*。
</p>
<h3>[property:Float distance]</h3>
<p>
If non-zero, light will attenuate linearly from maximum intensity at the light's
position down to zero at this distance from the light. Default is *0.0*.
如果非零,那么光强度将会从最大值当前灯光位置处按照距离线性衰减到0。
缺省值为 *0.0*。
</p>
<h3>[property:Boolean isSpotLight]</h3>
<p>
Used to check whether this or derived classes are spot lights. Default is *true*.<br /><br />
用来校验这个类或者它的派生类是不是聚光灯光源。缺省值是 *true*。<br /><br />
You should not change this, as it used internally for optimisation.
不应该去改变这个变量,因为内部使用这个变量做了些优化的工作。
</p>
<h3>[property:Float penumbra]</h3>
<p>
Percent of the spotlight cone that is attenuated due to penumbra. Takes values between
zero and 1. The default is *0.0*.
聚光锥的半影衰减百分比。在0和1之间的值。
默认值 — 0.0。
</p>
<h3>[property:Vector3 position]</h3>
<p>
This is set equal to [page:Object3D.DefaultUp] (0, 1, 0), so that the light shines from the top down.
假如这个值设置等于 [page:Object3D.DefaultUp] (0, 1, 0),那么光线将会从上往下照射。
</p>
<h3>[property:Float power]</h3>
<p>
The light's power.<br />
In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the luminous
power of the light measured in lumens. Default is *4Math.PI*. <br /><br />
This is directly related to the [page:.intensity intensity] in the ratio
<code>
power = intensity * &pi;
光功率<br />
在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式中,
表示以"流明(光通量单位)"为单位的光功率。 缺省值 - *4Math.PI*。 <br /><br />
该值与 [page:.intensity intensity] 直接关联
<code>
power = intensity * 4&pi;
</code>
and changing this will also change the intensity.
修改该值也会导致光强度的改变。
</p>
<h3>[property:SpotLightShadow shadow]</h3>
<p>
A [page:SpotLightShadow] used to calculate shadows for this light.
[page:SpotLightShadow]用与计算此光照的阴影。
</p>
<h3>[property:Object3D target]</h3>
<p>
The Spotlight points from its [page:.position position] to target.position. The default
position of the target is *(0, 0, 0)*.<br />
*Note*: For the target's position to be changed to anything other than the default,
it must be added to the [page:Scene scene] using
平行光的方向是从它的位置到目标位置.默认的目标位置为原点 *(0,0,0)*。<br />
注意: 对于目标的位置,要将其更改为除缺省值之外的任何位置,它必须被添加到 [page:Scene scene]
场景中去。
<code>
scene.add( light.target );
</code>
This is so that the target's [page:Object3D.matrixWorld matrixWorld] gets automatically
updated each frame.<br /><br />
这使得属性target中的 [page:Object3D.matrixWorld matrixWorld] 会每帧自动更新。<br /><br />
It is also possible to set the target to be another object in the scene (anything with a
[page:Object3D.position position] property), like so:
它也可以设置target为场景中的其他对象(任意拥有 [page:Object3D.position position] 属性的对象), 示例如下:
<code>
var targetObject = new THREE.Object3D();
scene.add(targetObject);
light.target = targetObject;
</code>
The spotlight will now track the target object.
完成上述操作后,聚光灯现在就可以追踪到目标对像了。
</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
See the base [page:Light Light] class for common methods.
公共方法请查看基类 [page:Light Light]。
<h3>[method:SpotLight copy]( [param:SpotLight source] )</h3>
<p>
Copies value of all the properties from the [page:SpotLight source] to this
SpotLight.
将所有属性的值从源 [page:SpotLight source] 复制到此聚光灯光源对象。
</p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -11,77 +11,77 @@
<h1>[name]</h1>
<p class="desc">
Class for loading [page:AnimationClip AnimationClips] in JSON format.
This uses the [page:FileLoader] internally for loading files.
以JSON格式来加载 [page:AnimationClip AnimationClips] 的一个类。
内部使用 [page:FileLoader] 来加载文件。
</p>
<h2>Example</h2>
<h2>例子</h2>
<code>
// instantiate a loader
// 初始化一个加载器
var loader = new THREE.AnimationLoader();
// load a resource
// 加载资源
loader.load(
// resource URL
// 资源URL
'animations/animation.js',
// onLoad callback
// onLoad回调
function ( animations ) {
// animations is an array of AnimationClips
// animations时一个AnimationClips组数
},
// onProgress callback
// onProgress回调
function ( xhr ) {
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
// onError callback
// onError回调
function ( err ) {
console.log( 'An error happened' );
}
);
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:LoadingManager manager] )</h3>
<p>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br /><br />
[page:LoadingManager manager] — 加载器所使用的[page:LoadingManager loadingManager]。 默认为[page:LoadingManager THREE.DefaultLoadingManager].<br /><br />
Creates a new [name].
创建一个新的[name].
</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:LoadingManager manager]</h3>
<p>
The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager].
加载器正在使用的[page:LoadingManager loadingManager]。默认为[page:DefaultLoadingManager].
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
<p>
[page:String url] — the path or URL to the file. This can also be a
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Animation animation].<br />
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
[page:Function onError] — Will be called if load errors.<br /><br />
[page:Function onLoad] — 加载完成时将调用。回调参数为将要加载的[page:Animation animation].<br />
[page:Function onProgress] — 将在加载过程中进行调用。参数为XMLHttpRequest实例,实例包含[page:Integer total]和[page:Integer loaded]字节。<br />
[page:Function onError] — 在加载错误时被调用。<br /><br />
Begin loading from url and pass the loaded animation to onLoad.
从URL中进行加载并将动画传递给onLoad。
</p>
<h3>[method:null parse]( [param:JSON json], [param:Function onLoad] )</h3>
<p>
[page:JSON json] — required<br />
[page:Function onLoad] — Will be called when parsing completes. <br /><br />
[page:JSON json] — 请求<br />
[page:Function onLoad] — 当解析完成时,将被调用 <br /><br />
Parse the JSON object and pass the result to onLoad. Individual clips in the object will
be parsed with [page:AnimationClip.parse].
解析JSON对象并将结果传递给onLoad。对象中的单个片段将
用[page [page:AnimationClip.parse]进行解析。
</p>
<h2>Source</h2>
<h2></h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -11,88 +11,88 @@
<h1>[name]</h1>
<p class="desc">
Class for loading an
[link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer AudioBuffer].
This uses the [page:FileLoader] internally for loading files.
用来加载
[link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer AudioBuffer]的一个类。
内部默认使用[page:FileLoader]来加载文件。
</p>
<h2>Example</h2>
<h2>例子</h2>
<code>
// instantiate a listener
// 初始化一个监听
var audioListener = new THREE.AudioListener();
// add the listener to the camera
// 把监听添加到camera
camera.add( audioListener );
// instantiate audio object
// 初始化音频对象
var oceanAmbientSound = new THREE.Audio( audioListener );
// add the audio object to the scene
// 添加一个音频对象到场景中
scene.add( oceanAmbientSound );
// instantiate a loader
// 初始化一个加载器
var loader = new THREE.AudioLoader();
// load a resource
// 加载资源
loader.load(
// resource URL
// 资源URL
'audio/ambient_ocean.ogg',
// onLoad callback
// onLoad回调
function ( audioBuffer ) {
// set the audio object buffer to the loaded object
// 给一个加载器对象设置音频对象的缓存
oceanAmbientSound.setBuffer( audioBuffer );
// play the audio
// 播放音频
oceanAmbientSound.play();
},
// onProgress callback
// onProgress回调
function ( xhr ) {
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
// onError callback
// onError回调
function ( err ) {
console.log( 'An error happened' );
}
);
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:String context], [param:LoadingManager manager] )</h3>
<p>
[page:String context] — The [page:String AudioContext] for the loader to use. Default is [page:String window.AudioContext].<br />
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br /><br />
[page:String context] — 加载器使用的[page:String AudioContext]。 默认为[page:String window.AudioContext].<br />
[page:LoadingManager manager] — 加载器使用的[page:LoadingManager loadingManager]。默认为[page:LoadingManager THREE.DefaultLoadingManager].<br /><br />
Creates a new [name].
创建一个新的[name].
</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:LoadingManager manager]</h3>
<p>
The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager].
加载器正在使用的[page:LoadingManager loadingManager]。默认为[page:DefaultLoadingManager].
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
<p>
[page:String url] — the path or URL to the file. This can also be a
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.<br />
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
[page:Function onError] — Will be called when load errors.<br />
[page:Function onLoad] — 加载完成时将调用。回调参数为将要加载的响应文本。<br />
[page:Function onProgress] — 将在加载过程中进行调用。参数为XMLHttpRequest实例,实例包含[page:Integer total]和[page:Integer loaded]字节.<br />
[page:Function onError] — 在加载错误时被调用。<br />
</p>
<p>
Begin loading from url and pass the loaded [page:String AudioBuffer] to onLoad.
从URL中进行加载并将已经加载的[page:String AudioBuffer]传递给onLoad。
</p>
<h2>Source</h2>
<h2></h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -11,81 +11,81 @@
<h1>[name]</h1>
<p class="desc">
A loader for loading a [page:BufferGeometry].
This uses the [page:FileLoader] internally for loading files.
用来加载[page:BufferGeometry]的加载器。
内部使用[page:FileLoader]来加载文件。
</p>
<h2>Example</h2>
<h2>例子</h2>
[example:webgl_geometry_colors_lookuptable WebGL / geometry / colors / lookuptable]
<code>
// instantiate a loader
// 初始化一个加载器
var loader = new THREE.BufferGeometryLoader();
// load a resource
// 加载资源
loader.load(
// resource URL
// 资源URL
'models/json/pressure.json',
// onLoad callback
// onLoad回调
function ( geometry ) {
var material = new THREE.MeshLambertMaterial( { color: 0xF5F5F5 } );
var object = new THREE.Mesh( geometry, material );
scene.add( object );
},
// onProgress callback
// onProgress回调
function ( xhr ) {
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
// onError callback
// onError回调
function ( err ) {
console.log( 'An error happened' );
}
);
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:LoadingManager manager] )</h3>
<p>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
[page:LoadingManager manager] — 加载器所使用的[page:LoadingManager loadingManager]。默认为[page:LoadingManager THREE.DefaultLoadingManager].
</p>
<p>
Creates a new [name].
创建一个新的[name].
</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:LoadingManager manager]</h3>
<p>
The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager].
正在使用的[page:LoadingManager loadingManager]。默认为[page:DefaultLoadingManager].
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
<p>
[page:String url] — the path or URL to the file. This can also be a
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].d<br />
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:BufferGeometry].<br />
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
[page:Function onError] — Will be called when load errors.<br />
[page:Function onLoad] — 加载完成时将调用。回调参数为将要加载的[page:BufferGeometry].<br />
[page:Function onProgress] — 将在加载过程中进行调用。参数为XMLHttpRequest实例,实例包含[page:Integer total]和[page:Integer loaded]字节。<br />
[page:Function onError] —在加载错误时被调用。<br />
</p>
<p>
Begin loading from url and call onLoad with the parsed response content.
从URL中进行加载,并将已经以解析的响应内容传递给onLoad。
</p>
<h3>[method:BufferGeometry parse]( [param:Object json] )</h3>
<p>
[page:Object json] — The <em>JSON</em> structure to parse.<br /><br />
Parse a <em>JSON</em> structure and return a [page:BufferGeometry].
[page:Object json] — 所需要解析的<em>JSON</em>结构。<br /><br />
解析一个<em>JSON</em>结构,并返回[page:BufferGeometry].
</p>
<h2>Source</h2>
<h2></h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -11,10 +11,10 @@
<h1>[name]</h1>
<p class="desc">
A simple caching system, used internally by [page:FileLoader].
一个简单的缓存系统,内部使用[page:FileLoader]。
</p>
<h2>Examples</h2>
<h2>例子</h2>
<p>
[example:webgl_geometry_text WebGL / geometry / text ]<br />
......@@ -24,51 +24,51 @@
<h2>Usage</h2>
<p>To enable caching across all loaders that use [page:FileLoader], set</p>
<p>
要在所有使用[page:FileLoader]的加载器上启用缓存, 需设置</p>
<code>
THREE.Cache.enabled = true.
</code>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:Boolean enabled]</h3>
<p>Whether caching is enabled. Default is *false*.</p>
<p>是否启用缓存,默认为*false*.</p>
<h3>[property:Object files]</h3>
<p>An [page:Object object] that holds cached files.</p>
<p>一个[page:Object object]所持有的缓存文件。</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:null add]( [param:String key], file )</h3>
<p>
[page:String key] — the [page:String key] to reference the cached file by.<br />
[page:Object file] — The file to be cached.<br /><br />
[page:String key] — 通过引用缓存文件的[page:String key]。<br />
[page:Object file] — 所被缓存的文件<br /><br />
Adds a cache entry with a key to reference the file. If this key already holds a file,
it is overwritten.
使用key为引用文件增加一个缓存入口。如果该key已持有一个文件,则会被覆盖。
</p>
<h3>[method:null get]( [param:String key] )</h3>
<p>
[page:String key] — A string key <br /><br />
[page:String key] — 一个字符串key <br /><br />
Get the value of [page:String key]. If the key does not exist *undefined* is returned.
获得该[page:String key]的值。 如果该key不存在,则以*undefined*被返回。
</p>
<h3>[method:null remove]( [param:String key] )</h3>
<p>
[page:String key] — A string key that references a cached file.<br /><br />
[page:String key] — 引用缓存文件的一个字符串key<br /><br />
Remove the cached file associated with the key.
使用key来删除相应的缓存文件。
</p>
<h3>[method:null clear]()</h3>
<p>Remove all values from the cache.</p>
<p>清除所有缓存中的值。</p>
<h2>Source</h2>
<h2></h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -11,62 +11,61 @@
<h1>[name]</h1>
<p class="desc">
Abstract base class for block based textures loader (dds, pvr, ...).
This uses the [page:FileLoader] internally for loading files.
基于块的纹理加载器 (dds, pvr, ...)的抽象类。
内部使用[page:FileLoader]来加载文件。
</p>
<h2>Examples</h2>
<h2>例子</h2>
<p>
See the [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/DDSLoader.js DDSLoader]
and [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/PVRLoader.js PVRLoader]
for examples of derived classes.
请参考[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/DDSLoader.js DDSLoader]
[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/PVRLoader.js PVRLoader]
子类的例子
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:LoadingManager manager] )</h3>
<p>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use.
Default is [page:LoadingManager THREE.DefaultLoadingManager].<br /><br />
[page:LoadingManager manager] — 加载器使用的[page:LoadingManager loadingManager]。
默认为[page:LoadingManager THREE.DefaultLoadingManager].<br /><br />
Creates a new [name].
创建一个新的[name].
</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:LoadingManager manager]</h3>
<p>
The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager].
加载器正在使用的[page:LoadingManager loadingManager]。默认为[page:DefaultLoadingManager]。
</p>
<h3>[property:String path]</h3>
<p>The base path from which files will be loaded. See [page:.setPath]. Default is *undefined*.</p>
<p>加载的基本路径。请参考[page:.setPath]。默认为*undefined*.</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
<p>
[page:String url] — the path or URL to the file. This can also be a
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded texture.<br />
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
[page:Function onError] — Will be called when load errors.<br />
[page:Function onLoad] — 加载完成时将调用。回调参数为将要加载的纹理。<br />
[page:Function onProgress] — 将在加载过程中进行调用。参数为XMLHttpRequest实例,实例包含[page:Integer total]和[page:Integer loaded]字节。<br />
[page:Function onError] — 在加载错误时被调用。<br />
</p>
<p>
Begin loading from url and pass the loaded texture to onLoad.
从URL中进行加载,并将被加载的纹理传递给onLoad。
</p>
<h3>[method:FileLoader setPath]( [param:String path] )</h3>
<p>
Set the base path or URL from which to load files. This can be useful if
you are loading many textures from the same directory.
设置加载文件的基本路径或URL。当加载同一目录中的许多模型,此方法将很有用。
</p>
<h2>Source</h2>
<h2></h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -19,6 +19,7 @@
<h3>[name]( [param:Integer color], [param:Float near], [param:Float far] )</h3>
<p>颜色参数传入[page:Color]构造函数中,来设置颜色属性。颜色可以是一个十六进制的整型数,或者是CSS风格的字符串。</p>
<h2>属性</h2>
<h3>[property:String name]</h3>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册