Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
631d6e36
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,发现更多精彩内容 >>
提交
631d6e36
编写于
7月 23, 2013
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Swaped edge orientation... (abc,acd to abd,bcd)
上级
006414d6
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
52 addition
and
59 deletion
+52
-59
src/extras/geometries/CubeGeometry.js
src/extras/geometries/CubeGeometry.js
+9
-12
src/extras/geometries/CylinderGeometry.js
src/extras/geometries/CylinderGeometry.js
+4
-4
src/extras/geometries/LatheGeometry.js
src/extras/geometries/LatheGeometry.js
+4
-4
src/extras/geometries/ParametricGeometry.js
src/extras/geometries/ParametricGeometry.js
+8
-8
src/extras/geometries/PlaneGeometry.js
src/extras/geometries/PlaneGeometry.js
+9
-13
src/extras/geometries/SphereGeometry.js
src/extras/geometries/SphereGeometry.js
+4
-4
src/extras/geometries/TorusGeometry.js
src/extras/geometries/TorusGeometry.js
+6
-6
src/extras/geometries/TorusKnotGeometry.js
src/extras/geometries/TorusKnotGeometry.js
+4
-4
src/extras/geometries/TubeGeometry.js
src/extras/geometries/TubeGeometry.js
+4
-4
未找到文件。
src/extras/geometries/CubeGeometry.js
浏览文件 @
631d6e36
...
...
@@ -85,29 +85,26 @@ THREE.CubeGeometry = function ( width, height, depth, widthSegments, heightSegme
var
c
=
(
ix
+
1
)
+
gridX1
*
(
iy
+
1
);
var
d
=
(
ix
+
1
)
+
gridX1
*
iy
;
var
face
=
new
THREE
.
Face3
(
a
+
offset
,
b
+
offset
,
c
+
offset
);
var
uva
=
new
THREE
.
Vector2
(
ix
/
gridX
,
1
-
iy
/
gridY
);
var
uvb
=
new
THREE
.
Vector2
(
ix
/
gridX
,
1
-
(
iy
+
1
)
/
gridY
);
var
uvc
=
new
THREE
.
Vector2
(
(
ix
+
1
)
/
gridX
,
1
-
(
iy
+
1
)
/
gridY
);
var
uvd
=
new
THREE
.
Vector2
(
(
ix
+
1
)
/
gridX
,
1
-
iy
/
gridY
);
var
face
=
new
THREE
.
Face3
(
a
+
offset
,
b
+
offset
,
d
+
offset
);
face
.
normal
.
copy
(
normal
);
face
.
vertexNormals
.
push
(
normal
.
clone
(),
normal
.
clone
(),
normal
.
clone
()
);
face
.
materialIndex
=
materialIndex
;
scope
.
faces
.
push
(
face
);
scope
.
faceVertexUvs
[
0
].
push
(
[
new
THREE
.
Vector2
(
ix
/
gridX
,
1
-
iy
/
gridY
),
new
THREE
.
Vector2
(
ix
/
gridX
,
1
-
(
iy
+
1
)
/
gridY
),
new
THREE
.
Vector2
(
(
ix
+
1
)
/
gridX
,
1
-
(
iy
+
1
)
/
gridY
)
]
);
scope
.
faceVertexUvs
[
0
].
push
(
[
uva
,
uvb
,
uvd
]
);
face
=
new
THREE
.
Face3
(
a
+
offset
,
c
+
offset
,
d
+
offset
);
face
=
new
THREE
.
Face3
(
b
+
offset
,
c
+
offset
,
d
+
offset
);
face
.
normal
.
copy
(
normal
);
face
.
vertexNormals
.
push
(
normal
.
clone
(),
normal
.
clone
(),
normal
.
clone
()
);
face
.
materialIndex
=
materialIndex
;
scope
.
faces
.
push
(
face
);
scope
.
faceVertexUvs
[
0
].
push
(
[
new
THREE
.
Vector2
(
ix
/
gridX
,
1
-
iy
/
gridY
),
new
THREE
.
Vector2
(
(
ix
+
1
)
/
gridX
,
1
-
(
iy
+
1
)
/
gridY
),
new
THREE
.
Vector2
(
(
ix
+
1
)
/
gridX
,
1
-
iy
/
gridY
)
]
);
scope
.
faceVertexUvs
[
0
].
push
(
[
uvb
,
uvc
,
uvd
]
);
}
...
...
src/extras/geometries/CylinderGeometry.js
浏览文件 @
631d6e36
...
...
@@ -85,11 +85,11 @@ THREE.CylinderGeometry = function ( radiusTop, radiusBottom, height, radialSegme
var
uv3
=
uvs
[
y
+
1
][
x
+
1
].
clone
();
var
uv4
=
uvs
[
y
][
x
+
1
].
clone
();
this
.
faces
.
push
(
new
THREE
.
Face3
(
v1
,
v2
,
v
3
,
[
n1
,
n2
,
n3
]
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uv1
,
uv2
,
uv
3
]
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
v1
,
v2
,
v
4
,
[
n1
,
n2
,
n4
]
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uv1
,
uv2
,
uv
4
]
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
v
1
,
v3
,
v4
,
[
n1
,
n3
,
n4
]
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uv
1
,
uv3
,
uv4
]
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
v
2
,
v3
,
v4
,
[
n2
,
n3
,
n4
]
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uv
2
,
uv3
,
uv4
]
);
}
...
...
src/extras/geometries/LatheGeometry.js
浏览文件 @
631d6e36
...
...
@@ -61,21 +61,21 @@ THREE.LatheGeometry = function ( points, segments, phiStart, phiLength ) {
var
u1
=
u0
+
inverseSegments
;
var
v1
=
v0
+
inversePointLength
;
this
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
b
,
c
)
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
b
,
d
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
new
THREE
.
Vector2
(
u0
,
v0
),
new
THREE
.
Vector2
(
u1
,
v0
),
new
THREE
.
Vector2
(
u
1
,
v1
)
new
THREE
.
Vector2
(
u
0
,
v1
)
]
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
c
,
d
)
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
b
,
c
,
d
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
new
THREE
.
Vector2
(
u
0
,
v0
),
new
THREE
.
Vector2
(
u
1
,
v0
),
new
THREE
.
Vector2
(
u1
,
v1
),
new
THREE
.
Vector2
(
u0
,
v1
)
...
...
src/extras/geometries/ParametricGeometry.js
浏览文件 @
631d6e36
...
...
@@ -44,19 +44,19 @@ THREE.ParametricGeometry = function ( func, slices, stacks ) {
a
=
i
*
sliceCount
+
j
;
b
=
i
*
sliceCount
+
j
+
1
;
c
=
(
i
+
1
)
*
sliceCount
+
j
;
d
=
(
i
+
1
)
*
sliceCount
+
j
+
1
;
c
=
(
i
+
1
)
*
sliceCount
+
j
+
1
;
d
=
(
i
+
1
)
*
sliceCount
+
j
;
uva
=
new
THREE
.
Vector2
(
j
/
slices
,
i
/
stacks
);
uvb
=
new
THREE
.
Vector2
(
(
j
+
1
)
/
slices
,
i
/
stacks
);
uvc
=
new
THREE
.
Vector2
(
j
/
slices
,
(
i
+
1
)
/
stacks
);
uvd
=
new
THREE
.
Vector2
(
(
j
+
1
)
/
slices
,
(
i
+
1
)
/
stacks
);
uvc
=
new
THREE
.
Vector2
(
(
j
+
1
)
/
slices
,
(
i
+
1
)
/
stacks
);
uvd
=
new
THREE
.
Vector2
(
j
/
slices
,
(
i
+
1
)
/
stacks
);
faces
.
push
(
new
THREE
.
Face3
(
a
,
b
,
c
)
);
uvs
.
push
(
[
uva
,
uvb
,
uv
c
]
);
faces
.
push
(
new
THREE
.
Face3
(
a
,
b
,
d
)
);
uvs
.
push
(
[
uva
,
uvb
,
uv
d
]
);
faces
.
push
(
new
THREE
.
Face3
(
a
,
c
,
d
)
);
uvs
.
push
(
[
uv
a
,
uvc
,
uvd
]
);
faces
.
push
(
new
THREE
.
Face3
(
b
,
c
,
d
)
);
uvs
.
push
(
[
uv
b
,
uvc
,
uvd
]
);
}
...
...
src/extras/geometries/PlaneGeometry.js
浏览文件 @
631d6e36
...
...
@@ -50,28 +50,24 @@ THREE.PlaneGeometry = function ( width, height, widthSegments, heightSegments )
var
c
=
(
ix
+
1
)
+
gridX1
*
(
iz
+
1
);
var
d
=
(
ix
+
1
)
+
gridX1
*
iz
;
var
face
=
new
THREE
.
Face3
(
a
,
b
,
c
);
var
uva
=
new
THREE
.
Vector2
(
ix
/
gridX
,
1
-
iz
/
gridZ
);
var
uvb
=
new
THREE
.
Vector2
(
ix
/
gridX
,
1
-
(
iz
+
1
)
/
gridZ
);
var
uvc
=
new
THREE
.
Vector2
(
(
ix
+
1
)
/
gridX
,
1
-
(
iz
+
1
)
/
gridZ
);
var
uvd
=
new
THREE
.
Vector2
(
(
ix
+
1
)
/
gridX
,
1
-
iz
/
gridZ
);
var
face
=
new
THREE
.
Face3
(
a
,
b
,
d
);
face
.
normal
.
copy
(
normal
);
face
.
vertexNormals
.
push
(
normal
.
clone
(),
normal
.
clone
(),
normal
.
clone
()
);
this
.
faces
.
push
(
face
);
this
.
faceVertexUvs
[
0
].
push
(
[
new
THREE
.
Vector2
(
ix
/
gridX
,
1
-
iz
/
gridZ
),
new
THREE
.
Vector2
(
ix
/
gridX
,
1
-
(
iz
+
1
)
/
gridZ
),
new
THREE
.
Vector2
(
(
ix
+
1
)
/
gridX
,
1
-
(
iz
+
1
)
/
gridZ
)
]
);
this
.
faceVertexUvs
[
0
].
push
(
[
uva
,
uvb
,
uvd
]
);
face
=
new
THREE
.
Face3
(
a
,
c
,
d
);
face
=
new
THREE
.
Face3
(
b
,
c
,
d
);
face
.
normal
.
copy
(
normal
);
face
.
vertexNormals
.
push
(
normal
.
clone
(),
normal
.
clone
(),
normal
.
clone
()
);
this
.
faces
.
push
(
face
);
this
.
faceVertexUvs
[
0
].
push
(
[
new
THREE
.
Vector2
(
ix
/
gridX
,
1
-
iz
/
gridZ
),
new
THREE
.
Vector2
(
(
ix
+
1
)
/
gridX
,
1
-
(
iz
+
1
)
/
gridZ
),
new
THREE
.
Vector2
(
(
ix
+
1
)
/
gridX
,
1
-
iz
/
gridZ
)
]
);
this
.
faceVertexUvs
[
0
].
push
(
[
uvb
,
uvc
,
uvd
]
);
}
...
...
src/extras/geometries/SphereGeometry.js
浏览文件 @
631d6e36
...
...
@@ -77,11 +77,11 @@ THREE.SphereGeometry = function ( radius, widthSegments, heightSegments, phiStar
}
else
{
this
.
faces
.
push
(
new
THREE
.
Face3
(
v1
,
v2
,
v
3
,
[
n1
,
n2
,
n3
]
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uv1
,
uv2
,
uv
3
]
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
v1
,
v2
,
v
4
,
[
n1
,
n2
,
n4
]
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uv1
,
uv2
,
uv
4
]
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
v
1
,
v3
,
v4
,
[
n1
,
n3
,
n4
]
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uv
1
,
uv3
,
uv4
]
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
v
2
,
v3
,
v4
,
[
n2
,
n3
,
n4
]
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uv
2
,
uv3
,
uv4
]
);
}
...
...
src/extras/geometries/TorusGeometry.js
浏览文件 @
631d6e36
...
...
@@ -51,25 +51,25 @@ THREE.TorusGeometry = function ( radius, tube, radialSegments, tubularSegments,
var
c
=
(
this
.
tubularSegments
+
1
)
*
(
j
-
1
)
+
i
;
var
d
=
(
this
.
tubularSegments
+
1
)
*
j
+
i
;
var
face
=
new
THREE
.
Face3
(
a
,
b
,
c
,
[
normals
[
a
],
normals
[
b
],
normals
[
c
]
]
);
var
face
=
new
THREE
.
Face3
(
a
,
b
,
d
,
[
normals
[
a
],
normals
[
b
],
normals
[
d
]
]
);
face
.
normal
.
add
(
normals
[
a
]
);
face
.
normal
.
add
(
normals
[
b
]
);
face
.
normal
.
add
(
normals
[
c
]
);
face
.
normal
.
add
(
normals
[
d
]
);
face
.
normal
.
normalize
();
this
.
faces
.
push
(
face
);
this
.
faceVertexUvs
[
0
].
push
(
[
uvs
[
a
].
clone
(),
uvs
[
b
].
clone
(),
uvs
[
c
].
clone
()
]
);
this
.
faceVertexUvs
[
0
].
push
(
[
uvs
[
a
].
clone
(),
uvs
[
b
].
clone
(),
uvs
[
d
].
clone
()
]
);
face
=
new
THREE
.
Face3
(
a
,
c
,
d
,
[
normals
[
a
],
normals
[
c
],
normals
[
d
]
]
);
face
.
normal
.
add
(
normals
[
a
]
);
face
=
new
THREE
.
Face3
(
b
,
c
,
d
,
[
normals
[
b
],
normals
[
c
],
normals
[
d
]
]
);
face
.
normal
.
add
(
normals
[
b
]
);
face
.
normal
.
add
(
normals
[
c
]
);
face
.
normal
.
add
(
normals
[
d
]
);
face
.
normal
.
normalize
();
this
.
faces
.
push
(
face
);
this
.
faceVertexUvs
[
0
].
push
(
[
uvs
[
a
].
clone
(),
uvs
[
c
].
clone
(),
uvs
[
d
].
clone
()
]
);
this
.
faceVertexUvs
[
0
].
push
(
[
uvs
[
b
].
clone
(),
uvs
[
c
].
clone
(),
uvs
[
d
].
clone
()
]
);
}
}
...
...
src/extras/geometries/TorusKnotGeometry.js
浏览文件 @
631d6e36
...
...
@@ -70,11 +70,11 @@ THREE.TorusKnotGeometry = function ( radius, tube, radialSegments, tubularSegmen
var
uvc
=
new
THREE
.
Vector2
(
(
i
+
1
)
/
this
.
radialSegments
,
(
j
+
1
)
/
this
.
tubularSegments
);
var
uvd
=
new
THREE
.
Vector2
(
i
/
this
.
radialSegments
,
(
j
+
1
)
/
this
.
tubularSegments
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
b
,
c
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uva
,
uvb
,
uv
c
]
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
b
,
d
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uva
,
uvb
,
uv
d
]
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
c
,
d
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uv
a
,
uvc
,
uvd
]
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
b
,
c
,
d
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uv
b
,
uvc
,
uvd
]
);
}
}
...
...
src/extras/geometries/TubeGeometry.js
浏览文件 @
631d6e36
...
...
@@ -110,11 +110,11 @@ THREE.TubeGeometry = function( path, segments, radius, radialSegments, closed )
uvc
=
new
THREE
.
Vector2
(
(
i
+
1
)
/
this
.
segments
,
(
j
+
1
)
/
this
.
radialSegments
);
uvd
=
new
THREE
.
Vector2
(
i
/
this
.
segments
,
(
j
+
1
)
/
this
.
radialSegments
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
b
,
c
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uva
,
uvb
,
uv
c
]
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
b
,
d
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uva
,
uvb
,
uv
d
]
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
c
,
d
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uv
a
,
uvc
,
uvd
]
);
this
.
faces
.
push
(
new
THREE
.
Face3
(
b
,
c
,
d
)
);
this
.
faceVertexUvs
[
0
].
push
(
[
uv
b
,
uvc
,
uvd
]
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录