Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
91614425
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
91614425
编写于
12月 01, 2016
作者:
L
looeee
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Alphabetixed Matrix4 doc
上级
5d91a9f4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
126 addition
and
91 deletion
+126
-91
docs/api/math/Matrix4.html
docs/api/math/Matrix4.html
+126
-91
未找到文件。
docs/api/math/Matrix4.html
浏览文件 @
91614425
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<body>
<body>
<h1>
[name]
</h1>
<h1>
[name]
</h1>
<div
class=
"desc"
>
A
4x4 Matrix
.
</div>
<div
class=
"desc"
>
A
class representing a 4x4 [link:https://en.wikipedia.org/wiki/Matrix_(mathematics) matrix]
.
</div>
<h2>
Example
</h2>
<h2>
Example
</h2>
...
@@ -42,148 +42,170 @@
...
@@ -42,148 +42,170 @@
<h3>
[name]()
</h3>
<h3>
[name]()
</h3>
<div>
<div>
Creates and initializes the matrix to the identity matrix.
Creates and initializes the [name] to the 4x4
</div>
[link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix].
</div>
<h2>
Properties
</h2>
<h2>
Properties
</h2>
<h3>
[property:Float32Array elements]
</h3>
<h3>
[property:Float32Array elements]
</h3>
<div>
A column-major list of matrix values.
</div>
<h2>
Methods
</h2>
<h3>
[method:Matrix4 set]( [page:Float n11], [page:Float n12], [page:Float n13], [page:Float n14], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n24], [page:Float n31], [page:Float n32], [page:Float n33], [page:Float n34], [page:Float n41], [page:Float n42], [page:Float n43], [page:Float n44] ) [page:Matrix4 this]
</h3>
<div>
<div>
Sets all fields of this matrix to the supplied row-major values n11..n44.
A [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major]
list of matrix values.
</div>
</div>
<h3>
[
method:Matrix4 identity]() [page:Matrix4 this
]
</h3>
<h3>
[
property:Boolean isMatrix4
]
</h3>
<div>
<div>
Resets this matrix to identity.
Used to check whether this or derived classes are Matrix4s. Default is *true*.
<br
/><br
/>
</div>
<h3>
[method:Matrix4 copy]( [page:Matrix4 m] ) [page:Matrix4 this]
</h3>
You should not change this, as it used internally for optimisation.
<div>
Copies the values of matrix *m* into this matrix.
</div>
</div>
<h3>
[method:Matrix4 fromArray]( [page:Array array], [page:Integer offset] ) [page:Matrix4 this]
</h3>
<h2>
Methods
</h2>
<h3>
[method:Array applyToBuffer]( [page:ArrayBuffer buffer], [page:Number offset], [page:Number length] )
</h3>
<div>
<div>
array -- [page:Array] The array to read the elements from.
<br
/>
[page:Array buffer] - An [link:https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer ArrayBuffer]
offset -- [page:Integer] optional offset into the array. Default is 0.
of floats in the form [vector1x, vector1y, vector1z, vector2x, vector2y, vector2z, ...], that represent 3D vectors.
<br
/>
>
[page:Number offset] - (optional) index in the array of the first vector's x component. Default is 0.
<br
/>
[page:Number length] - (optional) index in the array of the last vector's z component.
Default is the last element in the array.
<br
/><br
/>
Multiplies (applies) the upper 3x3 matrix of this matrix to every 3D vector in the [page:ArrayBuffer buffer].
</div>
</div>
<h3>
[method:Array applyToVector3Array]( [page:Array array], [page:Number offset], [page:Number length] )
</h3>
<div>
<div>
Sets the elements of this matrix based on an array in column-major format.
[page:Array array] - An array of floats in the form [vector1x, vector1y, vector1z, vector2x, vector2y, vector2z, ...],
that represent 3D vectors.
<br
/>
>
[page:Number offset] - (optional) index in the array of the first vector's x component. Default is 0.
<br
/>
[page:Number length] - (optional) index in the array of the last vector's z component.
Default is the last element in the array.
<br
/><br
/>
Multiplies (applies) the upper 3x3 matrix of this matrix to every 3D vector in the [page:Array array].
</div>
</div>
<h3>
[method:Matrix4 copyPosition]( [page:Matrix4 m] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4 clone]()
</h3>
<div>
Creates a new Matrix4 and with identical elements to this one.
</div>
<h3>
[method:Matrix4 compose]( [page:Vector3 translation], [page:Quaternion quaternion], [page:Vector3 scale] )
</h3>
<div>
<div>
Copies the translation component of the supplied matrix *m* into this matrix translation component
.
Sets this matrix to the transformation composed of [page:Vector3 translation], [page:Quaternion quaternion] and [page:Vector3 scale]
.
</div>
</div>
<h3>
[method:Matrix4 makeBasis]( [page:Vector3 xAxis], [page:Vector3 yAxis], [page:Vector3 zAxis] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4 copy]( [page:Matrix4 m] )
</h3>
<div>
Copies the elements of matrix [page:Matrix4 m] into this matrix.
</div>
<h3>
[method:Matrix4 copyPosition]( [page:Matrix4 m] )
</h3>
<div>
<div>
C
reates the basis matrix consisting of the three provided axis vectors. Returns the current matrix
.
C
opies the translation component of the supplied matrix *m* into this matrix's translation component
.
</div>
</div>
<h3>
[method:
Matrix4 extractBasis]( [page:Vector3 xAxis], [page:Vector3 yAxis], [page:Vector3 zAxis] ) [page:Matrix4 this]
</h3>
<h3>
[method:
null decompose]( [page:Vector3 translation], [page:Quaternion quaternion], [page:Vector3 scale] )
</h3>
<div>
<div>
Extracts basis of into the three axis vectors provided. Returns the current matrix
.
Decomposes this matrix into the *translation*, *quaternion* and *scale* components
.
</div>
</div>
<h3>
[method:
Matrix4 extractRotation]( [page:Matrix4 m] ) [page:Matrix4 this]
</h3>
<h3>
[method:
Float determinant]()
</h3>
<div>
<div>
Extracts the rotation of the supplied matrix *m* into this matrix rotation component.
Computes and returns the determinant of this matrix.
<br
/>
Based on [link:http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm]
</div>
</div>
<h3>
[method:Matrix4 lookAt]( [page:Vector3 eye], [page:Vector3 center], [page:Vector3 up], ) [page:Matrix4 this]
</h3>
<h3>
[method:Boolean equals]( [page:Matrix4 m] )
</h3>
<div>
Return true if this and [page:Matrix4 m] are equals.
</div>
<h3>
[method:Matrix4 extractBasis]( [page:Vector3 xAxis], [page:Vector3 yAxis], [page:Vector3 zAxis] )
</h3>
<div>
<div>
Constructs a rotation matrix, looking from *eye* towards *center* with defined *up* vector
.
Extracts basis of into the three axis vectors provided. Returns the current matrix
.
</div>
</div>
<h3>
[method:Matrix4
multiply]( [page:Matrix4 m] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4
extractRotation]( [page:Matrix4 m] )
</h3>
<div>
<div>
Post-multiplies this matrix by *m*
.
Extracts the rotation of the supplied matrix *m* into this matrix rotation component
.
</div>
</div>
<h3>
[method:Matrix4
premultiply]( [page:Matrix4 m] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4
fromArray]( [page:Array array], [page:Integer offset] )
</h3>
<div>
<div>
Pre-multiplies this matrix by *m*.
array -- [page:Array] The array to read the elements from.
<br
/>
offset -- [page:Integer] optional offset into the array. Default is 0.
</div>
</div>
<h3>
[method:Matrix4 multiplyMatrices]( [page:Matrix4 a], [page:Matrix4 b] ) [page:Matrix4 this]
</h3>
<div>
<div>
Sets th
is matrix to *a x b*
.
Sets th
e elements of this matrix based on an array in column-major format
.
</div>
</div>
<h3>
[method:Matrix4
multiplyToArray]( [page:Matrix4 a], [page:Matrix4 b], [page:Array r] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4
getInverse]( [page:Matrix4 m] )
</h3>
<div>
<div>
Sets this matrix to
*a x b* and stores the result into the flat array *r
*.
<br
/>
Sets this matrix to
the inverse of matrix *m
*.
<br
/>
*r* can be either a regular Array or a TypedArray
.
Based on [link:http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm]
.
</div>
</div>
<h3>
[method:
Matrix4 multiplyScalar]( [page:Float s] ) [page:Matrix4 this]
</h3>
<h3>
[method:
Float getMaxScaleOnAxis]()
</h3>
<div>
<div>
Multiplies every component of the matrix by a scalar value *s*
.
Gets the maximum scale value of the 3 axes
.
</div>
</div>
<h3>
[method:
Float determinant]() [page:Matrix4 this]
</h3>
<h3>
[method:
Matrix4 identity]()
</h3>
<div>
<div>
Computes and returns the determinant of this matrix.
<br
/>
Resets this matrix to identity.
Based on [link:http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm]
</div>
</div>
<h3>
[method:Matrix4
transpose]() [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4
lookAt]( [page:Vector3 eye], [page:Vector3 center], [page:Vector3 up], )
</h3>
<div>
<div>
Transposes this matrix
.
Constructs a rotation matrix, looking from *eye* towards *center* with defined *up* vector
.
</div>
</div>
<h3>
[method:Matrix4
setPosition]( [page:Vector3 v] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4
makeRotationAxis]( [page:Vector3 axis], [page:Float theta] )
</h3>
<div>
<div>
Sets the position component for this matrix from vector *v*.
axis — Rotation axis, should be normalized.
theta — Rotation angle in radians.
</div>
</div>
<h3>
[method:Matrix4 getInverse]( [page:Matrix4 m] ) [page:Matrix4 this]
</h3>
<div>
<div>
Sets this matrix
to the inverse of matrix *m*
.
<br
/>
Sets this matrix
as rotation transform around *axis* by *angle* radians
.
<br
/>
Based on [link:http://www.
euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm
].
Based on [link:http://www.
gamedev.net/reference/articles/article1199.asp
].
</div>
</div>
<h3>
[method:Matrix4 make
RotationFromEuler]( [page:Euler euler] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4 make
Basis]( [page:Vector3 xAxis], [page:Vector3 yAxis], [page:Vector3 zAxis] )
</h3>
<div>
<div>
euler — Rotation vector followed by order of rotations, e.g., "XYZ"
.
Creates the basis matrix consisting of the three provided axis vectors. Returns the current matrix
.
</div>
</div>
<h3>
[method:Matrix4 makeFrustum]( [page:Float left], [page:Float right], [page:Float bottom], [page:Float top], [page:Float near], [page:Float far] )
</h3>
<div>
<div>
Sets the rotation submatrix of this matrix to the rotation specified by Euler angles, the rest of the matrix is identity.
<br
/>
Creates a [page:Frustum frustum] matrix.
Default order is *"XYZ"*.
</div>
</div>
<h3>
[method:Matrix4 make
RotationFromQuaternion]( [page:Quaternion q] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4 make
Orthographic]( [page:Float left], [page:Float right], [page:Float top], [page:Float bottom], [page:Float near], [page:Float far] )
</h3>
<div>
<div>
Sets the rotation submatrix of this matrix to the rotation specified by *q*. The rest of the matrix is identity
.
Creates an orthographic projection matrix
.
</div>
</div>
<h3>
[method:Matrix4
scale]( [page:Vector3 v] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4
makePerspective]( [page:Float fov], [page:Float aspect], [page:Float near], [page:Float far] )
</h3>
<div>
<div>
Multiplies the columns of this matrix by vector *v*
.
Creates a perspective projection matrix
.
</div>
</div>
<h3>
[method:Matrix4
compose]( [page:Vector3 translation], [page:Quaternion quaternion], [page:Vector3 scale] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4
makeRotationFromEuler]( [page:Euler euler] )
</h3>
<div>
<div>
Sets this matrix to the transformation composed of *translation*, *quaternion* and *scale*
.
euler — Rotation vector followed by order of rotations, e.g., "XYZ"
.
</div>
</div>
<h3>
[method:null decompose]( [page:Vector3 translation], [page:Quaternion quaternion], [page:Vector3 scale] ) [page:Matrix4 this]
</h3>
<div>
<div>
Decomposes this matrix into the *translation*, *quaternion* and *scale* components.
Sets the rotation submatrix of this matrix to the rotation specified by Euler angles, the rest of the matrix is identity.
<br
/>
Default order is *"XYZ"*.
</div>
</div>
<h3>
[method:Matrix4 make
Translation]( [page:Float x], [page:Float y], [page:Float z] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4 make
RotationFromQuaternion]( [page:Quaternion q] )
</h3>
<div>
<div>
Sets th
is matrix as translation transform
.
Sets th
e rotation submatrix of this matrix to the rotation specified by *q*. The rest of the matrix is identity
.
</div>
</div>
<h3>
[method:Matrix4 makeRotationX]( [page:Float theta] )
[page:Matrix4 this]
</h3>
<h3>
[method:Matrix4 makeRotationX]( [page:Float theta] )
</h3>
<div>
<div>
theta — Rotation angle in radians.
theta — Rotation angle in radians.
</div>
</div>
...
@@ -191,7 +213,7 @@
...
@@ -191,7 +213,7 @@
Sets this matrix as rotation transform around x axis by *theta* radians.
Sets this matrix as rotation transform around x axis by *theta* radians.
</div>
</div>
<h3>
[method:Matrix4 makeRotationY]( [page:Float theta] )
[page:Matrix4 this]
</h3>
<h3>
[method:Matrix4 makeRotationY]( [page:Float theta] )
</h3>
<div>
<div>
theta — Rotation angle in radians.
theta — Rotation angle in radians.
</div>
</div>
...
@@ -199,7 +221,7 @@
...
@@ -199,7 +221,7 @@
Sets this matrix as rotation transform around y axis by *theta* radians.
Sets this matrix as rotation transform around y axis by *theta* radians.
</div>
</div>
<h3>
[method:Matrix4 makeRotationZ]( [page:Float theta] )
[page:Matrix4 this]
</h3>
<h3>
[method:Matrix4 makeRotationZ]( [page:Float theta] )
</h3>
<div>
<div>
theta — Rotation angle in radians.
theta — Rotation angle in radians.
</div>
</div>
...
@@ -207,55 +229,63 @@
...
@@ -207,55 +229,63 @@
Sets this matrix as rotation transform around z axis by *theta* radians.
Sets this matrix as rotation transform around z axis by *theta* radians.
</div>
</div>
<h3>
[method:Matrix4 make
RotationAxis]( [page:Vector3 axis], [page:Float theta] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4 make
Scale]( [page:Float x], [page:Float y], [page:Float z] )
</h3>
<div>
<div>
axis — Rotation axis, should be normalized.
Sets this matrix as scale transform.
theta — Rotation angle in radians.
</div>
</div>
<h3>
[method:Matrix4 makeShear]( [page:Float x], [page:Float y], [page:Float z] )
</h3>
<div>
<div>
Sets this matrix as rotation transform around *axis* by *angle* radians.
<br
/>
Sets this matrix as shear transform.
Based on [link:http://www.gamedev.net/reference/articles/article1199.asp].
</div>
</div>
<h3>
[method:Matrix4 make
Scale]( [page:Float x], [page:Float y], [page:Float z] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4 make
Translation]( [page:Float x], [page:Float y], [page:Float z] )
</h3>
<div>
<div>
Sets this matrix as
scale
transform.
Sets this matrix as
translation
transform.
</div>
</div>
<h3>
[method:Matrix4 m
akeFrustum]( [page:Float left], [page:Float right], [page:Float bottom], [page:Float top], [page:Float near], [page:Float far] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4 m
ultiply]( [page:Matrix4 m] )
</h3>
<div>
<div>
Creates a [page:Frustum frustum] matrix
.
Post-multiplies this matrix by *m*
.
</div>
</div>
<h3>
[method:Matrix4 m
akePerspective]( [page:Float fov], [page:Float aspect], [page:Float near], [page:Float far] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4 m
ultiplyMatrices]( [page:Matrix4 a], [page:Matrix4 b] )
</h3>
<div>
<div>
Creates a perspective projection matrix
.
Sets this matrix to *a x b*
.
</div>
</div>
<h3>
[method:Matrix4 m
akeOrthographic]( [page:Float left], [page:Float right], [page:Float top], [page:Float bottom], [page:Float near], [page:Float far] ) [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4 m
ultiplyScalar]( [page:Float s] )
</h3>
<div>
<div>
Creates an orthographic projection matrix.
Multiplies every component of the matrix by a scalar value *s*.
</div>
<h3>
[method:Matrix4 multiplyToArray]( [page:Matrix4 a], [page:Matrix4 b], [page:Array r] )
</h3>
<div>
Sets this matrix to *a x b* and stores the result into the flat array *r*.
<br
/>
*r* can be either a regular Array or a TypedArray.
</div>
</div>
<h3>
[method:
Array applyToVector3Array]( [page:Array a] ) [page:Matrix4 this]
</h3>
<h3>
[method:
Matrix4 premultiply]( [page:Matrix4 m] )
</h3>
<div>
<div>
array -- An array in the form [vector1x, vector1y, vector1z, vector2x, vector2y, vector2z, ...]
Pre-multiplies this matrix by *m*.
</div>
</div>
<h3>
[method:Matrix4 scale]( [page:Vector3 v] )
</h3>
<div>
<div>
Multiplies
(applies) this matrix to every vector3 in the array
.
Multiplies
the columns of this matrix by vector *v*
.
</div>
</div>
<h3>
[method:
Float getMaxScaleOnAxis]() [page:Matrix4 this]
</h3>
<h3>
[method:
Matrix4 set]( [page:Float n11], [page:Float n12], [page:Float n13], [page:Float n14], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n24], [page:Float n31], [page:Float n32], [page:Float n33], [page:Float n34], [page:Float n41], [page:Float n42], [page:Float n43], [page:Float n44] )
</h3>
<div>
<div>
Gets the maximum scale value of the 3 axes
.
Sets all fields of this matrix to the supplied row-major values n11..n44
.
</div>
</div>
<h3>
[method:Matrix4
clone]() [page:Matrix4 this]
</h3>
<h3>
[method:Matrix4
setPosition]( [page:Vector3 v] )
</h3>
<div>
<div>
Creates a copy of this matrix
.
Sets the position component for this matrix from vector *v*
.
</div>
</div>
<h3>
[method:Array toArray]( [page:Array array], [page:Integer offset] )
[page:Matrix4 this]
</h3>
<h3>
[method:Array toArray]( [page:Array array], [page:Integer offset] )
</h3>
<div>
<div>
array -- [page:Array] optional array to store the vector
<br
/>
array -- [page:Array] optional array to store the vector
<br
/>
offset -- [page:Integer] optional offset into the array
offset -- [page:Integer] optional offset into the array
...
@@ -264,6 +294,11 @@
...
@@ -264,6 +294,11 @@
Writes the elements of this matrix to an array in column-major format.
Writes the elements of this matrix to an array in column-major format.
</div>
</div>
<h3>
[method:Matrix4 transpose]()
</h3>
<div>
Transposes this matrix.
</div>
<h2>
Source
</h2>
<h2>
Source
</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录