Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
7aef64bd
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,发现更多精彩内容 >>
提交
7aef64bd
编写于
8月 15, 2017
作者:
M
Mr.doob
提交者:
GitHub
8月 15, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11955 from kaisalmen/OBJLoader2_material_assign_bug
WWOBJloader2 only applying first texture
上级
53f6e369
03428eaa
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
16 deletion
+14
-16
examples/js/loaders/OBJLoader2.js
examples/js/loaders/OBJLoader2.js
+13
-15
examples/js/loaders/WWOBJLoader2.js
examples/js/loaders/WWOBJLoader2.js
+1
-1
未找到文件。
examples/js/loaders/OBJLoader2.js
浏览文件 @
7aef64bd
...
...
@@ -15,7 +15,7 @@ if ( THREE.OBJLoader2 === undefined ) { THREE.OBJLoader2 = {} }
*/
THREE
.
OBJLoader2
=
(
function
()
{
var
OBJLOADER2_VERSION
=
'
1.4.
0
'
;
var
OBJLOADER2_VERSION
=
'
1.4.
1
'
;
function
OBJLoader2
(
manager
)
{
console
.
log
(
"
Using THREE.OBJLoader2 version:
"
+
OBJLOADER2_VERSION
);
...
...
@@ -476,7 +476,7 @@ THREE.OBJLoader2 = (function () {
*/
var
RawObject
=
(
function
()
{
function
RawObject
(
objectName
,
groupName
,
mtllib
Name
)
{
function
RawObject
(
objectName
,
groupName
,
activeMtl
Name
)
{
this
.
globalVertexOffset
=
1
;
this
.
globalUvOffset
=
1
;
this
.
globalNormalOffset
=
1
;
...
...
@@ -487,10 +487,9 @@ THREE.OBJLoader2 = (function () {
this
.
uvs
=
[];
// faces are stored according combined index of group, material and smoothingGroup (0 or not)
this
.
mtllibName
=
Validator
.
verifyInput
(
mtllib
Name
,
''
);
this
.
activeMtlName
=
Validator
.
verifyInput
(
activeMtl
Name
,
''
);
this
.
objectName
=
Validator
.
verifyInput
(
objectName
,
''
);
this
.
groupName
=
Validator
.
verifyInput
(
groupName
,
''
);
this
.
activeMtlName
=
''
;
this
.
activeSmoothingGroup
=
1
;
this
.
mtlCount
=
0
;
...
...
@@ -508,7 +507,7 @@ THREE.OBJLoader2 = (function () {
};
RawObject
.
prototype
.
newInstanceFromObject
=
function
(
objectName
,
groupName
)
{
var
newRawObject
=
new
RawObject
(
objectName
,
groupName
,
this
.
mtllib
Name
);
var
newRawObject
=
new
RawObject
(
objectName
,
groupName
,
this
.
activeMtl
Name
);
// move indices forward
newRawObject
.
globalVertexOffset
=
this
.
globalVertexOffset
+
this
.
vertices
.
length
/
3
;
...
...
@@ -519,7 +518,7 @@ THREE.OBJLoader2 = (function () {
};
RawObject
.
prototype
.
newInstanceFromGroup
=
function
(
groupName
)
{
var
newRawObject
=
new
RawObject
(
this
.
objectName
,
groupName
,
this
.
mtllib
Name
);
var
newRawObject
=
new
RawObject
(
this
.
objectName
,
groupName
,
this
.
activeMtl
Name
);
// keep current buffers and indices forward
newRawObject
.
vertices
=
this
.
vertices
;
...
...
@@ -618,7 +617,7 @@ THREE.OBJLoader2 = (function () {
}
// "f vertex/uv ..."
// "f vertex/uv ..."
}
else
if
(
bufferLength
===
slashesCount
*
2
)
{
for
(
i
=
3
;
i
<
bufferLength
-
2
;
i
+=
2
)
{
...
...
@@ -629,7 +628,7 @@ THREE.OBJLoader2 = (function () {
}
// "f vertex/uv/normal ..."
// "f vertex/uv/normal ..."
}
else
if
(
bufferLength
*
2
===
slashesCount
*
3
)
{
for
(
i
=
4
;
i
<
bufferLength
-
3
;
i
+=
3
)
{
...
...
@@ -640,7 +639,7 @@ THREE.OBJLoader2 = (function () {
}
// "f vertex//normal ..."
// "f vertex//normal ..."
}
else
{
for
(
i
=
3
;
i
<
bufferLength
-
2
;
i
+=
2
)
{
...
...
@@ -715,8 +714,7 @@ THREE.OBJLoader2 = (function () {
* Clear any empty rawObjectDescription and calculate absolute vertex, normal and uv counts
*/
RawObject
.
prototype
.
finalize
=
function
(
meshCreator
,
inputObjectCount
,
debug
)
{
var
temp
=
this
.
rawObjectDescriptions
;
this
.
rawObjectDescriptions
=
[];
var
temp
=
[];
var
rawObjectDescription
;
var
index
=
0
;
var
absoluteVertexCount
=
0
;
...
...
@@ -724,12 +722,12 @@ THREE.OBJLoader2 = (function () {
var
absoluteNormalCount
=
0
;
var
absoluteUvCount
=
0
;
for
(
var
name
in
t
emp
)
{
for
(
var
name
in
t
his
.
rawObjectDescriptions
)
{
rawObjectDescription
=
t
emp
[
name
];
rawObjectDescription
=
t
his
.
rawObjectDescriptions
[
name
];
if
(
rawObjectDescription
.
vertices
.
length
>
0
)
{
t
his
.
rawObjectDescriptions
[
index
++
]
=
rawObjectDescription
;
t
emp
[
index
++
]
=
rawObjectDescription
;
absoluteVertexCount
+=
rawObjectDescription
.
vertices
.
length
;
absoluteColorCount
+=
rawObjectDescription
.
colors
.
length
;
absoluteUvCount
+=
rawObjectDescription
.
uvs
.
length
;
...
...
@@ -744,7 +742,7 @@ THREE.OBJLoader2 = (function () {
if
(
debug
)
this
.
createReport
(
inputObjectCount
,
true
);
meshCreator
.
buildMesh
(
t
his
.
rawObjectDescriptions
,
t
emp
,
inputObjectCount
,
absoluteVertexCount
,
absoluteColorCount
,
...
...
examples/js/loaders/WWOBJLoader2.js
浏览文件 @
7aef64bd
...
...
@@ -15,7 +15,7 @@ if ( THREE.OBJLoader2 === undefined ) { THREE.OBJLoader2 = {} }
*/
THREE
.
OBJLoader2
.
WWOBJLoader2
=
(
function
()
{
var
WWOBJLOADER2_VERSION
=
'
1.4.
0
'
;
var
WWOBJLOADER2_VERSION
=
'
1.4.
1
'
;
var
Validator
=
THREE
.
OBJLoader2
.
prototype
.
_getValidator
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录