Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
bf63085e
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,发现更多精彩内容 >>
提交
bf63085e
编写于
9月 10, 2017
作者:
H
Henrique Ferrolho
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Changes ColladaLoader2 joints datastructure from array to dict
上级
5404a034
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
1174 addition
and
15 deletion
+1174
-15
examples/js/loaders/ColladaLoader2.js
examples/js/loaders/ColladaLoader2.js
+5
-3
examples/models/collada/abb_irb52_7_120.dae
examples/models/collada/abb_irb52_7_120.dae
+1140
-0
examples/webgl_loader_collada_kinematics.html
examples/webgl_loader_collada_kinematics.html
+29
-12
未找到文件。
examples/js/loaders/ColladaLoader2.js
浏览文件 @
bf63085e
...
...
@@ -2214,7 +2214,7 @@ THREE.ColladaLoader.prototype = {
switch
(
child
.
nodeName
)
{
case
'
joint
'
:
data
.
joints
.
push
(
parseKinematicsJoint
(
child
)
);
data
.
joints
[
child
.
getAttribute
(
'
sid
'
)
]
=
parseKinematicsJoint
(
child
);
break
;
case
'
link
'
:
...
...
@@ -2452,7 +2452,9 @@ THREE.ColladaLoader.prototype = {
case
'
axis
'
:
var
param
=
child
.
getElementsByTagName
(
'
param
'
)[
0
];
data
.
axis
=
param
.
textContent
;
data
.
jointIndex
=
parseInt
(
data
.
axis
.
split
(
'
joint
'
).
pop
().
split
(
'
.
'
)[
0
]
);
var
tmpJointIndex
=
data
.
axis
.
split
(
'
inst_
'
).
pop
().
split
(
'
axis
'
)[
0
];
tmpJointIndex
=
tmpJointIndex
.
substr
(
0
,
tmpJointIndex
.
length
-
1
);
data
.
jointIndex
=
tmpJointIndex
;
break
;
}
...
...
@@ -2591,7 +2593,7 @@ THREE.ColladaLoader.prototype = {
// if there is a connection of the transform node with a joint, apply the joint value
if
(
transform
.
sid
&&
transform
.
sid
.
indexOf
(
'
joint
'
+
jointIndex
)
!==
-
1
)
{
if
(
transform
.
sid
&&
transform
.
sid
.
indexOf
(
jointIndex
)
!==
-
1
)
{
switch
(
joint
.
type
)
{
...
...
examples/models/collada/abb_irb52_7_120.dae
0 → 100644
浏览文件 @
bf63085e
此差异已折叠。
点击以展开。
examples/webgl_loader_collada_kinematics.html
浏览文件 @
bf63085e
...
...
@@ -58,7 +58,8 @@
var
loader
=
new
THREE
.
ColladaLoader
();
loader
.
options
.
convertUpAxis
=
true
;
loader
.
load
(
'
./models/collada/kawada-hironx.dae
'
,
function
(
collada
)
{
// loader.load( './models/collada/kawada-hironx.dae', function ( collada ) {
loader
.
load
(
'
./models/collada/abb_irb52_7_120.dae
'
,
function
(
collada
)
{
dae
=
collada
.
scene
;
...
...
@@ -135,17 +136,25 @@
var
target
=
{};
for
(
var
i
=
0
;
i
<
kinematics
.
joints
.
length
;
i
++
)
{
for
(
var
prop
in
kinematics
.
joints
)
{
var
joint
=
kinematics
.
joints
[
i
];
if
(
kinematics
.
joints
.
hasOwnProperty
(
prop
)
)
{
var
old
=
tweenParameters
[
i
];
if
(
!
kinematics
.
joints
[
prop
].
static
)
{
var
position
=
old
?
old
:
joint
.
zeroPosition
;
var
joint
=
kinematics
.
joints
[
prop
]
;
tweenParameters
[
i
]
=
position
;
var
old
=
tweenParameters
[
prop
]
;
target
[
i
]
=
THREE
.
Math
.
randInt
(
joint
.
limits
.
min
,
joint
.
limits
.
max
)
var
position
=
old
?
old
:
joint
.
zeroPosition
;
tweenParameters
[
prop
]
=
position
;
target
[
prop
]
=
THREE
.
Math
.
randInt
(
joint
.
limits
.
min
,
joint
.
limits
.
max
)
}
}
}
...
...
@@ -153,9 +162,17 @@
kinematicsTween
.
onUpdate
(
function
()
{
for
(
var
i
=
0
;
i
<
kinematics
.
joints
.
length
;
i
++
)
{
for
(
var
prop
in
kinematics
.
joints
)
{
if
(
kinematics
.
joints
.
hasOwnProperty
(
prop
)
)
{
if
(
!
kinematics
.
joints
[
prop
].
static
)
{
kinematics
.
setJointValue
(
prop
,
this
[
prop
]
);
}
kinematics
.
setJointValue
(
i
,
this
[
i
]
);
}
}
...
...
@@ -192,11 +209,11 @@
var
timer
=
Date
.
now
()
*
0.0001
;
camera
.
position
.
x
=
Math
.
cos
(
timer
)
*
17
;
camera
.
position
.
x
=
Math
.
cos
(
timer
)
*
20
;
camera
.
position
.
y
=
10
;
camera
.
position
.
z
=
Math
.
sin
(
timer
)
*
17
;
camera
.
position
.
z
=
Math
.
sin
(
timer
)
*
20
;
camera
.
lookAt
(
scene
.
position
);
camera
.
lookAt
(
new
THREE
.
Vector3
(
0
,
5
,
0
)
);
particleLight
.
position
.
x
=
Math
.
sin
(
timer
*
4
)
*
3009
;
particleLight
.
position
.
y
=
Math
.
cos
(
timer
*
5
)
*
4000
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录