Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
0825c1f6
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,发现更多精彩内容 >>
提交
0825c1f6
编写于
6月 24, 2011
作者:
A
Andrew Wason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add support for additional Euler rotation orders.
上级
89a4d0e5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
100 addition
and
13 deletion
+100
-13
src/core/Matrix4.js
src/core/Matrix4.js
+98
-12
src/core/Object3D.js
src/core/Object3D.js
+2
-1
未找到文件。
src/core/Matrix4.js
浏览文件 @
0825c1f6
...
...
@@ -532,30 +532,116 @@ THREE.Matrix4.prototype = {
},
setRotationFromEuler
:
function
(
v
)
{
setRotationFromEuler
:
function
(
v
,
order
)
{
var
x
=
v
.
x
,
y
=
v
.
y
,
z
=
v
.
z
,
a
=
Math
.
cos
(
x
),
b
=
Math
.
sin
(
x
),
c
=
Math
.
cos
(
y
),
d
=
Math
.
sin
(
y
),
e
=
Math
.
cos
(
z
),
f
=
Math
.
sin
(
z
),
ad
=
a
*
d
,
bd
=
b
*
d
;
e
=
Math
.
cos
(
z
),
f
=
Math
.
sin
(
z
);
this
.
n11
=
c
*
e
;
this
.
n12
=
-
c
*
f
;
this
.
n13
=
d
;
switch
(
order
)
{
case
'
YXZ
'
:
var
ce
=
c
*
e
,
cf
=
c
*
f
,
de
=
d
*
e
,
df
=
d
*
f
;
this
.
n21
=
bd
*
e
+
a
*
f
;
this
.
n22
=
-
bd
*
f
+
a
*
e
;
this
.
n23
=
-
b
*
c
;
this
.
n11
=
ce
+
df
*
b
;
this
.
n12
=
de
*
b
-
cf
;
this
.
n13
=
a
*
d
;
this
.
n31
=
-
ad
*
e
+
b
*
f
;
this
.
n32
=
ad
*
f
+
b
*
e
;
this
.
n33
=
a
*
c
;
this
.
n21
=
a
*
f
;
this
.
n22
=
a
*
e
;
this
.
n23
=
-
b
;
this
.
n31
=
cf
*
b
-
de
;
this
.
n32
=
df
+
ce
*
b
;
this
.
n33
=
a
*
c
;
break
;
case
'
ZXY
'
:
var
ce
=
c
*
e
,
cf
=
c
*
f
,
de
=
d
*
e
,
df
=
d
*
f
;
this
.
n11
=
ce
-
df
*
b
;
this
.
n12
=
-
a
*
f
;
this
.
n13
=
de
+
cf
*
b
;
this
.
n21
=
cf
+
de
*
b
;
this
.
n22
=
a
*
e
;
this
.
n23
=
df
-
ce
*
b
;
this
.
n31
=
-
a
*
d
;
this
.
n32
=
b
;
this
.
n33
=
a
*
c
;
break
;
case
'
ZYX
'
:
var
ae
=
a
*
e
,
af
=
a
*
f
,
be
=
b
*
e
,
bf
=
b
*
f
;
this
.
n11
=
c
*
e
;
this
.
n12
=
be
*
d
-
af
;
this
.
n13
=
ae
*
d
+
bf
;
this
.
n21
=
c
*
f
;
this
.
n22
=
bf
*
d
+
ae
;
this
.
n23
=
af
*
d
-
be
;
this
.
n31
=
-
d
;
this
.
n32
=
b
*
c
;
this
.
n33
=
a
*
c
;
break
;
case
'
YZX
'
:
var
ac
=
a
*
c
,
ad
=
a
*
d
,
bc
=
b
*
c
,
bd
=
b
*
d
;
this
.
n11
=
c
*
e
;
this
.
n12
=
bd
-
ac
*
f
;
this
.
n13
=
bc
*
f
+
ad
;
this
.
n21
=
f
;
this
.
n22
=
a
*
e
;
this
.
n23
=
-
b
*
e
;
this
.
n31
=
-
d
*
e
;
this
.
n32
=
ad
*
f
+
bc
;
this
.
n33
=
ac
-
bd
*
f
;
break
;
case
'
XZY
'
:
var
ac
=
a
*
c
,
ad
=
a
*
d
,
bc
=
b
*
c
,
bd
=
b
*
d
;
this
.
n11
=
c
*
e
;
this
.
n12
=
-
f
;
this
.
n13
=
d
*
e
;
this
.
n21
=
ac
*
f
+
bd
;
this
.
n22
=
a
*
e
;
this
.
n23
=
ad
*
f
-
bc
;
this
.
n31
=
bc
*
f
-
ad
;
this
.
n32
=
b
*
e
;
this
.
n33
=
bd
*
f
+
ac
;
break
;
default
:
// 'XYZ'
var
ae
=
a
*
e
,
af
=
a
*
f
,
be
=
b
*
e
,
bf
=
b
*
f
;
this
.
n11
=
c
*
e
;
this
.
n12
=
-
c
*
f
;
this
.
n13
=
d
;
this
.
n21
=
af
+
be
*
d
;
this
.
n22
=
ae
-
bf
*
d
;
this
.
n23
=
-
b
*
c
;
this
.
n31
=
bf
-
ae
*
d
;
this
.
n32
=
be
+
af
*
d
;
this
.
n33
=
a
*
c
;
break
;
}
return
this
;
},
setRotationFromQuaternion
:
function
(
q
)
{
var
x
=
q
.
x
,
y
=
q
.
y
,
z
=
q
.
z
,
w
=
q
.
w
,
...
...
src/core/Object3D.js
浏览文件 @
0825c1f6
...
...
@@ -13,6 +13,7 @@ THREE.Object3D = function() {
this
.
position
=
new
THREE
.
Vector3
();
this
.
rotation
=
new
THREE
.
Vector3
();
this
.
eulerOrder
=
'
XYZ
'
;
this
.
scale
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
dynamic
=
false
;
// when true it retains arrays so they can be updated with __dirty*
...
...
@@ -175,7 +176,7 @@ THREE.Object3D.prototype = {
}
else
{
this
.
matrix
.
setRotationFromEuler
(
this
.
rotation
);
this
.
matrix
.
setRotationFromEuler
(
this
.
rotation
,
this
.
eulerOrder
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录