Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
2b394eea
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,发现更多精彩内容 >>
提交
2b394eea
编写于
12月 31, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cleaned up drawcalls example.
上级
0b763d12
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
15 deletion
+13
-15
examples/webgl_buffergeometry_drawcalls.html
examples/webgl_buffergeometry_drawcalls.html
+13
-15
未找到文件。
examples/webgl_buffergeometry_drawcalls.html
浏览文件 @
2b394eea
...
@@ -70,21 +70,21 @@
...
@@ -70,21 +70,21 @@
animate
();
animate
();
function
initGUI
()
{
function
initGUI
()
{
var
gui
=
new
dat
.
GUI
();
var
gui
=
new
dat
.
GUI
();
gui
.
add
(
effectController
,
"
showDots
"
).
onChange
(
function
(
value
)
{
pointCloud
.
visible
=
value
;
}
);
gui
.
add
(
effectController
,
"
showDots
"
).
onChange
(
function
(
value
)
{
pointCloud
.
visible
=
value
;
}
);
gui
.
add
(
effectController
,
"
showLines
"
).
onChange
(
function
(
value
)
{
linesMesh
.
visible
=
value
;
}
);
gui
.
add
(
effectController
,
"
showLines
"
).
onChange
(
function
(
value
)
{
linesMesh
.
visible
=
value
;
}
);
gui
.
add
(
effectController
,
"
minDistance
"
,
10
,
300
);
gui
.
add
(
effectController
,
"
minDistance
"
,
10
,
300
);
gui
.
add
(
effectController
,
"
limitConnections
"
);
gui
.
add
(
effectController
,
"
limitConnections
"
);
gui
.
add
(
effectController
,
"
maxConnections
"
,
0
,
30
,
1
);
gui
.
add
(
effectController
,
"
maxConnections
"
,
0
,
30
,
1
);
gui
.
add
(
effectController
,
"
particleCount
"
,
0
,
maxParticleCount
,
1
).
onChange
(
function
(
value
)
{
gui
.
add
(
effectController
,
"
particleCount
"
,
0
,
maxParticleCount
,
1
).
onChange
(
function
(
value
)
{
particleCount
=
parseInt
(
value
);
particleCount
=
parseInt
(
value
);
particles
.
drawcalls
[
0
].
count
=
particleCount
;
particles
.
drawcalls
[
0
].
count
=
particleCount
;
});
});
}
}
function
init
()
{
function
init
()
{
...
@@ -98,9 +98,7 @@
...
@@ -98,9 +98,7 @@
camera
=
new
THREE
.
PerspectiveCamera
(
45
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
4000
);
camera
=
new
THREE
.
PerspectiveCamera
(
45
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
4000
);
camera
.
position
.
z
=
1750
;
camera
.
position
.
z
=
1750
;
controls
=
new
THREE
.
OrbitControls
(
camera
);
controls
=
new
THREE
.
OrbitControls
(
camera
,
container
);
controls
.
damping
=
0.2
;
controls
.
addEventListener
(
'
change
'
,
render
);
scene
=
new
THREE
.
Scene
();
scene
=
new
THREE
.
Scene
();
...
@@ -128,7 +126,7 @@
...
@@ -128,7 +126,7 @@
var
x
=
Math
.
random
()
*
r
-
r
/
2
;
var
x
=
Math
.
random
()
*
r
-
r
/
2
;
var
y
=
Math
.
random
()
*
r
-
r
/
2
;
var
y
=
Math
.
random
()
*
r
-
r
/
2
;
var
z
=
Math
.
random
()
*
r
-
r
/
2
;
var
z
=
Math
.
random
()
*
r
-
r
/
2
;
particlePositions
[
i
*
3
]
=
x
;
particlePositions
[
i
*
3
]
=
x
;
particlePositions
[
i
*
3
+
1
]
=
y
;
particlePositions
[
i
*
3
+
1
]
=
y
;
particlePositions
[
i
*
3
+
2
]
=
z
;
particlePositions
[
i
*
3
+
2
]
=
z
;
...
@@ -172,9 +170,9 @@
...
@@ -172,9 +170,9 @@
group
.
add
(
linesMesh
);
group
.
add
(
linesMesh
);
scene
.
add
(
group
);
scene
.
add
(
group
);
//
//
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
true
}
);
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
true
}
);
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
)
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
)
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
...
@@ -185,7 +183,7 @@
...
@@ -185,7 +183,7 @@
container
.
appendChild
(
renderer
.
domElement
);
container
.
appendChild
(
renderer
.
domElement
);
//
//
stats
=
new
Stats
();
stats
=
new
Stats
();
stats
.
domElement
.
style
.
position
=
'
absolute
'
;
stats
.
domElement
.
style
.
position
=
'
absolute
'
;
stats
.
domElement
.
style
.
top
=
'
0px
'
;
stats
.
domElement
.
style
.
top
=
'
0px
'
;
...
@@ -240,14 +238,14 @@
...
@@ -240,14 +238,14 @@
var
particleDataB
=
particlesData
[
j
];
var
particleDataB
=
particlesData
[
j
];
if
(
effectController
.
limitConnections
&&
particleDataB
.
numConnections
>=
effectController
.
maxConnections
)
if
(
effectController
.
limitConnections
&&
particleDataB
.
numConnections
>=
effectController
.
maxConnections
)
continue
;
continue
;
var
dx
=
particlePositions
[
i
*
3
]
-
particlePositions
[
j
*
3
];
var
dx
=
particlePositions
[
i
*
3
]
-
particlePositions
[
j
*
3
];
var
dy
=
particlePositions
[
i
*
3
+
1
]
-
particlePositions
[
j
*
3
+
1
];
var
dy
=
particlePositions
[
i
*
3
+
1
]
-
particlePositions
[
j
*
3
+
1
];
var
dz
=
particlePositions
[
i
*
3
+
2
]
-
particlePositions
[
j
*
3
+
2
];
var
dz
=
particlePositions
[
i
*
3
+
2
]
-
particlePositions
[
j
*
3
+
2
];
var
dist
=
Math
.
sqrt
(
dx
*
dx
+
dy
*
dy
+
dz
*
dz
);
var
dist
=
Math
.
sqrt
(
dx
*
dx
+
dy
*
dy
+
dz
*
dz
);
if
(
dist
<
effectController
.
minDistance
)
{
if
(
dist
<
effectController
.
minDistance
)
{
particleData
.
numConnections
++
;
particleData
.
numConnections
++
;
particleDataB
.
numConnections
++
;
particleDataB
.
numConnections
++
;
...
@@ -299,4 +297,4 @@
...
@@ -299,4 +297,4 @@
</script>
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录