Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
59111f17
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,发现更多精彩内容 >>
提交
59111f17
编写于
10月 31, 2017
作者:
T
Tristan VALCKE
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Build unit tests
上级
c7a174ea
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
448 addition
and
180 deletion
+448
-180
test/unit/three.editor.unit.js
test/unit/three.editor.unit.js
+50
-57
test/unit/three.source.unit.js
test/unit/three.source.unit.js
+398
-123
未找到文件。
test/unit/three.editor.unit.js
浏览文件 @
59111f17
...
...
@@ -1167,7 +1167,7 @@
option
.
setTextContent
(
'
Plane
'
);
option
.
onClick
(
function
()
{
var
geometry
=
new
THREE
.
PlaneBufferGeometry
(
2
,
2
);
var
geometry
=
new
THREE
.
PlaneBufferGeometry
(
1
,
1
,
1
,
1
);
var
material
=
new
THREE
.
MeshStandardMaterial
();
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
name
=
'
Plane
'
+
(
++
meshCount
);
...
...
@@ -1184,7 +1184,7 @@
option
.
setTextContent
(
'
Box
'
);
option
.
onClick
(
function
()
{
var
geometry
=
new
THREE
.
BoxBufferGeometry
(
1
,
1
,
1
);
var
geometry
=
new
THREE
.
BoxBufferGeometry
(
1
,
1
,
1
,
1
,
1
,
1
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
Box
'
+
(
++
meshCount
);
...
...
@@ -1200,10 +1200,7 @@
option
.
setTextContent
(
'
Circle
'
);
option
.
onClick
(
function
()
{
var
radius
=
1
;
var
segments
=
32
;
var
geometry
=
new
THREE
.
CircleBufferGeometry
(
radius
,
segments
);
var
geometry
=
new
THREE
.
CircleBufferGeometry
(
1
,
8
,
0
,
Math
.
PI
*
2
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
Circle
'
+
(
++
meshCount
);
...
...
@@ -1219,14 +1216,7 @@
option
.
setTextContent
(
'
Cylinder
'
);
option
.
onClick
(
function
()
{
var
radiusTop
=
1
;
var
radiusBottom
=
1
;
var
height
=
2
;
var
radiusSegments
=
32
;
var
heightSegments
=
1
;
var
openEnded
=
false
;
var
geometry
=
new
THREE
.
CylinderBufferGeometry
(
radiusTop
,
radiusBottom
,
height
,
radiusSegments
,
heightSegments
,
openEnded
);
var
geometry
=
new
THREE
.
CylinderBufferGeometry
(
1
,
1
,
1
,
8
,
1
,
false
,
0
,
Math
.
PI
*
2
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
Cylinder
'
+
(
++
meshCount
);
...
...
@@ -1242,15 +1232,7 @@
option
.
setTextContent
(
'
Sphere
'
);
option
.
onClick
(
function
()
{
var
radius
=
1
;
var
widthSegments
=
32
;
var
heightSegments
=
16
;
var
phiStart
=
0
;
var
phiLength
=
Math
.
PI
*
2
;
var
thetaStart
=
0
;
var
thetaLength
=
Math
.
PI
;
var
geometry
=
new
THREE
.
SphereBufferGeometry
(
radius
,
widthSegments
,
heightSegments
,
phiStart
,
phiLength
,
thetaStart
,
thetaLength
);
var
geometry
=
new
THREE
.
SphereBufferGeometry
(
1
,
8
,
6
,
0
,
Math
.
PI
*
2
,
0
,
Math
.
PI
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
Sphere
'
+
(
++
meshCount
);
...
...
@@ -1266,10 +1248,7 @@
option
.
setTextContent
(
'
Icosahedron
'
);
option
.
onClick
(
function
()
{
var
radius
=
1
;
var
detail
=
2
;
var
geometry
=
new
THREE
.
IcosahedronGeometry
(
radius
,
detail
);
var
geometry
=
new
THREE
.
IcosahedronGeometry
(
1
,
0
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
Icosahedron
'
+
(
++
meshCount
);
...
...
@@ -1285,13 +1264,7 @@
option
.
setTextContent
(
'
Torus
'
);
option
.
onClick
(
function
()
{
var
radius
=
2
;
var
tube
=
1
;
var
radialSegments
=
32
;
var
tubularSegments
=
12
;
var
arc
=
Math
.
PI
*
2
;
var
geometry
=
new
THREE
.
TorusBufferGeometry
(
radius
,
tube
,
radialSegments
,
tubularSegments
,
arc
);
var
geometry
=
new
THREE
.
TorusBufferGeometry
(
1
,
0.4
,
8
,
6
,
Math
.
PI
*
2
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
Torus
'
+
(
++
meshCount
);
...
...
@@ -1307,14 +1280,7 @@
option
.
setTextContent
(
'
TorusKnot
'
);
option
.
onClick
(
function
()
{
var
radius
=
2
;
var
tube
=
0.8
;
var
tubularSegments
=
64
;
var
radialSegments
=
12
;
var
p
=
2
;
var
q
=
3
;
var
geometry
=
new
THREE
.
TorusKnotBufferGeometry
(
radius
,
tube
,
tubularSegments
,
radialSegments
,
p
,
q
);
var
geometry
=
new
THREE
.
TorusKnotBufferGeometry
(
1
,
0.4
,
64
,
8
,
2
,
3
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
()
);
mesh
.
name
=
'
TorusKnot
'
+
(
++
meshCount
);
...
...
@@ -1361,22 +1327,19 @@
var
points
=
[
new
THREE
.
Vector2
(
0
,
0
),
new
THREE
.
Vector2
(
4
,
0
),
new
THREE
.
Vector2
(
3.5
,
0.
5
),
new
THREE
.
Vector2
(
1
,
0.
75
),
new
THREE
.
Vector2
(
0.
8
,
1
),
new
THREE
.
Vector2
(
0.
8
,
4
),
new
THREE
.
Vector2
(
1
,
4.
2
),
new
THREE
.
Vector2
(
1.4
,
4.
8
),
new
THREE
.
Vector2
(
2
,
5
),
new
THREE
.
Vector2
(
2.5
,
5.
4
),
new
THREE
.
Vector2
(
3
,
1
2
)
new
THREE
.
Vector2
(
0.
4
,
0
),
new
THREE
.
Vector2
(
0.35
,
0.0
5
),
new
THREE
.
Vector2
(
0.1
,
0.0
75
),
new
THREE
.
Vector2
(
0.
08
,
0.
1
),
new
THREE
.
Vector2
(
0.
08
,
0.
4
),
new
THREE
.
Vector2
(
0.1
,
0.4
2
),
new
THREE
.
Vector2
(
0.14
,
0.4
8
),
new
THREE
.
Vector2
(
0.2
,
0.
5
),
new
THREE
.
Vector2
(
0.25
,
0.5
4
),
new
THREE
.
Vector2
(
0.3
,
1.
2
)
];
var
segments
=
20
;
var
phiStart
=
0
;
var
phiLength
=
2
*
Math
.
PI
;
var
geometry
=
new
THREE
.
LatheBufferGeometry
(
points
,
segments
,
phiStart
,
phiLength
);
var
geometry
=
new
THREE
.
LatheBufferGeometry
(
points
,
12
,
0
,
Math
.
PI
*
2
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshStandardMaterial
(
{
side
:
THREE
.
DoubleSide
}
)
);
mesh
.
name
=
'
Lathe
'
+
(
++
meshCount
);
...
...
@@ -2142,6 +2105,23 @@
content
=
content
.
replace
(
'
<!-- includes -->
'
,
includes
.
join
(
'
\n\t\t
'
)
);
var
editButton
=
''
;
if
(
editor
.
config
.
getKey
(
'
project/editable
'
)
)
{
editButton
=
`
var button = document.createElement( 'a' );
button.href = 'https://threejs.org/editor/#file=' + location.href.split( '/' ).slice( 0, - 1 ).join( '/' ) + '/app.json';
button.style.cssText = 'position: absolute; bottom: 20px; right: 20px; padding: 7px 10px 6px 10px; color: #fff; border: 1px solid #fff; text-decoration: none;';
button.target = '_blank';
button.textContent = 'EDIT';
document.body.appendChild( button );
`
;
}
content
=
content
.
replace
(
'
/* edit button */
'
,
editButton
);
zip
.
file
(
'
index.html
'
,
content
);
}
);
...
...
@@ -6381,13 +6361,26 @@
container
.
add
(
rendererPropertiesRow
);
// Editable
var
editableRow
=
new
UI
.
Row
();
var
editable
=
new
UI
.
Checkbox
(
config
.
getKey
(
'
project/editable
'
)
).
setLeft
(
'
100px
'
).
onChange
(
function
()
{
config
.
setKey
(
'
project/editable
'
,
this
.
getValue
()
);
}
);
editableRow
.
add
(
new
UI
.
Text
(
'
Editable
'
).
setWidth
(
'
90px
'
)
);
editableRow
.
add
(
editable
);
container
.
add
(
editableRow
);
// VR
var
vrRow
=
new
UI
.
Row
();
var
vr
=
new
UI
.
Checkbox
(
config
.
getKey
(
'
project/vr
'
)
).
setLeft
(
'
100px
'
).
onChange
(
function
()
{
config
.
setKey
(
'
project/vr
'
,
this
.
getValue
()
);
// updateRenderer();
}
);
...
...
test/unit/three.source.unit.js
浏览文件 @
59111f17
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录