Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
2c2b9b81
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,发现更多精彩内容 >>
提交
2c2b9b81
编写于
1月 08, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Optimized line strip example.
上级
bbe2a3bf
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
10 deletion
+15
-10
examples/lines_cubes_gl.html
examples/lines_cubes_gl.html
+15
-10
未找到文件。
examples/lines_cubes_gl.html
浏览文件 @
2c2b9b81
...
...
@@ -100,7 +100,7 @@
document
.
body
.
appendChild
(
container
);
camera
=
new
THREE
.
Camera
(
35
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
10000
);
camera
.
position
.
z
=
8
00
;
camera
.
position
.
z
=
7
00
;
scene
=
new
THREE
.
Scene
();
...
...
@@ -116,29 +116,34 @@
vector
.
multiplyScalar
(
Math
.
random
()
*
10
+
250
);
geometry_cube
.
vertices
.
push
(
new
THREE
.
Vertex
(
vector
)
);
/*
vector = new THREE.Vector3( Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 );
vector.normalize();
vector.multiplyScalar( Math.random() * 10 + 250 );
geometry_sphere.vertices.push( new THREE.Vertex( vector ) );
*/
}
// lines
var
line
,
p
,
scale
=
0.3
,
d
=
125
,
c1
=
0x553300
,
c2
=
0x555555
,
c3
=
0x552800
,
g1
=
geometry_cube
,
g2
=
geometry_sphere
,
parameters
=
[
[
c3
,
scale
*
0.5
,
[
0
,
0
,
0
],
g1
],
[
c2
,
scale
*
0.5
,
[
d
,
0
,
0
],
g1
],
[
c2
,
scale
*
0.5
,
[
-
d
,
0
,
0
],
g1
],
[
c2
,
scale
*
0.5
,
[
0
,
d
,
0
],
g1
],
[
c2
,
scale
*
0.5
,
[
d
,
d
,
0
],
g1
],
[
c2
,
scale
*
0.5
,
[
-
d
,
d
,
0
],
g1
],
[
c2
,
scale
*
0.5
,
[
0
,
-
d
,
0
],
g1
],
[
c2
,
scale
*
0.5
,
[
d
,
-
d
,
0
],
g1
],
[
c2
,
scale
*
0.5
,
[
-
d
,
-
d
,
0
],
g1
],
var
line
,
p
,
scale
=
0.3
,
d
=
125
,
c1
=
0x553300
,
c2
=
0x555555
,
c3
=
0x552800
,
g1
=
geometry_cube
,
m1
=
new
THREE
.
LineBasicMaterial
(
{
color
:
c1
,
opacity
:
1
,
blending
:
THREE
.
AdditiveBlending
}
),
m2
=
new
THREE
.
LineBasicMaterial
(
{
color
:
c2
,
opacity
:
1
,
blending
:
THREE
.
AdditiveBlending
}
),
m3
=
new
THREE
.
LineBasicMaterial
(
{
color
:
c3
,
opacity
:
1
,
blending
:
THREE
.
AdditiveBlending
}
),
parameters
=
[
[
m3
,
scale
*
0.5
,
[
0
,
0
,
0
],
g1
],
[
m2
,
scale
*
0.5
,
[
d
,
0
,
0
],
g1
],
[
m2
,
scale
*
0.5
,
[
-
d
,
0
,
0
],
g1
],
[
m2
,
scale
*
0.5
,
[
0
,
d
,
0
],
g1
],
[
m2
,
scale
*
0.5
,
[
d
,
d
,
0
],
g1
],
[
m2
,
scale
*
0.5
,
[
-
d
,
d
,
0
],
g1
],
[
m2
,
scale
*
0.5
,
[
0
,
-
d
,
0
],
g1
],
[
m2
,
scale
*
0.5
,
[
d
,
-
d
,
0
],
g1
],
[
m2
,
scale
*
0.5
,
[
-
d
,
-
d
,
0
],
g1
],
[
c1
,
scale
*
0.5
,
[
2
*
d
,
0
,
0
],
g1
],
[
c
1
,
scale
*
0.5
,
[
-
2
*
d
,
0
,
0
],
g1
],
[
c1
,
scale
*
0.5
,
[
2
*
d
,
d
,
0
],
g1
],
[
c
1
,
scale
*
0.5
,
[
-
2
*
d
,
d
,
0
],
g1
],
[
c1
,
scale
*
0.5
,
[
2
*
d
,
-
d
,
0
],
g1
],
[
c
1
,
scale
*
0.5
,
[
-
2
*
d
,
-
d
,
0
],
g1
],
[
m1
,
scale
*
0.5
,
[
2
*
d
,
0
,
0
],
g1
],
[
m
1
,
scale
*
0.5
,
[
-
2
*
d
,
0
,
0
],
g1
],
[
m1
,
scale
*
0.5
,
[
2
*
d
,
d
,
0
],
g1
],
[
m
1
,
scale
*
0.5
,
[
-
2
*
d
,
d
,
0
],
g1
],
[
m1
,
scale
*
0.5
,
[
2
*
d
,
-
d
,
0
],
g1
],
[
m
1
,
scale
*
0.5
,
[
-
2
*
d
,
-
d
,
0
],
g1
],
];
for
(
i
=
0
;
i
<
parameters
.
length
;
++
i
)
{
p
=
parameters
[
i
];
line
=
new
THREE
.
Line
(
p
[
3
],
new
THREE
.
LineBasicMaterial
(
{
color
:
p
[
0
],
opacity
:
1
,
blending
:
THREE
.
AdditiveBlending
}
)
);
line
=
new
THREE
.
Line
(
p
[
3
],
p
[
0
]
);
line
.
scale
.
x
=
line
.
scale
.
y
=
line
.
scale
.
z
=
p
[
1
];
line
.
position
.
x
=
p
[
2
][
0
];
line
.
position
.
y
=
p
[
2
][
1
];
...
...
@@ -197,7 +202,7 @@
camera
.
position
.
y
+=
(
-
mouseY
+
200
-
camera
.
position
.
y
)
*
.
05
;
camera
.
updateMatrix
();
var
time
=
new
Date
().
getTime
()
*
0.001
;
var
time
=
new
Date
().
getTime
()
*
0.001
5
;
for
(
var
i
=
0
;
i
<
scene
.
objects
.
length
;
i
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录