Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
a1a88ebc
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,发现更多精彩内容 >>
提交
a1a88ebc
编写于
9月 03, 2015
作者:
B
Ben Houston
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updating examples to new Clip parsing inside of JSONLoader/ObjectLoader.
上级
10364f85
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
41 addition
and
16 deletion
+41
-16
examples/webgl_animation_skinning_blending.html
examples/webgl_animation_skinning_blending.html
+3
-4
examples/webgl_animation_skinning_morph.html
examples/webgl_animation_skinning_morph.html
+4
-4
src/animation/AnimationClip.js
src/animation/AnimationClip.js
+5
-5
src/animation/AnimationMixer.js
src/animation/AnimationMixer.js
+15
-0
src/loaders/JSONLoader.js
src/loaders/JSONLoader.js
+14
-3
未找到文件。
examples/webgl_animation_skinning_blending.html
浏览文件 @
a1a88ebc
...
...
@@ -221,10 +221,9 @@
controls
.
update
();
// Set default weights
blendMesh
.
animations
[
'
idle
'
].
weight
=
1
/
3
;
blendMesh
.
animations
[
'
walk
'
].
weight
=
1
/
3
;
blendMesh
.
animations
[
'
run
'
].
weight
=
1
/
3
;
blendMesh
.
applyWeight
(
'
idle
'
,
1
/
3
);
blendMesh
.
applyWeight
(
'
walk
'
,
1
/
3
);
blendMesh
.
applyWeight
(
'
run
'
,
1
/
3
);
gui
=
new
BlendCharacterGui
(
blendMesh
);
...
...
examples/webgl_animation_skinning_morph.html
浏览文件 @
a1a88ebc
...
...
@@ -232,12 +232,12 @@
helper
.
visible
=
false
;
scene
.
add
(
helper
);
var
clipMorpher
=
THREE
.
AnimationClip
.
CreateFromMorphTargetSequence
(
'
facialExpressions
'
,
mesh
.
geometry
.
morphTargets
,
3
);
var
clipBones
=
geometry
.
clips
[
0
];
mixer
=
new
THREE
.
AnimationMixer
(
mesh
);
var
clipMorpher
=
THREE
.
AnimationClip
.
CreateMorphAnimation
(
mesh
.
geometry
.
morphTargets
,
3
);
mixer
.
addAction
(
new
THREE
.
AnimationAction
(
clipMorpher
,
0
,
1
,
1
,
true
)
);
var
clipBones
=
geometry
.
clips
[
0
];
mixer
.
addAction
(
new
THREE
.
AnimationAction
(
clipBones
,
0
,
1
,
1
,
true
)
);
}
...
...
src/animation/AnimationClip.js
浏览文件 @
a1a88ebc
...
...
@@ -99,10 +99,10 @@ THREE.AnimationClip.CreateFromMorphTargetSequence = function( name, morphTargetS
});
}
tracks
.
push
(
new
THREE
.
NumberKeyframeTrack
(
'
.morphTargetInfluences[
'
+
morphTargetSequence
[
i
].
name
+
'
]
'
,
keys
)
);
tracks
.
push
(
new
THREE
.
NumberKeyframeTrack
(
'
.morphTargetInfluences[
'
+
morphTargetSequence
[
i
].
name
+
'
]
'
,
keys
)
.
scale
(
1.0
/
fps
)
);
}
return
new
THREE
.
AnimationClip
(
name
,
-
1
,
tracks
)
.
scale
(
1.0
/
fps
)
;
return
new
THREE
.
AnimationClip
(
name
,
-
1
,
tracks
);
};
...
...
@@ -148,7 +148,7 @@ THREE.AnimationClip.CreateClipsFromMorphTargetSequences = function( morphTargets
THREE
.
AnimationClip
.
parse
=
function
(
json
)
{
var
tracks
=
[];
for
(
var
i
=
0
;
i
<
json
.
tracks
.
length
;
i
++
)
{
tracks
.
push
(
THREE
.
KeyframeTrack
.
parse
(
json
.
tracks
[
i
]
).
scale
(
1.0
/
json
.
fps
)
);
...
...
@@ -160,8 +160,8 @@ THREE.AnimationClip.parse = function( json ) {
};
// parse the
old
animation.hierarchy format
THREE
.
AnimationClip
.
parseAnimation
Hierarchy
=
function
(
animation
,
bones
,
nodeName
)
{
// parse the animation.hierarchy format
THREE
.
AnimationClip
.
parseAnimation
=
function
(
animation
,
bones
,
nodeName
)
{
if
(
!
animation
)
{
console
.
error
(
"
no animation in JSONLoader data
"
);
...
...
src/animation/AnimationMixer.js
浏览文件 @
a1a88ebc
...
...
@@ -23,6 +23,8 @@ THREE.AnimationMixer.prototype = {
addAction
:
function
(
action
)
{
// TODO: check for duplicate action names? Or provide each action with a UUID?
this
.
actions
.
push
(
action
);
action
.
mixer
=
this
;
...
...
@@ -146,6 +148,19 @@ THREE.AnimationMixer.prototype = {
},
// can be optimized if needed
findActionByName
:
function
(
name
)
{
for
(
var
i
=
0
;
i
<
this
.
actions
.
length
;
i
++
)
{
if
(
this
.
actions
[
i
].
name
===
name
)
return
this
.
actions
[
i
];
}
return
null
;
},
play
:
function
(
action
,
optionalFadeInDuration
)
{
action
.
startTime
=
this
.
time
;
...
...
src/loaders/JSONLoader.js
浏览文件 @
a1a88ebc
...
...
@@ -425,11 +425,22 @@ THREE.JSONLoader.prototype = {
geometry
.
clips
=
[];
// parse old style Bone/Hierarchy animations
var
animation
=
json
.
animations
||
json
.
animation
;
var
animations
=
[];
if
(
json
.
animation
!==
undefined
)
{
animations
.
push
(
json
.
animation
);
}
if
(
json
.
animations
!==
undefined
)
{
if
(
json
.
animations
.
length
)
{
animations
=
animations
.
concat
(
json
.
animations
);
}
else
{
animations
.
push
(
json
.
animations
);
}
}
if
(
animation
)
{
for
(
var
i
=
0
;
i
<
animations
.
length
;
i
++
)
{
var
clip
=
THREE
.
AnimationClip
.
parseAnimation
Hierarchy
(
animation
,
geometry
.
bones
);
var
clip
=
THREE
.
AnimationClip
.
parseAnimation
(
animations
[
i
]
,
geometry
.
bones
);
if
(
clip
)
geometry
.
clips
.
push
(
clip
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录