Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
40bca923
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,发现更多精彩内容 >>
提交
40bca923
编写于
10月 07, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added WebGL trails example.
上级
fc496e86
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
120 addition
and
3 deletion
+120
-3
examples/webgl_performance.html
examples/webgl_performance.html
+0
-3
examples/webgl_trails.html
examples/webgl_trails.html
+120
-0
未找到文件。
examples/webgl_performance.html
浏览文件 @
40bca923
...
...
@@ -71,8 +71,6 @@
mesh
.
matrixAutoUpdate
=
false
;
mesh
.
updateMatrix
();
//mesh.frustumCulled = false;
scene
.
add
(
mesh
);
}
...
...
@@ -82,7 +80,6 @@
renderer
=
new
THREE
.
WebGLRenderer
(
{
preserveDrawingBuffer
:
true
}
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
renderer
.
sortObjects
=
false
;
renderer
.
autoClearColor
=
false
;
container
.
appendChild
(
renderer
.
domElement
);
stats
=
new
Stats
();
...
...
examples/webgl_trails.html
0 → 100644
浏览文件 @
40bca923
<!doctype html>
<html
lang=
"en"
>
<head>
<title>
three.js webgl - trails
</title>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<style>
body
{
background
:
#000
;
padding
:
0
;
margin
:
0
;
font-weight
:
bold
;
overflow
:
hidden
;
}
</style>
</head>
<body>
<script
src=
"../build/Three.js"
></script>
<script
src=
"js/RequestAnimationFrame.js"
></script>
<script
src=
"js/Stats.js"
></script>
<script>
var
container
,
stats
;
var
camera
,
scene
,
renderer
;
var
mesh
,
zmesh
,
lightMesh
,
geometry
;
var
mouseX
=
0
,
mouseY
=
0
;
var
windowHalfX
=
window
.
innerWidth
/
2
;
var
windowHalfY
=
window
.
innerHeight
/
2
;
document
.
addEventListener
(
'
mousemove
'
,
onDocumentMouseMove
,
false
);
init
();
animate
();
function
init
()
{
container
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
container
);
camera
=
new
THREE
.
PerspectiveCamera
(
60
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
10000
);
camera
.
position
.
x
=
100000
;
camera
.
position
.
z
=
3200
;
scene
=
new
THREE
.
Scene
();
var
colors
=
[
0x000000
,
0xff0080
,
0x8000ff
,
0xffffff
];
var
geometry
=
new
THREE
.
Geometry
();
for
(
var
i
=
0
;
i
<
2000
;
i
++
)
{
var
vertex
=
new
THREE
.
Vertex
();
vertex
.
position
.
x
=
Math
.
random
()
*
4000
-
2000
;
vertex
.
position
.
y
=
Math
.
random
()
*
4000
-
2000
;
vertex
.
position
.
z
=
Math
.
random
()
*
4000
-
2000
;
geometry
.
vertices
.
push
(
vertex
);
geometry
.
colors
.
push
(
new
THREE
.
Color
(
colors
[
Math
.
floor
(
Math
.
random
()
*
colors
.
length
)
]
)
);
}
var
material
=
new
THREE
.
ParticleBasicMaterial
(
{
size
:
1
,
vertexColors
:
THREE
.
VertexColors
,
depthTest
:
false
,
opacity
:
0.5
,
sizeAttenuation
:
false
}
);
var
mesh
=
new
THREE
.
ParticleSystem
(
geometry
,
material
);
scene
.
add
(
mesh
);
renderer
=
new
THREE
.
WebGLRenderer
(
{
preserveDrawingBuffer
:
true
}
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
renderer
.
sortObjects
=
false
;
renderer
.
autoClearColor
=
false
;
container
.
appendChild
(
renderer
.
domElement
);
stats
=
new
Stats
();
stats
.
domElement
.
style
.
position
=
'
absolute
'
;
stats
.
domElement
.
style
.
top
=
'
0px
'
;
stats
.
domElement
.
style
.
zIndex
=
100
;
container
.
appendChild
(
stats
.
domElement
);
}
function
onDocumentMouseMove
(
event
)
{
mouseX
=
(
event
.
clientX
-
windowHalfX
)
*
10
;
mouseY
=
(
event
.
clientY
-
windowHalfY
)
*
10
;
}
//
function
animate
()
{
requestAnimationFrame
(
animate
);
render
();
stats
.
update
();
}
function
render
()
{
camera
.
position
.
x
+=
(
mouseX
-
camera
.
position
.
x
)
*
.
05
;
camera
.
position
.
y
+=
(
-
mouseY
-
camera
.
position
.
y
)
*
.
05
;
camera
.
lookAt
(
scene
.
position
);
renderer
.
render
(
scene
,
camera
);
}
</script>
</body>
</html>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录