提交 da040d67 编写于 作者: J Ji,Chang

翻译math部分,还未校验

上级 694764d5
......@@ -11,291 +11,278 @@
<h1>[name]</h1>
<p class="desc">
Represents a box or cube in 3D space. The main purpose of this is to represent
the [link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Boxes]
for objects.
在3D空间中表示一个盒子或立方体。这个的主要目的是表示对象的最小边界框[link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Boxes]。
</p>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Vector3 min], [param:Vector3 max] )</h3>
<p>
[page:Vector3 min] - (optional) [page:Vector3] representing the lower (x, y, z) boundary of the box.
Default is ( + Infinity, + Infinity, + Infinity ).<br>
[page:Vector3 min] - (参数可选) [page:Vector3] 表示包围盒的下边界。
默认值是( + Infinity, + Infinity, + Infinity )。<br>
[page:Vector3 max] - (optional) [page:Vector3] representing the lower upper (x, y, z) boundary of the box.
Default is ( - Infinity, - Infinity, - Infinity ).<br /><br />
[page:Vector3 max] - (参数可选) [page:Vector3] 表示包围盒的上边界。
默认值是( - Infinity, - Infinity, - Infinity )。<br /><br />
Creates a [name] bounded by min and max.
创建一个以max和min为边界的包围盒。
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Boolean isBox3]</h3>
<p>
Used to check whether this or derived classes are Box3s. Default is *true*.<br /><br />
You should not change this, as it used internally for optimisation.
用于检测当前对象或者派生类对象是否是Box3。默认为 *true*。<br /><br />
不应该修改这个值,因为内部使用该属性做了优化的任务。
</p>
<h3>[property:Vector3 min]</h3>
<p>
[page:Vector3] representing the lower (x, y, z) boundary of the box.<br />
Default is ( + Infinity, + Infinity, + Infinity ).
[page:Vector3] 表示包围盒的下边界。<br />
默认值是( - Infinity, - Infinity, - Infinity )。
</p>
<h3>[property:Vector3 max]</h3>
<p>
[page:Vector3] representing the upper (x, y, z) boundary of the box.<br />
Default is ( - Infinity, - Infinity, - Infinity ).
[page:Vector3] 包围盒的(x, y, z)上边界。<br />
默认值是 ( - Infinity, - Infinity, - Infinity ).
</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<h3>[method:Box3 applyMatrix4]( [param:Matrix4 matrix] )</h3>
<p>
[page:Matrix4 matrix] - The [page:Matrix4] to apply<br /><br />
Transforms this Box3 with the supplied matrix.
[page:Matrix4 matrix] - 要应用的 [page:Matrix4] <br /><br />
使用传入的矩阵变换Box3(包围盒8个顶点都会乘以这个变换矩阵)。
</p>
<h3>[method:Vector3 clampPoint]( [param:Vector3 point], [param:Vector3 target] )</h3>
<p>
[page:Vector3 point] - [page:Vector3] to clamp. <br>
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 point] - 需要做clamp 的坐标 [page:Vector3]。 <br>
[page:Vector3 target] — 结果将会被拷贝到这个对象中<br /><br />
[link:https://en.wikipedia.org/wiki/Clamping_(graphics) Clamps] the [page:Vector3 point] within the bounds of this box.<br />
是这个点[page:Vector3 point] [link:https://en.wikipedia.org/wiki/Clamping_(graphics) Clamps](处于范围内) 处于包围盒边界范围内。<br />
</p>
<h3>[method:Box3 clone]()</h3>
<p>Returns a new [page:Box3] with the same [page:.min min] and [page:.max max] as this one.</p>
<p>返回一个与该包围盒子有相同下边界[page:.min min] 和上边界 [page:.max max]的新包围盒。</p>
<h3>[method:Boolean containsBox]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - [page:Box3 Box3] to test for inclusion.<br /><br />
Returns true if this box includes the entirety of [page:Box3 box]. If this and [page:Box3 box] are identical, <br>
this function also returns true.
[page:Box3 box] - 需要检测是否在当前包围盒内的 [page:Box3 Box3]。<br /><br />
传入的 [page:Box3 box] 整体都被包含在该对象中则返回true。如果他们两个包围盒是一样的也返回true。
</p>
<h3>[method:Boolean containsPoint]( [param:Vector3 point] )</h3>
<p>
[page:Vector3 point] - [page:Vector3] to check for inclusion.<br /><br />
[page:Vector3 point] - 需要检测是否在当前包围盒内的 [page:Vector3]。<br /><br />
Returns true if the specified [page:Vector3 point] lies within or on the boundaries of this box.
当传入的值 [page:Vector3 point] 在包围盒内部或者边界都会返回true。
</p>
<h3>[method:Box3 copy]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - [page:Box3] to copy.<br /><br />
[page:Box3 box] - 需要复制的包围盒 [page:Box3] 。<br /><br />
Copies the [page:.min min] and [page:.max max] from [page:Box3 box] to this box.
将传入的值 [page:Box3 box] 中的 [page:.min min] 和 [page:.max max] 拷贝到当前对象。
</p>
<h3>[method:Float distanceToPoint]( [param:Vector3 point] )</h3>
<p>
[page:Vector3 point] - [page:Vector3] to measure distance to.<br /><br />
[page:Vector3 point] - 用来测试距离的点 [page:Vector3]。<br /><br />
Returns the distance from any edge of this box to the specified point.
If the [page:Vector3 point] lies inside of this box, the distance will be 0.
返回这个box的任何边缘到指定点的距离。如果这个点位于这个盒子里,距离将是0。
</p>
<h3>[method:Boolean equals]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - Box to compare with this one.<br /><br />
[page:Box3 box] - 将box与当前对象做比较。<br /><br />
Returns true if this box and [page:Box3 box] share the same lower and upper bounds.
返回true如果传入的值与当前的对象 [page:Box3 box] 有相同的上下边界。
</p>
<h3>[method:Box3 expandByObject]( [param:Object3D object] )</h3>
<p>
[page:Object3D object] - [page:Object3D] to expand the box by.<br /><br />
[page:Object3D object] - 包裹在包围盒中的3d对象 [page:Object3D]。<br /><br />
Expands the boundaries of this box to include [page:Object3D object] and its children,
accounting for the object's, and children's, world transforms.
扩展此包围盒的边界,使得对象及其子对象在包围盒内,包括对象和子对象的世界坐标的变换。
</p>
<h3>[method:Box3 expandByPoint]( [param:Vector3 point] )</h3>
<p>
[page:Vector3 point] - [page:Vector3] that should be included in the box.<br /><br />
[page:Vector3 point] - 需要在包围盒中的点 [page:Vector3]。<br /><br />
Expands the boundaries of this box to include [page:Vector3 point].
扩展这个包围盒的边界使得该点([page:Vector3 point])在包围盒内。
</p>
<h3>[method:Box3 expandByScalar]( [param:float scalar] )</h3>
<p>
[page:float scalar] - Distance to expand the box by.<br /><br />
[page:float scalar] - 扩展包围盒的比例。<br /><br />
Expands each dimension of the box by [page:float scalar]. If negative, the dimensions of the box
will be contracted.
按 [page:float scalar] 的值展开盒子的每个维度。如果是负数,盒子的尺寸会缩小。
</p>
<h3>[method:Box3 expandByVector]( [param:Vector3 vector] )</h3>
<p>
[page:Vector3 vector] - [page:Vector3] to expand the box by.<br /><br />
[page:Vector3 vector] - 扩展包围盒的数值 [page:Vector3] 。<br /><br />
按 [page:Vector3 vector] 每个纬度的值展开这个箱子。
这个盒子的宽度将由 [page:Vector3 vector] 的x分量在两个方向上展开。
这个盒子的高度将由 [page:Vector3 vector] 两个方向上的y分量展开。
这个盒子的深度将由 [page:Vector3 vector] z分量在两个方向上展开。
Expands this box equilaterally by [page:Vector3 vector]. The width of this box will be
expanded by the x component of [page:Vector3 vector] in both directions. The height of
this box will be expanded by the y component of [page:Vector3 vector] in both directions.
The depth of this box will be expanded by the z component of *vector* in both directions.
</p>
<h3>[method:Sphere getBoundingSphere]( [param:Sphere target] )</h3>
<p>
[page:Sphere target] — the result will be copied into this Sphere.<br /><br />
[page:Sphere target] — 如果指定了target ,结果将会被拷贝到target。<br /><br />
Gets a [page:Sphere] that bounds the box.
获取一个包围球 [page:Sphere]。
</p>
<h3>[method:Vector3 getCenter]( [param:Vector3 target] )</h3>
<p>
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 target] — 如果指定了target ,结果将会被拷贝到target。<br /><br />
Returns the center point of the box as a [page:Vector3].
返回包围盒的中心点 [page:Vector3]。
</p>
<h3>[method:Vector3 getParameter]( [param:Vector3 point], [param:Vector3 target] ) </h3>
<p>
[page:Vector3 point] - [page:Vector3].<br/>
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 target] — 如果指定了target ,结果将会被拷贝到target。<br /><br />
Returns a point as a proportion of this box's width and height.
返回一个点为这个盒子的宽度和高度的比例。
</p>
<h3>[method:Vector3 getSize]( [param:Vector3 target] )</h3>
<p>
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 target] — 如果指定了target ,结果将会被拷贝到target。<br /><br />
Returns the width, height and depth of this box.
返回包围盒的宽度,高度,和深度。
</p>
<h3>[method:Box3 intersect]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - Box to intersect with.<br /><br />
[page:Box3 box] - 与包围盒的交集<br /><br />
Returns the intersection of this and [page:Box3 box], setting the upper bound of this box to the lesser
of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes'
lower bounds.
返回此包围盒和 [page:Box3 box] 的交集,将此框的上界设置为两个框的max的较小部分,
将此包围盒的下界设置为两个包围盒的min的较大部分。
</p>
<h3>[method:Boolean intersectsBox]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - Box to check for intersection against.<br /><br />
[page:Box3 box] - 用来检测是否相交的包围盒<br /><br />
Determines whether or not this box intersects [page:Box3 box].
确定当前包围盒是否与传入包围盒[page:Box3 box] 相交。
</p>
<h3>[method:Boolean intersectsPlane]( [param:Plane plane] )</h3>
<p>
[page:Plane plane] - [page:Plane] to check for intersection against.<br /><br />
[page:Plane plane] - 用来检测是否相交的 [page:Plane]。<br /><br />
Determines whether or not this box intersects [page:Plane plane].
确定当前包围盒是否与平面 [page:Plane plane] 相交。
</p>
<h3>[method:Boolean intersectsSphere]( [param:Sphere sphere] )</h3>
<p>
[page:Sphere sphere] - [page:Sphere] to check for intersection against.<br /><br />
[page:Sphere sphere] - 用来检测是否相交的球体 [page:Sphere]。<br /><br />
Determines whether or not this box intersects [page:Sphere sphere].
确定当前包围盒是否与球体 [page:Sphere sphere] 相交。
</p>
<h3>[method:Boolean intersectsTriangle]( [param:Triangle triangle] )</h3>
<p>
[page:Triangle triangle] - [page:Triangle] to check for intersection against.<br /><br />
[page:Triangle triangle] - 用来检测是否相交的三角形 [page:Triangle]。<br /><br />
Determines whether or not this box intersects [page:Triangle triangle].
确定当前包围盒是否与三角形 [page:Triangle triangle] 相交。
</p>
<h3>[method:Boolean isEmpty]()</h3>
<p>
Returns true if this box includes zero points within its bounds.<br>
Note that a box with equal lower and upper bounds still includes one point,
the one both bounds share.
如果这个盒子包含0个顶点,则返回true。<br>
注意,下界和上界相等的方框仍然包含一个点,即两个边界共享的那个点。
</p>
<h3>[method:Box3 makeEmpty]()</h3>
<p>Makes this box empty.</p>
<p>清空包围盒。</p>
<h3>[method:Box3 set]( [param:Vector3 min], [param:Vector3 max] )</h3>
<p>
[page:Vector3 min] - [page:Vector3] representing the lower (x, y, z) boundary of the box.<br />
[page:Vector3 max] - [page:Vector3] representing the lower upper (x, y, z) boundary of the box.<br /><br />
[page:Vector3 min] - [page:Vector3] 表示下边界每个纬度(x,y,z)的值。<br />
[page:Vector3 max] - [page:Vector3] 表示上边界每个纬度(x,y,z)的值。<br /><br />
Sets the lower and upper (x, y, z) boundaries of this box.
设置包围盒上下边界每个纬度(x,y,z)的值。
</p>
<h3>[method:Box3 setFromArray]( [param:Array array] ) [param:Box3 this]</h3>
<p>
array -- An array of position data that the resulting box will envelop.<br /><br />
array -- 数组当中的所有的点都将被包围盒包裹。<br /><br />
Sets the upper and lower bounds of this box to include all of the data in *array*.
设置包围盒的上下边界使得数组 *array* 中的所有点的点都被包含在内。
</p>
<h3>[method:Box3 setFromBufferAttribute]( [param:BufferAttribute attribute] ) [param:Box3 this]</h3>
<p>
[page:BufferAttribute attribute] - A buffer attribute of position data that the resulting box will envelop.<br /><br />
[page:BufferAttribute attribute] - 位置的缓冲数据,包含在返回的包围盒内。<br /><br />
Sets the upper and lower bounds of this box to include all of the data in [page:BufferAttribute attribute].
设置此包围盒的上边界和下边界,以包含 [page:BufferAttribute attribute] 中的所有位置数据。
</p>
<h3>[method:Box3 setFromCenterAndSize]( [param:Vector3 center], [param:Vector3 size] )</h3>
<!-- <h3>[method:Box3 setFromCenterAndSize]( [param:Vector3 center], [param:Vector3 size] )</h3>
<p>
[page:Vector3 center] - Desired center position of the box ([page:Vector3]). <br>
[page:Vector3 size] - Desired x, y and z dimensions of the box ([page:Vector3]).<br /><br />
[page:Vector3 center] - 包围盒的中心位置 ([page:Vector3]). <br>
[page:Vector3 size] - 需要设置包围盒x,y,z的分量 ([page:Vector3]).<br /><br />
Centers this box on [page:Vector3 center] and sets this box's width and height to the values specified
in [page:Vector3 size].
</p>
将包围盒的中心点设为 [page:Vector3 center] ,然后将包围盒的宽高设为指定的 [page:Vector3 size]。
</p>-->
<h3>[method:Box3 setFromCenterAndSize]( [param:Vector3 center], [param:Vector3 size] ) [param:Box3 this]</h3>
<p>
[page:Vector3 center], - Desired center position of the box. <br>
[page:Vector3 size] - Desired x, y and z dimensions of the box.<br /><br />
[page:Vector3 center], - 包围盒所要设置的中心位置。 <br>
[page:Vector3 size] - 包围盒所要设置的x、y和z尺寸(宽/高/长)。<br /><br />
Centers this box on [page:Vector3 center] and sets this box's width, height and depth to the values specified <br>
in [page:Vector3 size]
将当前包围盒的中心点设置为 [page:Vector3 center] ,并将此包围盒的宽度,高度和深度设置为大小指定 [page:Vector3 size] 的值。
</p>
<h3>[method:Box3 setFromObject]( [param:Object3D object] )</h3>
<p>
[page:Object3D object] - [page:Object3D] to compute the bounding box of.<br /><br />
[page:Object3D object] - 用来计算包围盒的3D对象 [page:Object3D]。<br /><br />
Computes the world-axis-aligned bounding box of an [page:Object3D] (including its children),
accounting for the object's, and children's, world transforms.
计算和世界轴对齐的一个对象 [page:Object3D] (含其子对象)的包围盒,计算对象和子对象的世界坐标变换。
</p>
<h3>[method:Box3 setFromPoints]( [param:Array points] )</h3>
<p>
[page:Array points] - Array of [page:Vector3 Vector3s] that the resulting box will contain.<br /><br />
[page:Array points] - 计算出的包围盒将包含数组中所有的点 [page:Vector3 Vector3s]<br /><br />
Sets the upper and lower bounds of this box to include all of the points in [page:Array points].
设置此包围盒的上边界和下边界,以包含数组 [page:Array points] 中的所有点。
</p>
<h3>[method:Box3 translate]( [param:Vector3 offset] )</h3>
<p>
[page:Vector3 offset] - Direction and distance of offset.<br /><br />
[page:Vector3 offset] - 偏移方向和距离。<br /><br />
Adds [page:Vector3 offset] to both the upper and lower bounds of this box, effectively moving this box
[page:Vector3 offset] units in 3D space.
给包围盒的上下边界添加偏移量 [page:Vector3 offset],这样可以有效的在3D空间中移动包围盒。
偏移量为 [page:Vector3 offset] 大小。
</p>
<h3>[method:Box3 union]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - Box that will be unioned with this box.<br /><br />
[page:Box3 box] - 要结合在一起的包围盒。<br /><br />
Unions this box with [page:Box3 box], setting the upper bound of this box to the greater of the
two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes'
lower bounds.
在 [page:Box3 box] 参数的上边界和已有box对象的上边界之间取较大者,而对两者的下边界取较小者,这样获得一个新的较大的联合盒子。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -8,15 +8,15 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>颜色([name])</h1>
<p class="desc">
Class representing a color.
表示一个颜色。
</p>
<h2>Examples</h2>
A Color can be initialised in any of the following ways:
<h2>示例(Examples)</h2>
颜色可以用以下任意一种方式初始化。
<code>
//empty constructor - will default white
var color = new THREE.Color();
......@@ -41,25 +41,25 @@ var color = new THREE.Color( 1, 0, 0 );
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Color_Hex_or_String r], [param:Float g], [param:Float b] )</h3>
<p>
[page:Color_Hex_or_String r] - (optional) If arguments [page:Float g] and [page:Float b] are defined, the red component of the color.
If they are not defined, it can be a [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] (recommended), a CSS-style string, or another Color instance.<br />
[page:Float g] - (optional) If it is defined, the green component of the color.<br />
[page:Float b] - (optional) If it is defined, the blue component of the color.<br /><br />
[page:Color_Hex_or_String r] - (可选参数) 如果参数g和b被定义,则r表示颜色中的红色分量。
如果未被定义,r可以是一个十六进制 [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] 颜色值或CSS样式的字符串或一个Color实例。<br />
[page:Float g] - (可选参数) 如果被定义,表示颜色中的绿色分量。<br />
[page:Float b] - (可选参数) 如果被定义,表示颜色中的蓝色分量。<br /><br />
Note that standard method of specifying color in three.js is with a [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet], and that method is used
throughout the rest of the documentation.<br /><br />
注意使用十六进制 [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] 定义一个颜色在three.js中是标准的方法,而且其余
文档也将会使用这个方法。<br /><br />
When all arguments are defined then [page:Color_Hex_or_String r] is the red component, [page:Float g] is the green component and [page:Float b] is the blue component of the color.<br />
When only [page:Color_Hex_or_String r] is defined:<br />
当所有参数被定义时,r是红色分量,g是绿色分量,b是蓝色分量。<br />
当只有 [page:Color_Hex_or_String r] 被定义时:<br />
<ul>
<li>It can be a [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] representing the color (recommended).</li>
<li>It can be an another Color instance.</li>
<li>It can be a CSS-style string. For example:
<li>它可用一个十六进制 [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] 值表示颜色(推荐)。</li>
<li>它可以是一个另一个颜色实例。</li>
<li>它可以是另外一个CSS样式。例如:
<ul>
<li>'rgb(250, 0,0)'</li>
<li>'rgb(100%,0%,0%)'</li>
......@@ -73,28 +73,28 @@ var color = new THREE.Color( 1, 0, 0 );
</ul>
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Boolean isColor]</h3>
<p>
Used to check whether this or derived classes are Colors. Default is *true*.<br /><br />
用来检测此类或者派生类是否为颜色。默认值是 *true*。<br /><br />
You should not change this, as it used internally for optimisation.
不应该去改变这个值,因为它在内部用于优化。
</p>
<h3>[property:Float r]</h3>
<p>
Red channel value between 0 and 1. Default is 1.
红色通道的值在0到1之间。默认值为1。
</p>
<h3>[property:Float g]</h3>
<p>
Green channel value between 0 and 1. Default is 1.
绿色通道的值在0到1之间。默认值为1。
</p>
<h3>[property:Float b]</h3>
<p>
Blue channel value between 0 and 1. Default is 1.
蓝色通道的值在0到1之间。默认值为1。
</p>
......@@ -102,102 +102,99 @@ var color = new THREE.Color( 1, 0, 0 );
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<h3>[method:Color add]( [param:Color color] ) </h3>
<p>Adds the RGB values of [page:Color color] to the RGB values of this color.</p>
<p>将给定颜色的RGB值添加到此颜色的RGB值。</p>
<h3>[method:Color addColors]( [param:Color color1], [param:Color color2] ) </h3>
<p>Sets this color's RGB values to the sum of the RGB values of [page:Color color1] and [page:Color color2].</p>
<p>将此颜色的RGB值设置为 [page:Color color1] 和 [page:Color color2] 的RGB值之和。</p>
<h3>[method:Color addScalar]( [param:Number s] ) </h3>
<p>Adds [page:Number s] to the RGB values of this color.</p>
<p>给现有的RGB值都加上 [page:Number s] 。</p>
<h3>[method:Color clone]() </h3>
<p>Returns a new Color with the same [page:.r r], [page:.g g] and [page:.b b] values as this one.</p>
<p>返回一个与当前颜色的 [page:.r r], [page:.g g] 和 [page:.b b] 相同的颜色。</p>
<h3>[method:Color copy]( [param:Color color] ) </h3>
<p>
Copies the [page:.r r], [page:.g g] and [page:.b b] parameters from [page:Color color] in to this color.
从 [page:Color color] 中拷贝 [page:.r r], [page:.g g] 和 [page:.b b] 值到当前的颜色。
</p>
<h3>[method:Color convertGammaToLinear]( [param:Float gammaFactor] ) </h3>
<p>
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
Converts this color from gamma space to linear space by taking [page:.r r], [page:.g g] and [page:.b b] to the power of [page:Float gammaFactor].
[page:Float gammaFactor] - (可选参数). 默认值 *2.0*.<br /><br />
通过取颜色 [page:.r r], [page:.g g] and [page:.b b] 的 [page:Float gammaFactor] 次方将颜色从伽马空间转换成线性空间。
</p>
<h3>[method:Color convertLinearToGamma]( [param:Float gammaFactor] ) </h3>
<p>
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
Converts this color from linear space to gamma space by taking [page:.r r], [page:.g g] and [page:.b b] to the power of 1 / [page:Float gammaFactor].
[page:Float gammaFactor] - (可选参数). 默认值 *2.0*.<br /><br />
通过取颜色 [page:.r r], [page:.g g] and [page:.b b] 的 1/[page:Float gammaFactor] 次方将颜色从线性空间转换成伽马空间。
</p>
<h3>[method:Color convertLinearToSRGB]() </h3>
<p>
Converts this color from linear space to sRGB space.
将此颜色从线性空间转换成sRGB空间。
</p>
<h3>[method:Color convertSRGBToLinear]() </h3>
<p>
Converts this color from sRGB space to linear space.
将此颜色从sRGB空间转换成线性空间。
</p>
<h3>[method:Color copyGammaToLinear]( [param:Color color], [param:Float gammaFactor] ) </h3>
<p>
[page:Color color] — Color to copy.<br />
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
[page:Color color] — 需要拷贝的颜色。<br />
[page:Float gammaFactor] - (可选参数). 默认值为 *2.0*.<br /><br />
Copies the given color into this color, and then converts this color from gamma space to linear space
by taking [page:.r r], [page:.g g] and [page:.b b] to the power of [page:Float gammaFactor].
将传入的 [param:Color color] 从伽马空间转换到线性空间然后复制给当前颜色。
</p>
<h3>[method:Color copyLinearToGamma]( [param:Color color], [param:Float gammaFactor] ) </h3>
<p>
[page:Color color] — Color to copy.<br />
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
[page:Color color] — 需要拷贝的颜色。<br />
[page:Float gammaFactor] - (可选参数). 默认值为 *2.0*.<br /><br />
Copies the given color into this color, and then converts this color from linear space to gamma space
by taking [page:.r r], [page:.g g] and [page:.b b] to the power of 1 / [page:Float gammaFactor].
将传入的 [param:Color color] 从线性空间转换到伽马空间然后复制给当前颜色。
</p>
<h3>[method:Color copyLinearToSRGB]( [param:Color color]] ) </h3>
<p>
[page:Color color] — Color to copy.<br />
[page:Color color] — 需要拷贝的颜色。<br />
Copies the given color into this color, and then converts this color from linear space to sRGB space.
将传入的 [param:Color color] 拷贝给当前颜色,然后将当前颜色从线性空间转换到sRGB空间。
</p>
<h3>[method:Color copySRGBToLinear]( [param:Color color] ) </h3>
<p>
[page:Color color] — Color to copy.<br />
[page:Color color] — 需要拷贝的颜色。<br />
Copies the given color into this color, and then converts this color from sRGB space to linear space.
将传入的 [param:Color color] 拷贝给当前颜色,然后将当前颜色从sRGB空间转换到线性空间。
</p>
<h3>[method:Boolean equals]( [param:Color color] ) </h3>
<p>Compares the RGB values of [page:Color color] with those of this object. Returns true if they are the same, false otherwise.</p>
<p>将 [param:Color color] 的RGB值与该对象的RGB值进行比较。如果它们都是相同的,返回true,否则返回false。</p>
<h3>[method:Color fromArray]( [param:Array array], [param:Integer offset] ) </h3>
<p>
[page:Array array] - [page:Array] of floats in the form [ [page:Float r], [page:Float g], [page:Float b] ].<br />
[page:Integer offset] - An optional offset into the array.<br /><br />
[page:Array array] - 格式为 [ [page:Float r], [page:Float g], [page:Float b] ] 的数组 [page:Array]。<br />
[page:Integer offset] - 数组中可选偏移量<br /><br />
Sets this color's components based on an array formatted like [ [page:Float r], [page:Float g], [page:Float b] ].
从格式为[ [page:Float r], [page:Float g], [page:Float b] ]的数组数据中来创建Color对象。
</p>
<h3>[method:Integer getHex]()</h3>
<p>Returns the hexadecimal value of this color.</p>
<p>返回此颜色的十六进制值。</p>
<h3>[method:String getHexString]()</h3>
<p>Returns the hexadecimal value of this color as a string (for example, 'FFFFFF').</p>
<p>将此颜色的十六进制值作为字符串返回 (例如, 'FFFFFF')。</p>
<h3>[method:Object getHSL]( [param:Object target] )</h3>
<p>
[page:Object target] — the result will be copied into this Object. Adds h, s and l keys to the object (if not already present).<br /><br />
[page:Object target] — 结果将复制到这个对象中。向对象添加h、s和l键(如果不存在)。<br /><br />
Convert this Color's [page:.r r], [page:.g g] and [page:.b b] values to [link:https://en.wikipedia.org/wiki/HSL_and_HSV HSL]
format and returns an object of the form:
将此颜色的 [page:.r r], [page:.g g] 和 [page:.b b] 值转换为 [link:https://en.wikipedia.org/wiki/HSL_and_HSV HSL]格式,然后返回一个格式如下的对象:
<code>
{ h: 0, s: 0, l: 0 }
......@@ -206,117 +203,113 @@ var color = new THREE.Color( 1, 0, 0 );
</p>
<h3>[method:String getStyle]()</h3>
<p>Returns the value of this color as a CSS style string. Example: 'rgb(255,0,0)'.</p>
<p>以CSS样式字符串的形式返回该颜色的值。例如:“rgb(255,0,0)”。</p>
<h3>[method:Color lerp]( [param:Color color], [param:Float alpha] ) </h3>
<p>
[page:Color color] - color to converge on.<br />
[page:Float alpha] - interpolation factor in the closed interval [0, 1].<br /><br />
[page:Color color] - 用于收敛的颜色。<br />
[page:Float alpha] - 介于0到1的数字。<br /><br />
Linearly interpolates this color's RGB values toward the RGB values of the passed argument.
The alpha argument can be thought of as the ratio between the two colors, where 0.0 is
this color and 1.0 is the first argument.
将该颜色的RGB值线性插值到传入参数的RGB值。alpha参数可以被认为是两种颜色之间的比例值,其中0是当前颜色和1.0是第一个参数的颜色。
</p>
<h3>[method:Color lerpHSL]( [param:Color color], [param:Float alpha] ) </h3>
<p>
[page:Color color] - color to converge on.<br />
[page:Float alpha] - interpolation factor in the closed interval [0, 1].<br /><br />
Linearly interpolates this color's HSL values toward the HSL values of the passed argument.
It differs from the classic [page:.lerp] by not interpolating straight from one color to the other,
but instead going through all the hues in between those two colors.
The alpha argument can be thought of as the ratio between the two colors, where 0.0 is
this color and 1.0 is the first argument.
[page:Color color] - 用于收敛的颜色。<br />
[page:Float alpha] - 介于0到1的数字。<br /><br />
将该颜色的HSL值线性插值到传递参数的HSL值。它不同于上诉的[page:lerp]。通过不直接从一种颜色插入到另一种颜色,
而是通过插值这两种颜色之间的所有色相(H)、亮度(L)、饱和度(S)。alpha参数可以被认为是两种颜色之间的比例值,
其中0是当前颜色和1.0是第一个参数的颜色。
</p>
<h3>[method:Color multiply]( [param:Color color] ) </h3>
<p>Multiplies this color's RGB values by the given [page:Color color]'s RGB values.</p>
<p>将此颜色的RGB值乘以给定的[page: color color]的RGB值。</p>
<h3>[method:Color multiplyScalar]( [param:Number s] ) </h3>
<p>Multiplies this color's RGB values by [page:Number s].</p>
<p>将此颜色的RGB值乘以给定的[page:Number s]的值。</p>
<h3>[method:Color offsetHSL]( [param:Float h], [param:Float s], [param:Float l] ) </h3>
<p>
Adds the given [page:Float h], [page:Float s], and [page:Float l] to this color's values.
Internally, this converts the color's [page:.r r], [page:.g g] and [page:.b b] values to HSL, adds
[page:Float h], [page:Float s], and [page:Float l], and then converts the color back to RGB.
将给定的 [page:Float h], [page:Float s], 和 [page:Float l]值加到当前颜色值。
内部的机制为:先将该颜色的 [page:.r r], [page:.g g] 和 [page:.b b] 值转换为HSL,然后与传入的[page:Float h], [page:Float s], 和 [page:Float l]
相加,最后再将结果转成RGB值。
</p>
<h3>[method:Color set]( [param:Color_Hex_or_String value] ) </h3>
<p>
[page:Color_Hex_or_String value] - Value to set this color to.<br /><br />
[page:Color_Hex_or_String value] - 用于设置该颜色的值。<br /><br />
See the Constructor above for full details of what [page:Color_Hex_or_String value] can be.
Delegates to [page:.copy], [page:.setStyle], or [page:.setHex] depending on input type.
有关 [page:Color_Hex_or_String value] 的详细信息,请参阅上面的构造函数。
根据输入类型,将会委托给 [page:.copy], [page:.setStyle], 或者 [page:.setHex] 函数处理。
</p>
<h3>[method:Color setHex]( [param:Integer hex] ) </h3>
<p>
[page:Integer hex] — [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] format.<br /><br />
[page:Integer hex] — [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] 格式。<br /><br />
采用十六进制值设置此颜色。
Sets this color from a hexadecimal value.
</p>
<h3>[method:Color setHSL]( [param:Float h], [param:Float s], [param:Float l] ) </h3>
<p>
[page:Float h] — hue value between 0.0 and 1.0 <br />
[page:Float s] — saturation value between 0.0 and 1.0 <br />
[page:Float l] — lightness value between 0.0 and 1.0<br /><br />
[page:Float h] — 色相值处于0到1之间。hue value between 0.0 and 1.0 <br />
[page:Float s] — 饱和度值处于0到1之间。<br />
[page:Float l] — 亮度值处于0到1之间。<br /><br />
Sets color from HSL values.
采用HLS值设置此颜色。
</p>
<h3>[method:Color setRGB]( [param:Float r], [param:Float g], [param:Float b] ) </h3>
<p>
[page:Float r] — Red channel value between 0.0 and 1.0.<br />
[page:Float g] — Green channel value between 0.0 and 1.0.<br />
[page:Float b] — Blue channel value between 0.0 and 1.0.<br /><br />
[page:Float r] — 红色通道的值在0到1之间。<br />
[page:Float g] — 绿色通道的值在0到1之间。<br />
[page:Float b] — 蓝色通道的值在0到1之间。<br /><br />
Sets this color from RGB values.
采用RGB值设置此颜色。
</p>
<h3>[method:Color setScalar]( [param:Float scalar] ) </h3>
<p>
[page:Float scalar] — a value between 0.0 and 1.0.<br /><br />
[page:Float scalar] — 处于0到1之间的值<br /><br />
Sets all three color components to the value [page:Float scalar].
将颜色的RGB值都设为该 [page:Float scalar] 的值。
</p>
<h3>[method:Color setStyle]( [param:String style] ) </h3>
<p>
[page:String style] — color as a CSS-style string.<br /><br />
[page:String style] — 颜色css样式的字符串<br /><br />
Sets this color from a CSS-style string. For example,
采用ccs样式的字符串设置此颜色。例如,
"rgb(250, 0,0)",
"rgb(100%, 0%, 0%)",
"hsl(0, 100%, 50%)",
"#ff0000",
"#f00", or
"red" ( or any [link:https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart X11 color name]
- all 140 color names are supported ).<br />
"#f00", 或者
"red" ( 或者任何 [link:https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart X11 color name]
- 所有140种颜色名称都支持 ).<br />
Translucent colors such as "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" are also accepted,
but the alpha-channel coordinate will be discarded.<br /><br />
半透明颜色例如 "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" 也能支持,
但是alpha通道的值将会被丢弃。<br /><br />
Note that for X11 color names, multiple words such as Dark Orange become the string 'darkorange' (all lowercase).
注意,对于X11颜色名称,多个单词(如暗橙色)变成字符串“darkorange”(全部是小写字母)。
</p>
<h3>[method:Color sub]( [param:Color color] ) </h3>
<p>
Subtracts the RGB components of the given color from the RGB components of this color.
If this results in a negative component, that component is set to zero.
从该颜色的RGB分量中减去传入颜色的RGB分量。如果分量结果是负,则该分量为零。
</p>
<h3>[method:Array toArray]( [param:Array array], [param:Integer offset] ) </h3>
<p>
[page:Array array] - An optional array to store the color to. <br />
[page:Integer offset] - An optional offset into the array.<br /><br />
[page:Array array] - 存储颜色的可选数组 <br />
[page:Integer offset] - 数组的可选偏移量<br /><br />
Returns an array of the form [ r, g, b ].
返回一个格式为[ r, g, b ] 数组。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -8,26 +8,25 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>圆柱体[name]</h1>
<p class="desc">
A point's [link:https://en.wikipedia.org/wiki/Cylindrical_coordinate_system cylindrical coordinates].
</p>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Float radius], [param:Float theta], [param:Float y] )</h3>
<p>
[page:Float radius] - distance from the origin to a point in the x-z plane.
Default is *1.0*.<br />
[page:Float theta] - counterclockwise angle in the x-z plane measured in radians
from the positive z-axis. Default is *0*.<br />
[page:Float y] - height above the x-z plane. Default is *0*.
[page:Float radius] - 从原点到x-z平面上一点的距离
默认值为 *1.0*.<br />
[page:Float theta] - 在x-z平面内的逆时针角度,以z轴正方向的计算弧度。默认值为0。<br />
[page:Float y] - x-z平面以上的高度 默认值为 *0*.
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Float radius]</h3>
......@@ -40,33 +39,32 @@
<h3>[method:Cylindrical clone]()</h3>
<p>
Returns a new cylindrical with the same [page:.radius radius], [page:.theta theta]
and [page:.y y] properties as this one.
返回一个与当前拥有相同 [page:.radius radius], [page:.theta theta] 和 [page:.y y] 属性的圆柱体。
</p>
<h3>[method:Cylindrical copy]( [param:Cylindrical other] )</h3>
<p>
Copies the values of the passed Cylindrical's [page:.radius radius], [page:.theta theta]
and [page:.y y] properties to this cylindrical.
将传入的圆柱体对象的 [page:.radius radius], [page:.theta theta] 和 [page:.y y] 属性赋给当前对象。
</p>
<h3>[method:Cylindrical set]( [param:Float radius], [param:Float theta], [param:Float y] )</h3>
<p>Sets values of this cylindrical's [page:.radius radius], [page:.theta theta]
and [page:.y y] properties.</p>
<p>设置该对象的 [page:.radius radius], [page:.theta theta]
和 [page:.y y] 属性。</p>
<h3>[method:Cylindrical setFromVector3]( [param:Vector3 vec3] )</h3>
<p>
Sets values of this cylindrical's [page:.radius radius], [page:.theta theta]
and [page:.y y] properties from the [page:Vector3 Vector3].
从 [page:Vector3 Vector3] 中取x,y,z,并调用setFromCartesianCoords来设置圆柱体的
[page:.radius radius]、[page:.theta theta] 和 [page:.y y] 的属性值。
</p>
<h3>[method:Cylindrical setFromCartesianCoords]( [param:Float x], [param:Float y], [param:Float z] )</h3>
<p>
Sets values of this cylindrical's [page:.radius radius], [page:.theta theta]
and [page:.y y] properties from Cartesian coordinates.
使用笛卡尔坐标来设置该圆柱体的 [page:.radius radius], [page:.theta theta]
and [page:.y y] 属性值。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -11,13 +11,11 @@
<h1>[name]</h1>
<p class="desc">
A class representing [link:http://en.wikipedia.org/wiki/Euler_angles Euler Angles].<br /><br />
Euler angles describe a rotational transformation by rotating an object on its various
axes in specified amounts per axis, and a specified axis order.
表示 [link:http://en.wikipedia.org/wiki/Euler_angles Euler] 的类。<br /><br />
欧拉角描述一个旋转变换,通过指定轴顺序和其各个轴向上的指定旋转角度来旋转一个物体。
</p>
<h2>Example</h2>
<h2>示例(Example)</h2>
<code>var a = new THREE.Euler( 0, 1, 1.57, 'XYZ' );
var b = new THREE.Vector3( 1, 0, 1 );
......@@ -25,167 +23,158 @@
</code>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Float x], [param:Float y], [param:Float z], [param:String order] )</h3>
<p>
[page:Float x] - (optional) the angle of the x axis in radians. Default is *0*.<br />
[page:Float y] - (optional) the angle of the y axis in radians. Default is *0*.<br />
[page:Float z] - (optional) the angle of the z axis in radians. Default is *0*.<br />
[page:String order] - (optional) a string representing the order that the rotations are applied,
defaults to 'XYZ' (must be upper case).<br /><br />
[page:Float x] - (optional) 用弧度表示x轴旋转量。 默认值是 *0*。<br />
[page:Float y] - (optional) 用弧度表示y轴旋转量。 默认值是 *0*。<br />
[page:Float z] - (optional) 用弧度表示z轴旋转量。 默认值是 *0*。<br />
[page:String order] - (optional) 表示旋转顺序的字符串,默认为'XYZ'(必须是大写)。<br /><br />
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Boolean isEuler]</h3>
<p>
Used to check whether this or derived classes are Eulers. Default is *true*.<br /><br />
You should not change this, as it used internally for optimisation.
用于判定此对象或者此类的派生对象是否是欧拉角。默认值为 *true*。<br /><br />
不应该改变该值,因为它在内部用于优化。
</p>
<h3>[property:String order]</h3>
<p>
The order in which to apply rotations. Default is 'XYZ', which means that the object will first be
rotated around its X axis, then its Y axis and finally its Z axis. Other possibilities are:
'YZX', 'ZXY', 'XZY', 'YXZ' and 'ZYX'. These must be in upper case.<br /><br />
order值应用于旋转顺序。默认值为 'XYZ',这意味着对象将首先是
绕X轴旋转,然后是Y轴,最后是Z轴。其他可能性包括:
'YZX', 'ZXY', 'XZY', 'YXZ'和'ZYX'。这些必须是大写字母。<br /><br />
Three.js 使用<em>intrinsic</em> Tait-Bryan angles(Yaw、Pitch、Roll)。
这意味着旋转是在<em>本地</em>坐标系下进行的。也就是说,对于“XYZ”订单,首先是围绕local-X轴旋转(与world- x轴相同),
然后是local-Y(现在可能与world y轴不同),然后是local-Z(可能与world z轴不同)。<br /><br />
Three.js uses <em>intrinsic</em> Tait-Bryan angles. This means that rotations are performed with respect
to the <em>local</em> coordinate system. That is, for order 'XYZ', the rotation is first around the local-X
axis (which is the same as the world-X axis), then around local-Y (which may now be different from the
world Y-axis), then local-Z (which may be different from the world Z-axis).<br /><br />
If the order is changed, [page:.onChangeCallback onChangeCallback] will be called.
如果order值被改变,[page:.onChangeCallback onChangeCallback] 会被调用。
</p>
<h3>[property:Float x]</h3>
<p>
The current value of the x component.<br /><br />
当前x分量的值。<br /><br />
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
如果这个值发生变化,[page:.onChangeCallback onChangeCallback] 会被调用。
</p>
<h3>[property:Float y]</h3>
<p>
The current value of the y component.<br /><br />
当前y分量的值。<br /><br />
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
如果这个值发生变化,[page:.onChangeCallback onChangeCallback] 会被调用。
</p>
<h3>[property:Float z]</h3>
<p>
The current value of the z component.<br /><br />
当前z分量的值。<br /><br />
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
如果这个值发生变化,[page:.onChangeCallback onChangeCallback] 会被调用。
</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<h3>[method:Euler copy]( [param:Euler euler] )</h3>
<p>Copies value of [page:Euler euler] to this euler.</p>
<p>将 [page:Euler euler] 的属性拷贝到当前对象。</p>
<h3>[method:Euler clone]()</h3>
<p>Returns a new Euler with the same parameters as this one.</p>
<p>返回一个与当前参数相同的新欧拉角。</p>
<h3>[method:Boolean equals]( [param:Euler euler] )</h3>
<p>Checks for strict equality of this euler and [page:Euler euler].</p>
<p>检查 [page:Euler euler] 是否与当前对象相同。</p>
<h3>[method:Euler fromArray]( [param:Array array] )</h3>
<p>
[page:Array array] of length 3 or 4. The optional 4th argument corresponds to the [page:.order order].<br /><br />
Assigns this euler's [page:.x x] angle to array[0]. <br />
Assigns this euler's [page:.y y] angle to array[1]. <br />
Assigns this euler's [page:.z z] angle to array[2]. <br />
Optionally assigns this euler's [page:.order order] to array[3].
长度为3或4的一个 [page:Array array] 。array[3] 是一个可选的 [page:.order order] 参数。<br /><br />
将欧拉角的x分量设置为 array[0]。 <br />
将欧拉角的x分量设置为 array[1]。 <br />
将欧拉角的x分量设置为 array[2]。 <br />
将array[3]设置给欧拉角的 [page:.order order] 。可选。
</p>
<h3>[method:Euler onChange]( [param:Function onChangeCallback] )</h3>
<p>
[page:Function onChangeCallback] - set the value of the onChangeCallback() function.
[page:Function onChangeCallback] - 为 onChangeCallback() 函数赋值。
</p>
<h3>[method:Euler onChangeCallback]( )</h3>
<p>
By default this is an empty function, however it can be set via [page:.onChange onChange]().<br />
It gets called after changing the [page:.x x], [page:.y y], [page:.z z] or [page:.order order] properties,
and also after calling most setter functions (see those for details).
默认情况下,这个函数为空,但是它可以通过[page:.onChange onChange]()来设置。<br />
在更改 [page:.x x], [page:.y y], [page:.z z] 或 [page:.order order] 属性之后调用它,
在调用大多数setter函数之后也会调用它(详细信息请参阅那些函数)。
</p>
<h3>[method:Euler reorder]( [param:String newOrder] )</h3>
<p>
Resets the euler angle with a new order by creating a quaternion from this euler angle
and then setting this euler angle with the quaternion and the new order. <br /><br />
通过这个欧拉角创建一个四元数,然后用这个四元数和新顺序设置这个欧拉角。 <br /><br />
<em>WARNING</em>: this discards revolution information.
<em>警告</em>: 这将弃用旋转信息。
</p>
<h3>[method:Euler set]( [param:Float x], [param:Float y], [param:Float z], [param:String order] )</h3>
<p>
[page:.x x] - the angle of the x axis in radians.<br />
[page:.y y] - the angle of the y axis in radians.<br />
[page:.z z] - the angle of the z axis in radians.<br />
[page:.order order] - (optional) a string representing the order that the rotations are applied.<br /><br />
[page:.x x] - 用弧度表示x轴旋转量。<br />
[page:.y y] - 用弧度表示y轴旋转量。<br />
[page:.z z] - 用弧度表示z轴旋转量。<br />
[page:.order order] - (optional) 表示旋转顺序的字符串。<br /><br />
Sets the angles of this euler transform and optionally the [page:.order order] and then call [page:.onChangeCallback onChangeCallback]().
设置该欧拉变换的角度和旋转顺序 [page:.order order] ,然后调用 [page:.onChangeCallback onChangeCallback]()。
</p>
<h3>[method:Euler setFromRotationMatrix]( [param:Matrix4 m], [param:String order], [param:Boolean update] )</h3>
<p>
[page:Matrix4 m] - a [page:Matrix4] of which the upper 3x3 of matrix is a pure
[link:https://en.wikipedia.org/wiki/Rotation_matrix rotation matrix] (i.e. unscaled).<br />
[page:.order order] - (optional) a string representing the order that the rotations are applied.<br />
[page:Boolean update] - (optional) whether to call [page:.onChangeCallback onChangeCallback]() after applying
the matrix.<br /><br />
[page:Matrix4 m] - [page:Matrix4] 矩阵上面的3x3部分是一个纯旋转矩阵[link:https://en.wikipedia.org/wiki/Rotation_matrix rotation matrix]
(也就是不发生缩放)<br />
[page:.order order] - (可选参数) 表示旋转顺序的字符串。<br />
[page:Boolean update] - (可选参数) 表示设置完变换矩阵后是否调用 [page:.onChangeCallback onChangeCallback]。<br /><br />
Sets the angles of this euler transform from a pure rotation matrix based on the orientation
specified by order.
使用基于 [page:.order order] 顺序的纯旋转矩阵来设置当前欧拉角。
</p>
<h3>[method:Euler setFromQuaternion]( [param:Quaternion q], [param:String order], [param:Boolean update] )</h3>
<p>
[page:Quaternion q] - a normalized quaternion.<br />
[page:.order order] - (optional) a string representing the order that the rotations are applied.<br />
[page:Boolean update] - (optional) whether to call [page:.onChangeCallback onChangeCallback]() after applying
the matrix.<br /><br />
[page:Quaternion q] - 归一化的四元数。<br />
[page:.order order] - (可选参数) 表示旋转顺序的字符串。<br />
[page:Boolean update] - (可选参数) 表示设置完变换矩阵后是否调用 [page:.onChangeCallback onChangeCallback]。<br /><br />
Sets the angles of this euler transform from a normalized quaternion based on the orientation
specified by [page:.order order].
根据 [page:.order order] 指定的方向,使用归一化四元数设置这个欧拉变换的角度。
</p>
<h3>[method:Euler setFromVector3]( [param:Vector3 vector], [param:String order] )</h3>
<p>
[page:Vector3 vector] - [page:Vector3].<br />
[page:.order order] - (optional) a string representing the order that the rotations are applied.<br /><br />
[page:.order order] - (可选参数) 表示旋转顺序的字符串。<br /><br />
Set the [page:.x x], [page:.y y] and [page:.z z], and optionally update the [page:.order order]. [page:.onChangeCallback onChangeCallback]()
is called after these changes are made.
设置 [page:.x x], [page:.y y] and [page:.z z] 并且选择性更新 [page:.order order]。
更改完成之后调用 [page:.onChangeCallback onChangeCallback]()。
</p>
<h3>[method:Array toArray]( [param:Array array], [param:Integer offset] )</h3>
<p>
[page:Array array] - (optional) array to store the euler in.<br />
[page:Integer offset] (optional) offset in the array.<br />
[page:Array array] - (可选参数) 存储欧拉角的数组。<br />
[page:Integer offset] (可选参数) 数组的偏移量。<br />
Returns an array of the form [[page:.x x], [page:.y y], [page:.z z], [page:.order order ]].
返回一个数组:[[page:.x x], [page:.y y], [page:.z z], [page:.order order ]]。
</p>
<h3>[method:Vector3 toVector3]( [param:Vector3 optionalResult] )</h3>
<p>
[page:Vector3 optionalResult] — (optional) If specified, the result will be copied into this Vector,
otherwise a new one will be created. <br /><br />
[page:Vector3 optionalResult] — (可选参数) 如果指定了该参数结果将会被复制给该参数,否者会创建一个新的 Vector3 <br /><br />
Returns the Euler's [page:.x x], [page:.y y] and [page:.z z] properties as a [page:Vector3].
以 [page:Vector3] 的形式返回欧拉角的 [page:.x x], [page:.y y] 和 [page:.z z]。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -8,99 +8,96 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>视锥体([name])</h1>
<p class="desc">
[link:http://en.wikipedia.org/wiki/Frustum Frustums] are used to determine what is
inside the camera's field of view. They help speed up the rendering process - object which lie
outside a camera's frustum can safely be excluded from rendering.<br /><br />
[link:http://en.wikipedia.org/wiki/Frustum Frustums] 用于确定相机视野内的东西。
它有助于加速渲染过程——位于摄像机视锥体外的物体可以安全地排除在渲染之外。<br /><br />
This class is mainly intended for use internally by a renderer for calculating
a [page:Camera camera] or [page:LightShadow.camera shadowCamera]'s frustum.
该类主要用于渲染器内部计算 [page:Camera camera] 或 [page:LightShadow.camera shadowCamera]的视锥体。
</p>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]([param:Plane p0], [param:Plane p1], [param:Plane p2], [param:Plane p3], [param:Plane p4], [param:Plane p5])</h3>
<p>
[page:Plane p0] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p1] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p2] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p3] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p4] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p5] - (optional) defaults to a new [page:Plane].<br /><br />
Creates a new [name].
[page:Plane p0] - (可选参数) [page:Plane].<br />
[page:Plane p1] - (可选参数) [page:Plane].<br />
[page:Plane p2] - (可选参数) [page:Plane].<br />
[page:Plane p3] - (可选参数) [page:Plane].<br />
[page:Plane p4] - (可选参数) [page:Plane].<br />
[page:Plane p5] - (可选参数) [page:Plane].<br /><br />
使用6个面来构建一个视锥体。
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Array planes]</h3>
<p>Array of 6 [page:Plane planes].</p>
<p>包含6个平面 [page:Plane planes] 的数组。</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<h3>[method:Frustum clone]()</h3>
<p>Return a new Frustum with the same parameters as this one.</p>
<p>返回一个与当前对象有相同参数的视锥体。</p>
<h3>[method:Boolean containsPoint]( [param:Vector3 point] )</h3>
<p>
[page:Vector3 point] - [page:Vector3] to test.<br /><br />
Checks to see if the frustum contains the [page:Vector3 point].
检测该点 [page:Vector3 point] 是否在视锥体内。
</p>
<h3>[method:Frustum copy]( [param:Frustum frustum] )</h3>
<p>
[page:Frustum frustum] - The frustum to copy<br /><br />
[page:Frustum frustum] - 用于拷贝的视锥体。<br /><br />
Copies the properties of the passed [page:Frustum frustum] into this one.
将传入 [page:Frustum frustum] 的属性拷贝到当前对象。
</p>
<h3>[method:Boolean intersectsBox]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - [page:Box3] to check for intersection.<br /><br />
Return true if [page:Box3 box] intersects with this frustum.
[page:Box3 box] - [page:Box3] 用于检测是否要交的包围盒。<br /><br />
返回 true 如果该 [page:Box3 box] 与视锥体相交。
</p>
<h3>[method:Boolean intersectsObject]( [param:Object3D object] )</h3>
<p>
Checks whether the [page:Object3D object]'s [page:Geometry.boundingSphere bounding sphere] is intersecting the Frustum.<br /><br />
检测 [page:Object3D object] 的包围球 [page:Geometry.boundingSphere bounding sphere] 是否与视锥体相交。<br /><br />
Note that the object must have a [page:Geometry] or [page:BufferGeometry] so that the bounding sphere
can be calculated.
注意:该对象必须有一个 [page:Geometry] 或 [page:BufferGeometry] ,因为这样才能计算出包围球。
</p>
<h3>[method:Boolean intersectsSphere]( [param:Sphere sphere] )</h3>
<p>
[page:Sphere sphere] - [page:Sphere] to check for intersection.<br /><br />
[page:Sphere sphere] - [page:Sphere] 用于检查是否相交。<br /><br />
Return true if [page:Sphere sphere] intersects with this frustum.
返回true 如果球[page:Sphere sphere]与视锥体相交。
</p>
<h3>[method:Boolean intersectsSprite]( [param:Sprite sprite] )</h3>
<p>
Checks whether the [page:Sprite sprite] is intersecting the Frustum.<br /><br />
检查精灵[page:Sprite sprite]是否与截锥体相交。<br /><br />
</p>
<h3>[method:Frustum set]( [param:Plane p0], [param:Plane p1], [param:Plane p2], [param:Plane p3], [param:Plane p4], [param:Plane p5] )</h3>
<p>
Sets the current frustum from the passed planes. No plane order is implicitely implied.
使用传入的平面设置当前视锥体。没有隐式的顺序。
</p>
<h3>[method:Frustum setFromMatrix]( [param:Matrix4 matrix] )</h3>
<p>
[page:Matrix4 matrix] - [page:Matrix4] used to set the [page:.planes planes]<br /><br />
[page:Matrix4 matrix] - [page:Matrix4] 用于设置 [page:.planes planes]<br /><br />
This is used by the [page:WebGLRenderer] to set up the Frustum from a [page:Camera Camera]'s
[page:Camera.projectionMatrix projectionMatrix] and [page:Camera.matrixWorldInverse matrixWorldInverse].
</p>
[page:WebGLRenderer] 使用 [page:Camera Camera]的投影矩阵([page:Camera.projectionMatrix projectionMatrix] )
和相机世界变换矩阵的逆矩阵 [page:Camera.matrixWorldInverse matrixWorldInverse] 来设置视锥体。
</p>
......
......@@ -8,21 +8,20 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>插值器([name])</h1>
<p class="desc">
Abstract base class of interpolants over parametric samples.<br /><br />
A参数样本上插值的抽象基类 <br /><br />
The parameter domain is one dimensional, typically the time or a path along a curve defined by the data.<br /><br />
参数域是一维的,通常是数据定义的曲线上的时间或路径。<br /><br />
The sample values can have any dimensionality and derived classes may apply special interpretations to the data.<br /><br />
示例值可以具有任何维度,派生类可以对数据应用特殊的解释。<br /><br />
This class provides the interval seek in a Template Method, deferring the actual interpolation to derived classes.<br /><br />
该类提供间隔查找的模板方法,将实际的插值延迟到派生类。<br /><br />
Time complexity is *O(1)* for linear access crossing at most two points and *O(log N)* for random access,
where *N* is the number of positions.<br /><br />
对于最多两个点之间的访问时间复杂度为O(1),对于随机访问时间复杂度为O(log N),其中N为位置数。<br /><br />
References: [link:http://www.oodesign.com/template-method-pattern.html http://www.oodesign.com/template-method-pattern.html]
相关: [link:http://www.oodesign.com/template-method-pattern.html http://www.oodesign.com/template-method-pattern.html]
</p>
......@@ -38,7 +37,7 @@
sampleSize -- number of samples<br />
resultBuffer -- buffer to store the interpolation results.<br /><br />
Note: This is not designed to be called directly.
注意: 这不是设计为直接调用的。
</p>
<h2>Properties</h2>
......@@ -74,10 +73,10 @@
<h3>[method:null evaluate]( [param:Number t] )</h3>
<p>
Evaluate the interpolant at position *t*.
计算补间函数在位置 *t* 的值。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -8,79 +8,75 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>三维几何线段([name])</h1>
<p class="desc">A geometric line segment represented by a start and end point.</p>
<p class="desc">用起点和终点表示的几何线段。</p>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Vector3 start], [param:Vector3 end] )</h3>
<p>
[page:Vector3 start] - Start of the line segment. Default is (0, 0, 0).<br />
[page:Vector3 end] - End of the line segment. Default is (0, 0, 0).<br /><br />
[page:Vector3 start] - 线段的起始点。默认值为 (0, 0, 0)。<br />
[page:Vector3 end] - 线段的终点。默认值为 (0, 0, 0)。<br /><br />
Creates a new [name].
创建一个三维几何线段 [name]。
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Vector3 start]</h3>
<p>[page:Vector3] representing the start point of the line.</p>
<p>[page:Vector3] 表示线段的起点。</p>
<h3>[property:Vector3 end]</h3>
<p>[page:Vector3] representing the end point of the line.</p>
<p>[page:Vector3] 表示线段的终点</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<h3>[method:Line3 applyMatrix4]( [param:Matrix4 matrix] )</h3>
<p>Applies a matrix transform to the line segment.</p>
<p>对此线段应用矩阵变换。</p>
<h3>[method:Vector3 at]( [param:Float t], [param:Vector3 target] )</h3>
<p>
[page:Float t] - Use values 0-1 to return a position along the line segment. <br />
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
Returns a vector at a certain position along the line. When [page:Float t] = 0, it returns the start vector,
and when [page:Float t] = 1 it returns the end vector.<br />
[page:Float t] - 使用值0-1返回沿线段的位置。<br />
[page:Vector3 target] — 计算结果会被拷贝到target。<br /><br />
返回一个线段某一位置的向量,当 [page:Float t] = 0的时候返回起始点,当[page:Float t] = 1的时候返回终点。<br />
</p>
<h3>[method:Line3 clone]()</h3>
<p>Returns a new [page:Line3] with the same [page:.start start] and [page:.end end] vectors as this one.</p>
<p>返回一个与此线段拥有相同起始点 [page:.start start] 和 终点[page:.end end] 的线段。</p>
<h3>[method:Vector3 closestPointToPoint]( [param:Vector3 point], [param:Boolean clampToLine], [param:Vector3 target] )</h3>
<p>
[page:Vector3 point] - return the closest point on the line to this point.<br />
[page:Boolean clampToLine] - whether to clamp the returned value to the line segment.<br />
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 point] - 用于计算线段上到该点最近的点。<br />
[page:Boolean clampToLine] - 是否将结果限制在线段起始点和终点之间。<br />
[page:Vector3 target] — 结果会拷贝到target。<br /><br />
Returns the closets point on the line. If [page:Boolean clampToLine] is true, then the returned value will be
clamped to the line segment.
返回线段上到point最近的点。如果参数 [page:Boolean clampToLine] 为true。返回值将会在线段之间。
</p>
<h3>[method:Float closestPointToPointParameter]( [param:Vector3 point], [param:Boolean clampToLine] )</h3>
<p>
[page:Vector3 point] - the point for which to return a point parameter. <br />
[page:Boolean clampToLine] - Whether to clamp the result to the range [0, 1].<br /><br />
[page:Vector3 point] - 用于计算返回值的点 <br />
[page:Boolean clampToLine] - 结果是否处于 [0, 1]之间。<br /><br />
Returns a point parameter based on the closest point as projected on the line segement.
If [page:Boolean clampToLine] is true, then the returned value will be between 0 and 1.
返回一个基于点投影到线段上的点的参数。如果 [page:Boolean clampToLine] 为true则返回值将在0到1之间。
</p>
<h3>[method:Line3 copy]( [param:Line3 line] )</h3>
<p>Copies the passed line's [page:.start start] and [page:.end end] vectors to this line.</p>
<p>拷贝传入线段的起始点 [page:.start start] 和终点 [page:.end end] 向量到当前线段。</p>
<h3>[method:Vector3 delta]( [param:Vector3 target] )</h3>
<p>
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
Returns the delta vector of the line segment ( [page:.end end] vector minus the [page:.start start] vector).
[page:Vector3 target] — 结果将会拷贝到target。<br /><br />
返回线段的向量。(终点[page:.end end]向量减去起始点[page:.start start]向量)。
</p>
<h3>[method:Float distance]()</h3>
......@@ -89,34 +85,32 @@
<h3>[method:Float distanceSq]()</h3>
<p>
Returns the square of the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]
(straight-line distance) between the line's [page:.start start]
and [page:.end end] vectors.
返回起始点[page:.start start]和终点[page:.end end]的欧几里得距离[link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]。(直线距离)
</p>
<h3>[method:Boolean equals]( [param:Line3 line] )</h3>
<p>
[page:Line3 line] - [page:Line3] to compare with this one.<br /><br />
Returns true if both line's [page:.start start] and [page:.end en] points are equal.
如果给定线段与当前线段的起始点[page:.start start]和终点[page:.end end]都相同则返回true。
</p>
<h3>[method:Vector3 getCenter]( [param:Vector3 target] )</h3>
<p>
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 target] — 结果会写入target。<br /><br />
Returns the center of the line segment.
返回线段的中心点。
</p>
<h3>[method:Line3 set]( [param:Vector3 start], [param:Vector3 end] )</h3>
<p>
[page:Vector3 start] - set the [page:.start start point] of the line.<br />
[page:Vector3 end] - set the [page:.end end point] of the line.<br /><br />
[page:Vector3 start] - 设置线段的起点 [page:.start start point]。<br />
[page:Vector3 end] - 设置线段的终点 [page:.end end point]。<br /><br />
Sets the start and end values by copying the provided vectors.
将传入的向量设置到线段的起始点和终点。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -8,101 +8,96 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>数学函数([name])</h1>
<p class="desc">An object with several math utility functions.</p>
<p class="desc">具有多个数学实用函数的对象。</p>
<h2>Functions</h2>
<h2>函数(Functions)</h2>
<h3>[method:Float clamp]( [param:Float value], [param:Float min], [param:Float max] )</h3>
<p>
[page:Float value] — Value to be clamped.<br />
[page:Float min] — Minimum value.<br />
[page:Float max] — Maximum value.<br /><br />
[page:Float value] — 需要clamp处理的值。<br />
[page:Float min] — 最小值。<br />
[page:Float max] — 最大值。<br /><br />
Clamps the [page:Float value] to be between [page:Float min] and [page:Float max].
限制数值[page:Float value]处于最小值[page:Float min]和最大值[page:Float max]之间。
</p>
<h3>[method:Float degToRad]( [param:Float degrees] )</h3>
<p>Converts degrees to radians.</p>
<p>将度转化为弧度。</p>
<h3>[method:Integer euclideanModulo]( [param:Integer n], [param:Integer m] )</h3>
<p>
[page:Integer n], [page:Integer m] - Integers<br /><br />
Computes the Euclidean modulo of [page:Integer m] % [page:Integer n], that is:
[page:Integer n], [page:Integer m] - 整型<br /><br />
计算 [page:Integer m] % [page:Integer n] 的欧几里得模:
<code>( ( n % m ) + m ) % m</code>
</p>
<h3>[method:UUID generateUUID]( )</h3>
<p>
Generate a [link:https://en.wikipedia.org/wiki/Universally_unique_identifier UUID]
(universally unique identifier).
创建一个全局唯一标识符 [link:https://en.wikipedia.org/wiki/Universally_unique_identifier UUID]。
</p>
<h3>[method:Boolean isPowerOfTwo]( [param:Number n] )</h3>
<p>Return *true* if [page:Number n] is a power of 2.</p>
<p>如果 [page:Number n] 是2的幂,返回true。</p>
<h3>[method:Float lerp]( [param:Float x], [param:Float y], [param:Float t] )</h3>
<p>
[page:Float x] - Start point. <br />
[page:Float y] - End point. <br />
[page:Float t] - interpolation factor in the closed interval [0, 1].<br><br />
[page:Float x] - 起始点。 <br />
[page:Float y] - 终点。 <br />
[page:Float t] - 封闭区间[0,1]内的插值因子。<br><br />
Returns a value [link:https://en.wikipedia.org/wiki/Linear_interpolation linearly interpolated]
from two known points based on the given interval - [page:Float t] = 0 will return [page:Float x]
and [page:Float t] = 1 will return [page:Float y].
返回给定区间的线性插值[link:https://en.wikipedia.org/wiki/Linear_interpolation linearly interpolated]结果 - [page:Float t] = 0 将会返回 [page:Float x]
如果 [page:Float t] = 1 将会返回 [page:Float y].
</p>
<h3>[method:Float mapLinear]( [param:Float x], [param:Float a1], [param:Float a2], [param:Float b1], [param:Float b2] )</h3>
<p>
[page:Float x] — Value to be mapped.<br />
[page:Float a1] — Minimum value for range A.<br />
[page:Float a2] — Maximum value for range A.<br />
[page:Float b1] — Minimum value for range B.<br />
[page:Float b2] — Maximum value for range B.<br /><br />
[page:Float x] — 用于映射的值。<br />
[page:Float a1] — A区间最小值。<br />
[page:Float a2] — A区间最大值。<br />
[page:Float b1] — B区间最小值。<br />
[page:Float b2] — A区间最大值。<br /><br />
Linear mapping of [page:Float x] from range [[page:Float a1], [page:Float a2]] to range [[page:Float b1], [page:Float b2]].
x从范围[[page:Float a1], [page:Float a2]] 到范围[[page:Float b1], [page:Float b2]]的线性映射。
</p>
<h3>[method:Integer ceilPowerOfTwo]( [param:Number n] )</h3>
<p>Returns the smallest power of 2 that is greater than or equal to [page:Number n].</p>
<p>返回大于等于 [page:Number n] 的2的最小次幂。</p>
<h3>[method:Integer floorPowerOfTwo]( [param:Number n] )</h3>
<p>Returns the largest power of 2 that is less than or equal to [page:Number n].</p>
<p>返回小于等于 [page:Number n] 的2的最大幂。</p>
<h3>[method:Float radToDeg]( [param:Float radians] )</h3>
<p>Converts radians to degrees.</p>
<p>将弧度转换为角度。</p>
<h3>[method:Float randFloat]( [param:Float low], [param:Float high] )</h3>
<p>Random float in the interval [page:Float low] to [page:Float high].</p>
<p>在区间[page:Float low] 到 [page:Float high]随机一个浮点数。</p>
<h3>[method:Float randFloatSpread]( [param:Float range] )</h3>
<p>Random float in the interval *- [page:Float range] / 2* to *[page:Float range] / 2*.</p>
<p>在区间*- [page:Float range] / 2* 到 *[page:Float range] / 2*随机一个浮点数。</p>
<h3>[method:Integer randInt]( [param:Integer low], [param:Integer high] )</h3>
<p>Random integer in the interval [page:Float low] to [page:Float high].</p>
<p>在区间[page:Float low] 到 [page:Float high]随机一个整数。</p>
<h3>[method:Float smoothstep]( [param:Float x], [param:Float min], [param:Float max] )</h3>
<p>
[page:Float x] - The value to evaluate based on its position between min and max. <br />
[page:Float min] - Any x value below min will be 0.<br />
[page:Float max] - Any x value above max will be 1.<br /><br />
[page:Float x] - 根据其在最小值和最大值之间的位置来计算的值。 <br />
[page:Float min] - 任何x比最小值还小会返回0.<br />
[page:Float max] - 任何x比最大值还大会返回0.<br /><br />
Returns a value between 0-1 that represents the percentage that x has moved between min and max,
but smoothed or slowed down the closer X is to the min and max.<br/><br/>
返回0-1之间的值,该值表示x在最小值和最大值之间移动的百分比,但是当x接近最小值和最大值时,变化程度会平滑或减慢。<br/><br/>
See [link:http://en.wikipedia.org/wiki/Smoothstep Smoothstep] for details.
查看更多详情请移步到 [link:http://en.wikipedia.org/wiki/Smoothstep Smoothstep] 。
</p>
<h3>[method:Float smootherstep]( [param:Float x], [param:Float min], [param:Float max] )</h3>
<p>
[page:Float x] - The value to evaluate based on its position between min and max. <br />
[page:Float min] - Any x value below min will be 0.<br />
[page:Float max] - Any x value above max will be 1.<br /><br />
[page:Float x] - 根据其在最小值和最大值之间的位置来计算的值。 <br />
[page:Float min] - 任何x比最小值还小会返回0.<br />
[page:Float max] - 任何x比最大值还大会返回0.<br /><br />
Returns a value between 0-1. A [link:https://en.wikipedia.org/wiki/Smoothstep#Variations variation on smoothstep]
that has zero 1st and 2nd order derivatives at x=0 and x=1.
返回一个0-1之间的值。它和smoothstep相同,但变动更平缓。[link:https://en.wikipedia.org/wiki/Smoothstep#Variations variation on smoothstep] 在x=0和x=1处有0阶和二阶导数。
</p>
<h2>Source</h2>
......
......@@ -8,38 +8,37 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>三维矩阵([name])</h1>
<p class="desc">
A class representing a 3x3 [link:https://en.wikipedia.org/wiki/Matrix_(mathematics) matrix].
一个表示3X3矩阵[link:https://en.wikipedia.org/wiki/Matrix_(mathematics) matrix].的类。
</p>
<h2>Example</h2>
<h2>示例(Example)</h2>
<code>
var m = new Matrix3();
</code>
<h2>A Note on Row-Major and Column-Major Ordering</h2>
<h2>注意行优先列优先的顺序。</h2>
<p>
The [page:set]() method takes arguments in [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order row-major]
order, while internally they are stored in the [page:.elements elements] array in column-major order.<br /><br />
[page:set]()方法参数采用行优先[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order row-major],
而它们在内部是用列优先[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order column-major]顺序存储在数组当中。<br /><br />
This means that calling
这意味着
<code>
m.set( 11, 12, 13,
21, 22, 23,
31, 32, 33 );
</code>
will result in the [page:.elements elements] array containing:
元素数组[page:.elements elements]将存储为:
<code>
m.elements = [ 11, 21, 31,
12, 22, 32,
13, 23, 33 ];
</code>
and internally all calculations are performed using column-major ordering. However, as the actual ordering
makes no difference mathematically and most people are used to thinking about matrices in row-major order,
the three.js documentation shows matrices in row-major order. Just bear in mind that if you are reading the source
code, you'll have to take the [link:https://en.wikipedia.org/wiki/Transpose transpose] of any matrices outlined here to make sense of the calculations.
在内部,所有的计算都是使用列优先顺序进行的。然而,由于实际的排序在数学上没有什么不同,
而且大多数人习惯于以行优先顺序考虑矩阵,所以three.js文档以行为主的顺序显示矩阵。
请记住,如果您正在阅读源代码,您必须对这里列出的任何矩阵进行转置[link:https://en.wikipedia.org/wiki/Transpose transpose],以理解计算。
</p>
<h2>Constructor</h2>
......@@ -47,87 +46,81 @@ m.elements = [ 11, 21, 31,
<h3>[name]()</h3>
<p>
Creates and initializes the [name] to the 3x3
[link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix].
创建并初始化一个3X3的单位矩阵[link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix].
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Float32Array elements]</h3>
<p>
A [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order column-major]
list of matrix values.
矩阵列优先[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order column-major]列表。
</p>
<h3>[property:Boolean isMatrix3]</h3>
<p>
Used to check whether this or derived classes are Matrix3s. Default is *true*.<br /><br />
You should not change this, as it used internally for optimisation.
用于判定此对象或者此类的派生对象是否是三维矩阵。默认值为 *true*。<br /><br />
不应该改变该值,因为它在内部用于优化。
</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<h3>[method:Array applyToBufferAttribute]( [param:BufferAttribute attribute] )</h3>
<p>
[page:BufferAttribute attribute] - An attribute of floats that represent 3D vectors.<br /><br />
[page:BufferAttribute attribute] - 表示三维向量缓存属性。<br /><br />
Multiplies (applies) this matrix to every 3D vector in the [page:BufferAttribute attribute].
用这个矩阵乘以缓存属性[page:BufferAttribute attribute]里的所有3d向量。
</p>
<h3>[method:Matrix3 clone]()</h3>
<p>Creates a new Matrix3 and with identical elements to this one.</p>
<p>创建一个新的矩阵,元素 [page:.elements elements] 与该矩阵相同。</p>
<h3>[method:this copy]( [param:Matrix3 m] )</h3>
<p>Copies the elements of matrix [page:Matrix3 m] into this matrix.</p>
<p>将矩阵[page:Matrix3 m]的元素复制到当前矩阵中。</p>
<h3>[method:Float determinant]()</h3>
<p>
Computes and returns the
[link:https://en.wikipedia.org/wiki/Determinant determinant] of this matrix.
计算并返回矩阵的行列式[link:https://en.wikipedia.org/wiki/Determinant determinant] 。
</p>
<h3>[method:Boolean equals]( [param:Matrix3 m] )</h3>
<p>Return true if this matrix and [page:Matrix3 m] are equal.</p>
<p>如果矩阵[page:Matrix3 m] 与当前矩阵所有对应元素相同则返回true。</p>
<h3>[method:this fromArray]( [param:Array array], [param:Integer offset] )</h3>
<p>
[page:Array array] - the array to read the elements from.<br />
[page:Integer offset] - (optional) index of first element in the array. Default is 0.<br /><br />
[page:Array array] - 用来存储设置元素数据的数组<br />
[page:Integer offset] - (可选参数) 数组的偏移量,默认值为 0。<br /><br />
Sets the elements of this matrix based on an array in
[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] format.
使用基于列优先格式[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major]的数组来设置该矩阵。
</p>
<h3>[method:this getInverse]( [param:Matrix3 m], [param:Boolean throwOnDegenerate] )</h3>
<p>
[page:Matrix3 m] - the matrix to take the inverse of.<br />
[page:Boolean throwOnDegenerate] - (optional) If true, throw an error if the matrix is degenerate (not invertible).<br /><br />
Set this matrix to the [link:https://en.wikipedia.org/wiki/Invertible_matrix inverse] of the passed matrix [page:Matrix3 m],
using the [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution analytic method].
If [page:Boolean throwOnDegenerate] is not set and the matrix is not invertible, set this to the 3x3 identity matrix.
[page:Matrix3 m] - 取逆的矩阵。<br />
[page:Boolean throwOnDegenerate] - (optional) 如果设置为true,如果矩阵是退化的(如果不可逆的话),则会抛出一个错误。<br /><br />
使用逆矩阵计算方法[link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution analytic method],
将当前矩阵设置为给定矩阵的逆矩阵[link:https://en.wikipedia.org/wiki/Invertible_matrix inverse],如果[page:Boolean throwOnDegenerate]
参数没有设置且给定矩阵不可逆,那么将当前矩阵设置为3X3单位矩阵。
</p>
<h3>[method:this getNormalMatrix]( [param:Matrix4 m] )</h3>
<p>
[page:Matrix4 m] - [page:Matrix4]<br /><br />
Sets this matrix as the upper left 3x3 of the [link:https://en.wikipedia.org/wiki/Normal_matrix normal matrix]
of the passed [page:Matrix4 matrix4]. The normal matrix is the [link:https://en.wikipedia.org/wiki/Invertible_matrix inverse] [link:https://en.wikipedia.org/wiki/Transpose transpose]
of the matrix [page:Matrix4 m].
将这个矩阵设置为给定矩阵的正规矩阵[link:https://en.wikipedia.org/wiki/Normal_matrix normal matrix](左上角的3x3)。
正规矩阵是矩阵[page:Matrix4 m]的逆矩阵[link:https://en.wikipedia.org/wiki/Invertible_matrix inverse] 的转置[link:https://en.wikipedia.org/wiki/Transpose transpose]。
</p>
<h3>[method:this identity]()</h3>
<p>
Resets this matrix to the 3x3 identity matrix:
<code>
将此矩阵重置为3x3单位矩阵:
<code>
1, 0, 0
0, 1, 0
0, 0, 1
......@@ -136,22 +129,22 @@ m.elements = [ 11, 21, 31,
</p>
<h3>[method:this multiply]( [param:Matrix3 m] )</h3>
<p>Post-multiplies this matrix by [page:Matrix3 m].</p>
<p>将当前矩阵乘以矩阵[page:Matrix3 m]。</p>
<h3>[method:this multiplyMatrices]( [param:Matrix3 a], [param:Matrix3 b] )</h3>
<p>Sets this matrix to [page:Matrix3 a] x [page:Matrix3 b].</p>
<p>设置当前矩阵为矩阵[page:Matrix3 a] x 矩阵[page:Matrix3 b]。</p>
<h3>[method:this multiplyScalar]( [param:Float s] )</h3>
<p>Multiplies every component of the matrix by the scalar value *s*.</p>
<p>当前矩阵所有的元素乘以该缩放值*s*</p>
<h3>[method:this set]( [param:Float n11], [param:Float n12], [param:Float n13], [param:Float n21], [param:Float n22], [param:Float n23], [param:Float n31], [param:Float n32], [param:Float n33] )</h3>
<p>
[page:Float n11] - value to put in row 1, col 1.<br />
[page:Float n12] - value to put in row 1, col 2.<br />
[page:Float n11] - 设置第一行第一列的值。<br />
[page:Float n12] - 设置第一行第二列的值。<br />
...<br />
...<br />
[page:Float n32] - value to put in row 3, col 2.<br />
[page:Float n33] - value to put in row 3, col 3.<br /><br />
[page:Float n32] - 设置第三行第二列的值。<br />
[page:Float n33] - 设置第三行第三列的值。<br /><br />
Sets the 3x3 matrix values to the given
[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order row-major]
......@@ -159,45 +152,44 @@ m.elements = [ 11, 21, 31,
</p>
<h3>[method:this premultiply]( [param:Matrix3 m] )</h3>
<p>Pre-multiplies this matrix by [page:Matrix3 m].</p>
<p>将矩阵[page:Matrix3 m]乘以当前矩阵。</p>
<h3>[method:this setFromMatrix4]( [param:Matrix4 m] )</h3>
<p>Set this matrx to the upper 3x3 matrix of the Matrix4 [page:Matrix4 m].</p>
<p>将当前矩阵设置为4X4矩阵[page:Matrix4 m]左上3X3</p>
<h3>[method:this setUvTransform]( [param:Float tx], [param:Float ty], [param:Float sx], [param:Float sy], [param:Float rotation], [param:Float cx], [param:Float cy] )</h3>
<p>
[page:Float tx] - offset x<br />
[page:Float ty] - offset y<br />
[page:Float sx] - repeat x<br />
[page:Float sy] - repeat y<br />
[page:Float rotation] - rotation (in radians)<br />
[page:Float cx] - center x of rotation<br />
[page:Float cy] - center y of rotation<br /><br />
Sets the UV transform matrix from offset, repeat, rotation, and center.
[page:Float tx] - x偏移量<br />
[page:Float ty] - y偏移量<br />
[page:Float sx] - x方向的重复比例<br />
[page:Float sy] - y方向的重复比例<br />
[page:Float rotation] - 旋转(弧度)<br />
[page:Float cx] - 旋转中心x<br />
[page:Float cy] - 旋转中心y<br /><br />
使用偏移,重复,旋转和中心点位置设置UV变换矩阵。
</p>
<h3>[method:Array toArray]( [param:Array array], [param:Integer offset] )</h3>
<p>
[page:Array array] - (optional) array to store the resulting vector in. If not given a new array will be created.<br />
[page:Integer offset] - (optional) offset in the array at which to put the result.<br /><br />
[page:Array array] - (可选参数) 存储矩阵元素的数组,如果未指定会创建一个新的数组。<br />
[page:Integer offset] - (可选参数) 存放矩阵元素数组的偏移量。<br /><br />
Writes the elements of this matrix to an array in
[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] format.
使用列优先[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major]格式将此矩阵的元素写入数组中。
</p>
<h3>[method:this transpose]()</h3>
<p>[link:https://en.wikipedia.org/wiki/Transpose Transposes] this matrix in place.</p>
<p>将该矩阵转置[link:https://en.wikipedia.org/wiki/Transpose Transposes]。</p>
<h3>[method:this transposeIntoArray]( [param:Array array] )</h3>
<p>
[page:Array array] - array to store the resulting vector in.<br /><br />
[page:Array array] - 用于存储当前矩阵转置结果的数组。<br /><br />
[link:https://en.wikipedia.org/wiki/Transpose Transposes] this matrix into the supplied array,
and returns itself unchanged.
将当前矩阵的转置[link:https://en.wikipedia.org/wiki/Transpose Transposes]存入给定的数组[param:Array array]但不改变当前矩阵,
并返回当前矩阵。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
此差异已折叠。
......@@ -8,7 +8,7 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>平面([name])</h1>
<p class="desc">
A two dimensional surface that extends infinitely in 3d space, represented in [link:http://mathworld.wolfram.com/HessianNormalForm.html Hessian normal form]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册