Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
60f43847
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,发现更多精彩内容 >>
提交
60f43847
编写于
11月 18, 2011
作者:
J
John Pywtorak
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of github.com:AddictArts/three.js into dev
上级
1db29f18
62d2560b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
181 addition
and
2 deletion
+181
-2
src/core/Matrix4.js
src/core/Matrix4.js
+181
-2
未找到文件。
src/core/Matrix4.js
浏览文件 @
60f43847
...
...
@@ -275,7 +275,7 @@ THREE.Matrix4.prototype = {
tmp
=
this
.
n41
;
this
.
n41
=
this
.
n14
;
this
.
n14
=
tmp
;
tmp
=
this
.
n42
;
this
.
n42
=
this
.
n24
;
this
.
n24
=
tmp
;
tmp
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
43
=
tmp
;
tmp
=
this
.
n43
;
this
.
n43
=
this
.
n34
;
this
.
n
34
=
tmp
;
return
this
;
...
...
@@ -499,7 +499,7 @@ THREE.Matrix4.prototype = {
this
.
n24
=
n13
*
n24
*
n31
-
n14
*
n23
*
n31
+
n14
*
n21
*
n33
-
n11
*
n24
*
n33
-
n13
*
n21
*
n34
+
n11
*
n23
*
n34
;
this
.
n31
=
n22
*
n34
*
n41
-
n24
*
n32
*
n41
+
n24
*
n31
*
n42
-
n21
*
n34
*
n42
-
n22
*
n31
*
n44
+
n21
*
n32
*
n44
;
this
.
n32
=
n14
*
n32
*
n41
-
n12
*
n34
*
n41
-
n14
*
n31
*
n42
+
n11
*
n34
*
n42
+
n12
*
n31
*
n44
-
n11
*
n32
*
n44
;
this
.
n33
=
n1
3
*
n24
*
n41
-
n14
*
n22
*
n41
+
n14
*
n21
*
n42
-
n11
*
n24
*
n42
-
n12
*
n21
*
n44
+
n11
*
n22
*
n44
;
this
.
n33
=
n1
2
*
n24
*
n41
-
n14
*
n22
*
n41
+
n14
*
n21
*
n42
-
n11
*
n24
*
n42
-
n12
*
n21
*
n44
+
n11
*
n22
*
n44
;
this
.
n34
=
n14
*
n22
*
n31
-
n12
*
n24
*
n31
-
n14
*
n21
*
n32
+
n11
*
n24
*
n32
+
n12
*
n21
*
n34
-
n11
*
n22
*
n34
;
this
.
n41
=
n23
*
n32
*
n41
-
n22
*
n33
*
n41
-
n23
*
n31
*
n42
+
n21
*
n33
*
n42
+
n22
*
n31
*
n43
-
n21
*
n32
*
n43
;
this
.
n42
=
n12
*
n33
*
n41
-
n13
*
n32
*
n41
+
n13
*
n31
*
n42
-
n11
*
n33
*
n42
-
n12
*
n31
*
n43
+
n11
*
n32
*
n43
;
...
...
@@ -766,6 +766,185 @@ THREE.Matrix4.prototype = {
return
this
;
},
rotateByAxis
:
function
(
axis
,
angle
)
{
// optimize by checking axis
if
(
axis
.
x
===
1
&&
axis
.
y
===
0
&&
axis
.
z
===
0
)
{
return
this
.
rotateX
(
angle
);
}
else
if
(
axis
.
x
===
0
&&
axis
.
y
===
1
&&
axis
.
z
===
0
)
{
return
this
.
rotateY
(
angle
);
}
else
if
(
axis
.
x
===
0
&&
axis
.
y
===
0
&&
axis
.
z
===
1
)
{
return
this
.
rotateZ
(
angle
);
}
var
x
=
axis
.
x
,
y
=
axis
.
y
,
z
=
axis
.
z
,
n
=
Math
.
sqrt
(
x
*
x
+
y
*
y
+
z
*
z
);
x
/=
n
;
y
/=
n
;
z
/=
n
;
var
xx
=
x
*
x
,
yy
=
y
*
y
,
zz
=
z
*
z
,
c
=
Math
.
cos
(
angle
),
s
=
Math
.
sin
(
angle
),
oneMinusCosine
=
1
-
c
,
xy
=
x
*
y
*
oneMinusCosine
,
xz
=
x
*
z
*
oneMinusCosine
,
yz
=
y
*
z
*
oneMinusCosine
,
xs
=
x
*
s
,
ys
=
y
*
s
,
zs
=
z
*
s
,
r11
=
xx
+
(
1
-
xx
)
*
c
,
r21
=
xy
+
zs
,
r31
=
xz
-
ys
,
r12
=
xy
-
zs
,
r22
=
yy
+
(
1
-
yy
)
*
c
,
r32
=
yz
+
xs
,
r13
=
xz
+
ys
,
r23
=
yz
-
xs
,
r33
=
zz
+
(
1
-
zz
)
*
c
,
m11
=
this
.
n11
,
m21
=
this
.
n21
,
m31
=
this
.
n31
,
m41
=
this
.
n41
,
m12
=
this
.
n12
,
m22
=
this
.
n22
,
m32
=
this
.
n32
,
m42
=
this
.
n42
,
m13
=
this
.
n13
,
m23
=
this
.
n23
,
m33
=
this
.
n33
,
m43
=
this
.
n43
,
m14
=
this
.
n14
,
m24
=
this
.
n24
,
m34
=
this
.
n34
,
m44
=
this
.
n44
;
this
.
n11
=
r11
*
m11
+
r21
*
m12
+
r31
*
m13
;
this
.
n21
=
r11
*
m21
+
r21
*
m22
+
r31
*
m23
;
this
.
n31
=
r11
*
m31
+
r21
*
m32
+
r31
*
m33
;
this
.
n41
=
r11
*
m41
+
r21
*
m42
+
r31
*
m43
;
this
.
n12
=
r12
*
m11
+
r22
*
m12
+
r32
*
m13
;
this
.
n22
=
r12
*
m21
+
r22
*
m22
+
r32
*
m23
;
this
.
n32
=
r12
*
m31
+
r22
*
m32
+
r32
*
m33
;
this
.
n42
=
r12
*
m41
+
r22
*
m42
+
r32
*
m43
;
this
.
n13
=
r13
*
m11
+
r23
*
m12
+
r33
*
m13
;
this
.
n23
=
r13
*
m21
+
r23
*
m22
+
r33
*
m23
;
this
.
n33
=
r13
*
m31
+
r23
*
m32
+
r33
*
m33
;
this
.
n43
=
r13
*
m41
+
r23
*
m42
+
r33
*
m43
;
return
this
;
},
rotateX
:
function
(
angle
)
{
var
m12
=
this
.
n12
,
m22
=
this
.
n22
,
m32
=
this
.
n32
,
m42
=
this
.
n42
,
m13
=
this
.
n13
,
m23
=
this
.
n23
,
m33
=
this
.
n33
,
m43
=
this
.
n43
,
c
=
Math
.
cos
(
angle
),
s
=
Math
.
sin
(
angle
);
this
.
n12
=
c
*
m12
+
s
*
m13
;
this
.
n22
=
c
*
m22
+
s
*
m23
;
this
.
n32
=
c
*
m32
+
s
*
m33
;
this
.
n42
=
c
*
m42
+
s
*
m43
;
this
.
n13
=
c
*
m13
-
s
*
m12
;
this
.
n23
=
c
*
m23
-
s
*
m22
;
this
.
n33
=
c
*
m33
-
s
*
m32
;
this
.
n43
=
c
*
m43
-
s
*
m42
;
return
this
;
},
rotateY
:
function
(
angle
)
{
var
m11
=
this
.
n11
,
m21
=
this
.
n21
,
m31
=
this
.
n31
,
m41
=
this
.
n41
,
m13
=
this
.
n13
,
m23
=
this
.
n23
,
m33
=
this
.
n33
,
m43
=
this
.
n43
,
c
=
Math
.
cos
(
angle
),
s
=
Math
.
sin
(
angle
);
this
.
n11
=
c
*
m11
-
s
*
m13
;
this
.
n21
=
c
*
m21
-
s
*
m23
;
this
.
n31
=
c
*
m31
-
s
*
m33
;
this
.
n41
=
c
*
m41
-
s
*
m43
;
this
.
n13
=
c
*
m13
+
s
*
m11
;
this
.
n23
=
c
*
m23
+
s
*
m21
;
this
.
n33
=
c
*
m33
+
s
*
m31
;
this
.
n43
=
c
*
m43
+
s
*
m41
;
return
this
;
},
rotateZ
:
function
(
angle
)
{
var
m11
=
this
.
n11
,
m21
=
this
.
n21
,
m31
=
this
.
n31
,
m41
=
this
.
n41
,
m12
=
this
.
n12
,
m22
=
this
.
n22
,
m32
=
this
.
n32
,
m42
=
this
.
n42
,
c
=
Math
.
cos
(
angle
),
s
=
Math
.
sin
(
angle
);
this
.
n11
=
c
*
m11
+
s
*
m12
;
this
.
n21
=
c
*
m21
+
s
*
m22
;
this
.
n31
=
c
*
m31
+
s
*
m32
;
this
.
n41
=
c
*
m41
+
s
*
m42
;
this
.
n12
=
c
*
m12
-
s
*
m11
;
this
.
n22
=
c
*
m22
-
s
*
m21
;
this
.
n32
=
c
*
m32
-
s
*
m31
;
this
.
n42
=
c
*
m42
-
s
*
m41
;
return
this
;
},
translate
:
function
(
v
)
{
var
x
=
v
.
x
,
y
=
v
.
y
,
z
=
v
.
z
;
this
.
n14
=
this
.
n11
*
x
+
this
.
n12
*
y
+
this
.
n13
*
z
+
this
.
n14
;
this
.
n24
=
this
.
n21
*
x
+
this
.
n22
*
y
+
this
.
n23
*
z
+
this
.
n24
;
this
.
n34
=
this
.
n31
*
x
+
this
.
n32
*
y
+
this
.
n33
*
z
+
this
.
n34
;
this
.
n44
=
this
.
n41
*
x
+
this
.
n42
*
y
+
this
.
n43
*
z
+
this
.
n44
;
return
this
;
}
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录