Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
f0ef2532
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
提交
f0ef2532
编写于
8月 22, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merging with @timknip2's mater.
上级
4484dc3a
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
678 addition
and
388 deletion
+678
-388
build/Three.js
build/Three.js
+74
-72
examples/models/monster.jpg
examples/models/monster.jpg
+0
-0
examples/models/skin_and_morph.dae
examples/models/skin_and_morph.dae
+1
-1
examples/webgl_collada.html
examples/webgl_collada.html
+4
-2
src/core/Matrix4.js
src/core/Matrix4.js
+55
-1
src/core/Quaternion.js
src/core/Quaternion.js
+17
-0
src/extras/collada/dae.js
src/extras/collada/dae.js
+527
-312
未找到文件。
build/Three.js
浏览文件 @
f0ef2532
此差异已折叠。
点击以展开。
examples/models/monster.jpg
查看替换文件 @
4484dc3a
浏览文件 @
f0ef2532
85.5 KB
|
W:
|
H:
85.3 KB
|
W:
|
H:
2-up
Swipe
Onion skin
examples/models/skin_and_morph.dae
浏览文件 @
f0ef2532
...
...
@@ -359,7 +359,7 @@ A regular skin controller would point at a geometry we wanted to skin. In this
taking the output of a morph controller (which is geometry) and skinning that.
*******************************************************************************************
-->
<skin
source=
"#pCylinderShape1
-morph
"
>
<skin
source=
"#pCylinderShape1"
>
<!--
*******************************************************************************************
The bind shape matrix describes how to transform the pCylinderShape1-morph geometry into the
...
...
examples/webgl_collada.html
浏览文件 @
f0ef2532
...
...
@@ -6,7 +6,7 @@
<style
type=
"text/css"
>
body
{
font-family
:
Monospace
;
background-color
:
#
ffffff
;
background-color
:
#
000000
;
margin
:
0px
;
overflow
:
hidden
;
}
...
...
@@ -37,7 +37,9 @@
function
colladaReady
(
collada
)
{
dae
=
collada
.
scene
;
dae
.
scale
.
x
=
dae
.
scale
.
y
=
dae
.
scale
.
z
=
0.002
;
dae
.
scale
.
x
=
dae
.
scale
.
y
=
dae
.
scale
.
z
=
0.003
;
//dae.rotation.x = -Math.PI/2;
dae
.
updateMatrix
();
init
();
animate
();
...
...
src/core/Matrix4.js
浏览文件 @
f0ef2532
...
...
@@ -6,6 +6,7 @@
* @author D1plo1d / http://github.com/D1plo1d
* @author alteredq / http://alteredqualia.com/
* @author mikael emtinger / http://gomo.se/
* @author timknip / http://www.floorplanner.com/
*/
THREE
.
Matrix4
=
function
(
n11
,
n12
,
n13
,
n14
,
n21
,
n22
,
n23
,
n24
,
n31
,
n32
,
n33
,
n34
,
n41
,
n42
,
n43
,
n44
)
{
...
...
@@ -667,6 +668,59 @@ THREE.Matrix4.prototype = {
},
compose
:
function
(
translation
,
rotation
,
scale
)
{
var
mr
=
new
THREE
.
Matrix4
();
var
ms
=
new
THREE
.
Matrix4
();
mr
.
setRotationFromQuaternion
(
rotation
);
ms
.
setScale
(
scale
.
x
,
scale
.
y
,
scale
.
z
);
this
.
multiply
(
mr
,
ms
);
this
.
n14
=
translation
.
x
;
this
.
n24
=
translation
.
y
;
this
.
n34
=
translation
.
z
;
return
this
;
},
decompose
:
function
(
translation
,
rotation
,
scale
)
{
// grab the axis vecs
var
x
=
new
THREE
.
Vector3
(
this
.
n11
,
this
.
n21
,
this
.
n31
);
var
y
=
new
THREE
.
Vector3
(
this
.
n12
,
this
.
n22
,
this
.
n32
);
var
z
=
new
THREE
.
Vector3
(
this
.
n13
,
this
.
n23
,
this
.
n33
);
translation
=
(
translation
instanceof
THREE
.
Vector3
)
?
translation
:
new
THREE
.
Vector3
();
rotation
=
(
rotation
instanceof
THREE
.
Quaternion
)
?
rotation
:
new
THREE
.
Quaternion
();
scale
=
(
scale
instanceof
THREE
.
Vector3
)
?
scale
:
new
THREE
.
Vector3
();
scale
.
x
=
x
.
length
();
scale
.
y
=
y
.
length
();
scale
.
z
=
z
.
length
();
translation
.
x
=
this
.
n14
;
translation
.
y
=
this
.
n24
;
translation
.
z
=
this
.
n34
;
// scale the rotation part
var
matrix
=
this
.
clone
();
matrix
.
n11
/=
scale
.
x
;
matrix
.
n21
/=
scale
.
x
;
matrix
.
n31
/=
scale
.
x
;
matrix
.
n12
/=
scale
.
y
;
matrix
.
n22
/=
scale
.
y
;
matrix
.
n32
/=
scale
.
y
;
matrix
.
n13
/=
scale
.
z
;
matrix
.
n23
/=
scale
.
z
;
matrix
.
n33
/=
scale
.
z
;
rotation
.
setFromRotationMatrix
(
matrix
);
return
[
translation
,
rotation
,
scale
];
},
extractPosition
:
function
(
m
)
{
this
.
n14
=
m
.
n14
;
...
...
@@ -674,7 +728,7 @@ THREE.Matrix4.prototype = {
this
.
n34
=
m
.
n34
;
},
extractRotation
:
function
(
m
,
s
)
{
var
invScaleX
=
1
/
s
.
x
,
invScaleY
=
1
/
s
.
y
,
invScaleZ
=
1
/
s
.
z
;
...
...
src/core/Quaternion.js
浏览文件 @
f0ef2532
...
...
@@ -85,6 +85,23 @@ THREE.Quaternion.prototype = {
},
setFromRotationMatrix
:
function
(
m
)
{
// Adapted from: http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm
function
copySign
(
a
,
b
)
{
return
b
<
0
?
-
Math
.
abs
(
a
)
:
Math
.
abs
(
a
);
}
var
absQ
=
Math
.
pow
(
m
.
determinant
(),
1.0
/
3.0
);
this
.
w
=
Math
.
sqrt
(
Math
.
max
(
0
,
absQ
+
m
.
n11
+
m
.
n22
+
m
.
n33
)
)
/
2
;
this
.
x
=
Math
.
sqrt
(
Math
.
max
(
0
,
absQ
+
m
.
n11
-
m
.
n22
-
m
.
n33
)
)
/
2
;
this
.
y
=
Math
.
sqrt
(
Math
.
max
(
0
,
absQ
-
m
.
n11
+
m
.
n22
-
m
.
n33
)
)
/
2
;
this
.
z
=
Math
.
sqrt
(
Math
.
max
(
0
,
absQ
-
m
.
n11
-
m
.
n22
+
m
.
n33
)
)
/
2
;
this
.
x
=
copySign
(
this
.
x
,
(
m
.
n32
-
m
.
n23
)
);
this
.
y
=
copySign
(
this
.
y
,
(
m
.
n13
-
m
.
n31
)
);
this
.
z
=
copySign
(
this
.
z
,
(
m
.
n21
-
m
.
n12
)
);
this
.
normalize
();
return
this
;
},
calculateW
:
function
()
{
this
.
w
=
-
Math
.
sqrt
(
Math
.
abs
(
1.0
-
this
.
x
*
this
.
x
-
this
.
y
*
this
.
y
-
this
.
z
*
this
.
z
)
);
...
...
src/extras/collada/dae.js
浏览文件 @
f0ef2532
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录