Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
48591ba8
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,发现更多精彩内容 >>
提交
48591ba8
编写于
1月 19, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Projector: Fixed morphtargets handling. Fixes #5933.
上级
e2d795c1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
45 deletion
+27
-45
examples/js/renderers/Projector.js
examples/js/renderers/Projector.js
+27
-45
未找到文件。
examples/js/renderers/Projector.js
浏览文件 @
48591ba8
...
...
@@ -471,76 +471,58 @@ THREE.Projector = function () {
_normalMatrix
.
getNormalMatrix
(
_modelMatrix
);
var
isFaceMaterial
=
object
.
material
instanceof
THREE
.
MeshFaceMaterial
;
var
material
=
object
.
material
;
var
isFaceMaterial
=
material
instanceof
THREE
.
MeshFaceMaterial
;
var
objectMaterials
=
isFaceMaterial
===
true
?
object
.
material
:
null
;
for
(
var
v
=
0
,
vl
=
vertices
.
length
;
v
<
vl
;
v
++
)
{
var
vertex
=
vertices
[
v
];
renderList
.
pushVertex
(
vertex
.
x
,
vertex
.
y
,
vertex
.
z
);
}
for
(
var
f
=
0
,
fl
=
faces
.
length
;
f
<
fl
;
f
++
)
{
var
face
=
faces
[
f
];
var
material
=
isFaceMaterial
===
true
?
objectMaterials
.
materials
[
face
.
materialIndex
]
:
object
.
material
;
if
(
material
===
undefined
)
continue
;
var
side
=
material
.
side
;
var
v1
=
_vertexPool
[
face
.
a
];
var
v2
=
_vertexPool
[
face
.
b
];
var
v3
=
_vertexPool
[
face
.
c
];
_vector3
.
copy
(
vertex
);
if
(
material
.
morphTargets
===
true
)
{
var
morphTargets
=
geometry
.
morphTargets
;
var
morphInfluences
=
object
.
morphTargetInfluences
;
var
v1p
=
v1
.
position
;
var
v2p
=
v2
.
position
;
var
v3p
=
v3
.
position
;
_vA
.
set
(
0
,
0
,
0
);
_vB
.
set
(
0
,
0
,
0
);
_vC
.
set
(
0
,
0
,
0
);
for
(
var
t
=
0
,
tl
=
morphTargets
.
length
;
t
<
tl
;
t
++
)
{
var
influence
=
morphInfluences
[
t
];
if
(
influence
===
0
)
continue
;
var
targets
=
morphTargets
[
t
].
vertices
;
var
target
=
morphTargets
[
t
];
var
targetVertex
=
target
.
vertices
[
v
];
_v
A
.
x
+=
(
targets
[
face
.
a
].
x
-
v1p
.
x
)
*
influence
;
_v
A
.
y
+=
(
targets
[
face
.
a
].
y
-
v1p
.
y
)
*
influence
;
_v
A
.
z
+=
(
targets
[
face
.
a
].
z
-
v1p
.
z
)
*
influence
;
_v
ector3
.
x
+=
(
targetVertex
.
x
-
vertex
.
x
)
*
influence
;
_v
ector3
.
y
+=
(
targetVertex
.
y
-
vertex
.
y
)
*
influence
;
_v
ector3
.
z
+=
(
targetVertex
.
z
-
vertex
.
z
)
*
influence
;
_vB
.
x
+=
(
targets
[
face
.
b
].
x
-
v2p
.
x
)
*
influence
;
_vB
.
y
+=
(
targets
[
face
.
b
].
y
-
v2p
.
y
)
*
influence
;
_vB
.
z
+=
(
targets
[
face
.
b
].
z
-
v2p
.
z
)
*
influence
;
}
_vC
.
x
+=
(
targets
[
face
.
c
].
x
-
v3p
.
x
)
*
influence
;
_vC
.
y
+=
(
targets
[
face
.
c
].
y
-
v3p
.
y
)
*
influence
;
_vC
.
z
+=
(
targets
[
face
.
c
].
z
-
v3p
.
z
)
*
influence
;
}
}
renderList
.
pushVertex
(
_vector3
.
x
,
_vector3
.
y
,
_vector3
.
z
);
}
v1
.
position
.
add
(
_vA
);
v2
.
position
.
add
(
_vB
);
v3
.
position
.
add
(
_vC
);
for
(
var
f
=
0
,
fl
=
faces
.
length
;
f
<
fl
;
f
++
)
{
renderList
.
projectVertex
(
v1
);
renderList
.
projectVertex
(
v2
);
renderList
.
projectVertex
(
v3
);
var
face
=
faces
[
f
];
}
var
material
=
isFaceMaterial
===
true
?
objectMaterials
.
materials
[
face
.
materialIndex
]
:
object
.
material
;
if
(
material
===
undefined
)
continue
;
var
side
=
material
.
side
;
var
v1
=
_vertexPool
[
face
.
a
];
var
v2
=
_vertexPool
[
face
.
b
];
var
v3
=
_vertexPool
[
face
.
c
];
if
(
renderList
.
checkTriangleVisibility
(
v1
,
v2
,
v3
)
===
false
)
continue
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录