Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
261869ac
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,发现更多精彩内容 >>
提交
261869ac
编写于
11月 15, 2012
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed remaining traces of geometry.materials
上级
ec9f9971
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
2 addition
and
86 deletion
+2
-86
build/three.js
build/three.js
+0
-42
build/three.min.js
build/three.min.js
+2
-2
src/core/Geometry.js
src/core/Geometry.js
+0
-2
src/extras/GeometryUtils.js
src/extras/GeometryUtils.js
+0
-40
未找到文件。
build/three.js
浏览文件 @
261869ac
...
@@ -4992,8 +4992,6 @@ THREE.Geometry = function () {
...
@@ -4992,8 +4992,6 @@ THREE.Geometry = function () {
this.colors = []; // one-to-one vertex colors, used in ParticleSystem, Line and Ribbon
this.colors = []; // one-to-one vertex colors, used in ParticleSystem, Line and Ribbon
this.normals = []; // one-to-one vertex normals, used in Ribbon
this.normals = []; // one-to-one vertex normals, used in Ribbon
this.materials = [];
this.faces = [];
this.faces = [];
this.faceUvs = [[]];
this.faceUvs = [[]];
...
@@ -22817,18 +22815,6 @@ THREE.GeometryUtils = {
...
@@ -22817,18 +22815,6 @@ THREE.GeometryUtils = {
uvs1 = geometry1.faceVertexUvs[ 0 ],
uvs1 = geometry1.faceVertexUvs[ 0 ],
uvs2 = geometry2.faceVertexUvs[ 0 ];
uvs2 = geometry2.faceVertexUvs[ 0 ];
/*
var geo1MaterialsMap = {};
for ( var i = 0; i < geometry1.materials.length; i ++ ) {
var id = geometry1.materials[ i ].id;
geo1MaterialsMap[ id ] = i;
}
*/
if ( object2 instanceof THREE.Mesh ) {
if ( object2 instanceof THREE.Mesh ) {
object2.matrixAutoUpdate && object2.updateMatrix();
object2.matrixAutoUpdate && object2.updateMatrix();
...
@@ -22896,24 +22882,6 @@ THREE.GeometryUtils = {
...
@@ -22896,24 +22882,6 @@ THREE.GeometryUtils = {
if ( face.materialIndex !== undefined ) {
if ( face.materialIndex !== undefined ) {
/*
var material2 = geometry2.materials[ face.materialIndex ];
var materialId2 = material2.id;
var materialIndex = geo1MaterialsMap[ materialId2 ];
if ( materialIndex === undefined ) {
materialIndex = geometry1.materials.length;
geo1MaterialsMap[ materialId2 ] = materialIndex;
geometry1.materials.push( material2 );
}
faceCopy.materialIndex = materialIndex;
*/
faceCopy.materialIndex = face.materialIndex;
faceCopy.materialIndex = face.materialIndex;
}
}
...
@@ -22953,16 +22921,6 @@ THREE.GeometryUtils = {
...
@@ -22953,16 +22921,6 @@ THREE.GeometryUtils = {
faces = geometry.faces,
faces = geometry.faces,
uvs = geometry.faceVertexUvs[ 0 ];
uvs = geometry.faceVertexUvs[ 0 ];
/*
// materials
if ( geometry.materials ) {
cloneGeo.materials = geometry.materials.slice();
}
*/
// vertices
// vertices
for ( i = 0, il = vertices.length; i < il; i ++ ) {
for ( i = 0, il = vertices.length; i < il; i ++ ) {
...
...
build/three.min.js
浏览文件 @
261869ac
...
@@ -103,8 +103,8 @@ THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.
...
@@ -103,8 +103,8 @@ THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.
return
a
}};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
f
,
g
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
color
=
f
instanceof
THREE
.
Color
?
f
:
new
THREE
.
Color
;
this
.
vertexColors
=
f
instanceof
Array
?
f
:[];
this
.
vertexTangents
=
[];
this
.
materialIndex
=
g
;
this
.
centroid
=
new
THREE
.
Vector3
};
return
a
}};
THREE
.
Face4
=
function
(
a
,
b
,
c
,
d
,
e
,
f
,
g
){
this
.
a
=
a
;
this
.
b
=
b
;
this
.
c
=
c
;
this
.
d
=
d
;
this
.
normal
=
e
instanceof
THREE
.
Vector3
?
e
:
new
THREE
.
Vector3
;
this
.
vertexNormals
=
e
instanceof
Array
?
e
:[];
this
.
color
=
f
instanceof
THREE
.
Color
?
f
:
new
THREE
.
Color
;
this
.
vertexColors
=
f
instanceof
Array
?
f
:[];
this
.
vertexTangents
=
[];
this
.
materialIndex
=
g
;
this
.
centroid
=
new
THREE
.
Vector3
};
THREE
.
Face4
.
prototype
=
{
constructor
:
THREE
.
Face4
,
clone
:
function
(){
var
a
=
new
THREE
.
Face4
(
this
.
a
,
this
.
b
,
this
.
c
,
this
.
d
);
a
.
normal
.
copy
(
this
.
normal
);
a
.
color
.
copy
(
this
.
color
);
a
.
centroid
.
copy
(
this
.
centroid
);
a
.
materialIndex
=
this
.
materialIndex
;
var
b
,
c
;
b
=
0
;
for
(
c
=
this
.
vertexNormals
.
length
;
b
<
c
;
b
++
)
a
.
vertexNormals
[
b
]
=
this
.
vertexNormals
[
b
].
clone
();
b
=
0
;
for
(
c
=
this
.
vertexColors
.
length
;
b
<
c
;
b
++
)
a
.
vertexColors
[
b
]
=
this
.
vertexColors
[
b
].
clone
();
b
=
0
;
for
(
c
=
this
.
vertexTangents
.
length
;
b
<
c
;
b
++
)
a
.
vertexTangents
[
b
]
=
this
.
vertexTangents
[
b
].
clone
();
THREE
.
Face4
.
prototype
=
{
constructor
:
THREE
.
Face4
,
clone
:
function
(){
var
a
=
new
THREE
.
Face4
(
this
.
a
,
this
.
b
,
this
.
c
,
this
.
d
);
a
.
normal
.
copy
(
this
.
normal
);
a
.
color
.
copy
(
this
.
color
);
a
.
centroid
.
copy
(
this
.
centroid
);
a
.
materialIndex
=
this
.
materialIndex
;
var
b
,
c
;
b
=
0
;
for
(
c
=
this
.
vertexNormals
.
length
;
b
<
c
;
b
++
)
a
.
vertexNormals
[
b
]
=
this
.
vertexNormals
[
b
].
clone
();
b
=
0
;
for
(
c
=
this
.
vertexColors
.
length
;
b
<
c
;
b
++
)
a
.
vertexColors
[
b
]
=
this
.
vertexColors
[
b
].
clone
();
b
=
0
;
for
(
c
=
this
.
vertexTangents
.
length
;
b
<
c
;
b
++
)
a
.
vertexTangents
[
b
]
=
this
.
vertexTangents
[
b
].
clone
();
return
a
}};
THREE
.
UV
=
function
(
a
,
b
){
this
.
u
=
a
||
0
;
this
.
v
=
b
||
0
};
THREE
.
UV
.
prototype
=
{
constructor
:
THREE
.
UV
,
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
u
=
a
.
u
;
this
.
v
=
a
.
v
;
return
this
},
lerpSelf
:
function
(
a
,
b
){
this
.
u
+=
(
a
.
u
-
this
.
u
)
*
b
;
this
.
v
+=
(
a
.
v
-
this
.
v
)
*
b
;
return
this
},
clone
:
function
(){
return
new
THREE
.
UV
(
this
.
u
,
this
.
v
)}};
return
a
}};
THREE
.
UV
=
function
(
a
,
b
){
this
.
u
=
a
||
0
;
this
.
v
=
b
||
0
};
THREE
.
UV
.
prototype
=
{
constructor
:
THREE
.
UV
,
set
:
function
(
a
,
b
){
this
.
u
=
a
;
this
.
v
=
b
;
return
this
},
copy
:
function
(
a
){
this
.
u
=
a
.
u
;
this
.
v
=
a
.
v
;
return
this
},
lerpSelf
:
function
(
a
,
b
){
this
.
u
+=
(
a
.
u
-
this
.
u
)
*
b
;
this
.
v
+=
(
a
.
v
-
this
.
v
)
*
b
;
return
this
},
clone
:
function
(){
return
new
THREE
.
UV
(
this
.
u
,
this
.
v
)}};
THREE
.
Geometry
=
function
(){
THREE
.
GeometryLibrary
.
push
(
this
);
this
.
id
=
THREE
.
GeometryIdCount
++
;
this
.
name
=
""
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
normals
=
[];
this
.
materials
=
[];
this
.
faces
=
[];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
morphNormals
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
lineDistances
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
;
this
.
dynamic
=!
0
;
this
.
buffersNeedUpdate
=
this
.
lineDistancesNeedUpdate
=
this
.
color
sNeedUpdate
=
THREE
.
Geometry
=
function
(){
THREE
.
GeometryLibrary
.
push
(
this
);
this
.
id
=
THREE
.
GeometryIdCount
++
;
this
.
name
=
""
;
this
.
vertices
=
[];
this
.
colors
=
[];
this
.
normals
=
[];
this
.
faces
=
[];
this
.
faceUvs
=
[[]];
this
.
faceVertexUvs
=
[[]];
this
.
morphTargets
=
[];
this
.
morphColors
=
[];
this
.
morphNormals
=
[];
this
.
skinWeights
=
[];
this
.
skinIndices
=
[];
this
.
lineDistances
=
[];
this
.
boundingSphere
=
this
.
boundingBox
=
null
;
this
.
hasTangents
=!
1
;
this
.
dynamic
=!
0
;
this
.
buffersNeedUpdate
=
this
.
lineDistancesNeedUpdate
=
this
.
colorsNeedUpdate
=
this
.
tangent
sNeedUpdate
=
this
.
tangentsNeedUpdate
=
this
.
normalsNeedUpdate
=
this
.
uvsNeedUpdate
=
this
.
elementsNeedUpdate
=
this
.
verticesNeedUpdate
=!
1
};
this
.
normalsNeedUpdate
=
this
.
uvsNeedUpdate
=
this
.
elementsNeedUpdate
=
this
.
verticesNeedUpdate
=!
1
};
THREE
.
Geometry
.
prototype
=
{
constructor
:
THREE
.
Geometry
,
applyMatrix
:
function
(
a
){
var
b
=
new
THREE
.
Matrix3
;
b
.
getInverse
(
a
).
transpose
();
for
(
var
c
=
0
,
d
=
this
.
vertices
.
length
;
c
<
d
;
c
++
)
a
.
multiplyVector3
(
this
.
vertices
[
c
]);
c
=
0
;
for
(
d
=
this
.
faces
.
length
;
c
<
d
;
c
++
){
var
e
=
this
.
faces
[
c
];
b
.
multiplyVector3
(
e
.
normal
).
normalize
();
for
(
var
f
=
0
,
g
=
e
.
vertexNormals
.
length
;
f
<
g
;
f
++
)
b
.
multiplyVector3
(
e
.
vertexNormals
[
f
]).
normalize
();
a
.
multiplyVector3
(
e
.
centroid
)}},
computeCentroids
:
function
(){
var
a
,
b
,
c
;
a
=
0
;
for
(
b
=
this
.
faces
.
length
;
a
<
b
;
a
++
)
c
=
THREE
.
Geometry
.
prototype
=
{
constructor
:
THREE
.
Geometry
,
applyMatrix
:
function
(
a
){
var
b
=
new
THREE
.
Matrix3
;
b
.
getInverse
(
a
).
transpose
();
for
(
var
c
=
0
,
d
=
this
.
vertices
.
length
;
c
<
d
;
c
++
)
a
.
multiplyVector3
(
this
.
vertices
[
c
]);
c
=
0
;
for
(
d
=
this
.
faces
.
length
;
c
<
d
;
c
++
){
var
e
=
this
.
faces
[
c
];
b
.
multiplyVector3
(
e
.
normal
).
normalize
();
for
(
var
f
=
0
,
g
=
e
.
vertexNormals
.
length
;
f
<
g
;
f
++
)
b
.
multiplyVector3
(
e
.
vertexNormals
[
f
]).
normalize
();
a
.
multiplyVector3
(
e
.
centroid
)}},
computeCentroids
:
function
(){
var
a
,
b
,
c
;
a
=
0
;
for
(
b
=
this
.
faces
.
length
;
a
<
b
;
a
++
)
c
=
this
.
faces
[
a
],
c
.
centroid
.
set
(
0
,
0
,
0
),
c
instanceof
THREE
.
Face3
?(
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
a
]),
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
b
]),
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
c
]),
c
.
centroid
.
divideScalar
(
3
)):
c
instanceof
THREE
.
Face4
&&
(
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
a
]),
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
b
]),
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
c
]),
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
d
]),
c
.
centroid
.
divideScalar
(
4
))},
computeFaceNormals
:
function
(){
var
a
,
b
,
c
,
d
,
e
,
f
,
g
=
new
THREE
.
Vector3
,
h
=
new
THREE
.
Vector3
;
this
.
faces
[
a
],
c
.
centroid
.
set
(
0
,
0
,
0
),
c
instanceof
THREE
.
Face3
?(
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
a
]),
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
b
]),
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
c
]),
c
.
centroid
.
divideScalar
(
3
)):
c
instanceof
THREE
.
Face4
&&
(
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
a
]),
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
b
]),
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
c
]),
c
.
centroid
.
addSelf
(
this
.
vertices
[
c
.
d
]),
c
.
centroid
.
divideScalar
(
4
))},
computeFaceNormals
:
function
(){
var
a
,
b
,
c
,
d
,
e
,
f
,
g
=
new
THREE
.
Vector3
,
h
=
new
THREE
.
Vector3
;
a
=
0
;
for
(
b
=
this
.
faces
.
length
;
a
<
b
;
a
++
)
c
=
this
.
faces
[
a
],
d
=
this
.
vertices
[
c
.
a
],
e
=
this
.
vertices
[
c
.
b
],
f
=
this
.
vertices
[
c
.
c
],
g
.
sub
(
f
,
e
),
h
.
sub
(
d
,
e
),
g
.
crossSelf
(
h
),
g
.
normalize
(),
c
.
normal
.
copy
(
g
)},
computeVertexNormals
:
function
(
a
){
var
b
,
c
,
d
,
e
;
if
(
void
0
===
this
.
__tmpVertices
){
e
=
this
.
__tmpVertices
=
Array
(
this
.
vertices
.
length
);
b
=
0
;
for
(
c
=
this
.
vertices
.
length
;
b
<
c
;
b
++
)
e
[
b
]
=
new
THREE
.
Vector3
;
b
=
0
;
for
(
c
=
this
.
faces
.
length
;
b
<
c
;
b
++
)
d
=
this
.
faces
[
b
],
d
instanceof
THREE
.
Face3
?
d
.
vertexNormals
=
[
new
THREE
.
Vector3
,
new
THREE
.
Vector3
,
a
=
0
;
for
(
b
=
this
.
faces
.
length
;
a
<
b
;
a
++
)
c
=
this
.
faces
[
a
],
d
=
this
.
vertices
[
c
.
a
],
e
=
this
.
vertices
[
c
.
b
],
f
=
this
.
vertices
[
c
.
c
],
g
.
sub
(
f
,
e
),
h
.
sub
(
d
,
e
),
g
.
crossSelf
(
h
),
g
.
normalize
(),
c
.
normal
.
copy
(
g
)},
computeVertexNormals
:
function
(
a
){
var
b
,
c
,
d
,
e
;
if
(
void
0
===
this
.
__tmpVertices
){
e
=
this
.
__tmpVertices
=
Array
(
this
.
vertices
.
length
);
b
=
0
;
for
(
c
=
this
.
vertices
.
length
;
b
<
c
;
b
++
)
e
[
b
]
=
new
THREE
.
Vector3
;
b
=
0
;
for
(
c
=
this
.
faces
.
length
;
b
<
c
;
b
++
)
d
=
this
.
faces
[
b
],
d
instanceof
THREE
.
Face3
?
d
.
vertexNormals
=
[
new
THREE
.
Vector3
,
new
THREE
.
Vector3
,
...
...
src/core/Geometry.js
浏览文件 @
261869ac
...
@@ -18,8 +18,6 @@ THREE.Geometry = function () {
...
@@ -18,8 +18,6 @@ THREE.Geometry = function () {
this
.
colors
=
[];
// one-to-one vertex colors, used in ParticleSystem, Line and Ribbon
this
.
colors
=
[];
// one-to-one vertex colors, used in ParticleSystem, Line and Ribbon
this
.
normals
=
[];
// one-to-one vertex normals, used in Ribbon
this
.
normals
=
[];
// one-to-one vertex normals, used in Ribbon
this
.
materials
=
[];
this
.
faces
=
[];
this
.
faces
=
[];
this
.
faceUvs
=
[[]];
this
.
faceUvs
=
[[]];
...
...
src/extras/GeometryUtils.js
浏览文件 @
261869ac
...
@@ -20,18 +20,6 @@ THREE.GeometryUtils = {
...
@@ -20,18 +20,6 @@ THREE.GeometryUtils = {
uvs1
=
geometry1
.
faceVertexUvs
[
0
],
uvs1
=
geometry1
.
faceVertexUvs
[
0
],
uvs2
=
geometry2
.
faceVertexUvs
[
0
];
uvs2
=
geometry2
.
faceVertexUvs
[
0
];
/*
var geo1MaterialsMap = {};
for ( var i = 0; i < geometry1.materials.length; i ++ ) {
var id = geometry1.materials[ i ].id;
geo1MaterialsMap[ id ] = i;
}
*/
if
(
object2
instanceof
THREE
.
Mesh
)
{
if
(
object2
instanceof
THREE
.
Mesh
)
{
object2
.
matrixAutoUpdate
&&
object2
.
updateMatrix
();
object2
.
matrixAutoUpdate
&&
object2
.
updateMatrix
();
...
@@ -99,24 +87,6 @@ THREE.GeometryUtils = {
...
@@ -99,24 +87,6 @@ THREE.GeometryUtils = {
if
(
face
.
materialIndex
!==
undefined
)
{
if
(
face
.
materialIndex
!==
undefined
)
{
/*
var material2 = geometry2.materials[ face.materialIndex ];
var materialId2 = material2.id;
var materialIndex = geo1MaterialsMap[ materialId2 ];
if ( materialIndex === undefined ) {
materialIndex = geometry1.materials.length;
geo1MaterialsMap[ materialId2 ] = materialIndex;
geometry1.materials.push( material2 );
}
faceCopy.materialIndex = materialIndex;
*/
faceCopy
.
materialIndex
=
face
.
materialIndex
;
faceCopy
.
materialIndex
=
face
.
materialIndex
;
}
}
...
@@ -156,16 +126,6 @@ THREE.GeometryUtils = {
...
@@ -156,16 +126,6 @@ THREE.GeometryUtils = {
faces
=
geometry
.
faces
,
faces
=
geometry
.
faces
,
uvs
=
geometry
.
faceVertexUvs
[
0
];
uvs
=
geometry
.
faceVertexUvs
[
0
];
/*
// materials
if ( geometry.materials ) {
cloneGeo.materials = geometry.materials.slice();
}
*/
// vertices
// vertices
for
(
i
=
0
,
il
=
vertices
.
length
;
i
<
il
;
i
++
)
{
for
(
i
=
0
,
il
=
vertices
.
length
;
i
<
il
;
i
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录