Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
1c9cba9b
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,发现更多精彩内容 >>
未验证
提交
1c9cba9b
编写于
2月 25, 2018
作者:
M
Mr.doob
提交者:
GitHub
2月 25, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13427 from WestLangley/dev-to_bg_3
Examples: Geometry => BufferGeometry
上级
c6d275da
83db2025
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
28 addition
and
25 deletion
+28
-25
examples/js/math/Lut.js
examples/js/math/Lut.js
+7
-5
examples/webgl_trails.html
examples/webgl_trails.html
+14
-11
examples/webvr_vive_dragging.html
examples/webvr_vive_dragging.html
+7
-9
未找到文件。
examples/js/math/Lut.js
浏览文件 @
1c9cba9b
...
...
@@ -451,16 +451,16 @@ THREE.Lut.prototype = {
var
material
=
new
THREE
.
LineBasicMaterial
(
{
color
:
0x000000
,
linewidth
:
2
}
);
var
geometry
=
new
THREE
.
Geometry
()
;
var
points
=
[]
;
if
(
this
.
legend
.
layout
==
'
vertical
'
)
{
var
linePosition
=
(
this
.
legend
.
position
.
y
-
(
this
.
legend
.
dimensions
.
height
*
0.5
)
+
0.01
)
+
(
this
.
legend
.
dimensions
.
height
)
*
(
(
value
-
this
.
minV
)
/
(
this
.
maxV
-
this
.
minV
)
*
0.99
);
geometry
.
vertice
s
.
push
(
new
THREE
.
Vector3
(
this
.
legend
.
position
.
x
+
this
.
legend
.
dimensions
.
width
*
0.55
,
linePosition
,
this
.
legend
.
position
.
z
)
);
point
s
.
push
(
new
THREE
.
Vector3
(
this
.
legend
.
position
.
x
+
this
.
legend
.
dimensions
.
width
*
0.55
,
linePosition
,
this
.
legend
.
position
.
z
)
);
geometry
.
vertice
s
.
push
(
new
THREE
.
Vector3
(
this
.
legend
.
position
.
x
+
this
.
legend
.
dimensions
.
width
*
0.7
,
linePosition
,
this
.
legend
.
position
.
z
)
);
point
s
.
push
(
new
THREE
.
Vector3
(
this
.
legend
.
position
.
x
+
this
.
legend
.
dimensions
.
width
*
0.7
,
linePosition
,
this
.
legend
.
position
.
z
)
);
}
...
...
@@ -468,12 +468,14 @@ THREE.Lut.prototype = {
var
linePosition
=
(
this
.
legend
.
position
.
x
-
(
this
.
legend
.
dimensions
.
height
*
0.5
)
+
0.01
)
+
(
this
.
legend
.
dimensions
.
height
)
*
(
(
value
-
this
.
minV
)
/
(
this
.
maxV
-
this
.
minV
)
*
0.99
);
geometry
.
vertice
s
.
push
(
new
THREE
.
Vector3
(
linePosition
,
this
.
legend
.
position
.
y
-
this
.
legend
.
dimensions
.
width
*
0.55
,
this
.
legend
.
position
.
z
)
);
point
s
.
push
(
new
THREE
.
Vector3
(
linePosition
,
this
.
legend
.
position
.
y
-
this
.
legend
.
dimensions
.
width
*
0.55
,
this
.
legend
.
position
.
z
)
);
geometry
.
vertice
s
.
push
(
new
THREE
.
Vector3
(
linePosition
,
this
.
legend
.
position
.
y
-
this
.
legend
.
dimensions
.
width
*
0.7
,
this
.
legend
.
position
.
z
)
);
point
s
.
push
(
new
THREE
.
Vector3
(
linePosition
,
this
.
legend
.
position
.
y
-
this
.
legend
.
dimensions
.
width
*
0.7
,
this
.
legend
.
position
.
z
)
);
}
var
geometry
=
new
THREE
.
BufferGeometry
().
setFromPoints
(
points
);
var
line
=
new
THREE
.
Line
(
geometry
,
material
);
lines
[
i
]
=
line
;
...
...
examples/webgl_trails.html
浏览文件 @
1c9cba9b
...
...
@@ -40,26 +40,29 @@
document
.
body
.
appendChild
(
container
);
camera
=
new
THREE
.
PerspectiveCamera
(
60
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
10000
);
camera
.
position
.
set
(
100000
,
0
,
32
00
);
camera
.
position
.
set
(
0
,
0
,
10
00
);
scene
=
new
THREE
.
Scene
();
var
colors
=
[
0x000000
,
0xff0080
,
0x8000ff
,
0xffffff
];
var
geometry
=
new
THREE
.
Geometry
();
var
colorArray
=
[
new
THREE
.
Color
(
0xff0080
),
new
THREE
.
Color
(
0xffffff
),
new
THREE
.
Color
(
0x8000ff
)
];
var
positions
=
[];
var
colors
=
[];
for
(
var
i
=
0
;
i
<
20
00
;
i
++
)
{
for
(
var
i
=
0
;
i
<
1
00
;
i
++
)
{
var
vertex
=
new
THREE
.
Vector3
();
vertex
.
x
=
Math
.
random
()
*
4000
-
2000
;
vertex
.
y
=
Math
.
random
()
*
4000
-
2000
;
vertex
.
z
=
Math
.
random
()
*
4000
-
2000
;
geometry
.
vertices
.
push
(
vertex
);
positions
.
push
(
4000
*
(
Math
.
random
()
-
0.5
),
4000
*
(
Math
.
random
()
-
0.5
),
4000
*
(
Math
.
random
()
-
0.5
)
);
geometry
.
colors
.
push
(
new
THREE
.
Color
(
colors
[
Math
.
floor
(
Math
.
random
()
*
colors
.
length
)
]
)
);
var
clr
=
colorArray
[
Math
.
floor
(
Math
.
random
()
*
colorArray
.
length
)
];
colors
.
push
(
clr
.
r
,
clr
.
g
,
clr
.
b
);
}
var
material
=
new
THREE
.
PointsMaterial
(
{
size
:
1
,
vertexColors
:
THREE
.
VertexColors
,
depthTest
:
false
,
opacity
:
0.5
,
sizeAttenuation
:
false
,
transparent
:
true
}
);
var
geometry
=
new
THREE
.
BufferGeometry
();
geometry
.
addAttribute
(
'
position
'
,
new
THREE
.
Float32BufferAttribute
(
positions
,
3
)
);
geometry
.
addAttribute
(
'
color
'
,
new
THREE
.
Float32BufferAttribute
(
colors
,
3
)
);
var
material
=
new
THREE
.
PointsMaterial
(
{
size
:
4
,
vertexColors
:
THREE
.
VertexColors
,
depthTest
:
false
,
sizeAttenuation
:
false
}
);
var
mesh
=
new
THREE
.
Points
(
geometry
,
material
);
scene
.
add
(
mesh
);
...
...
examples/webvr_vive_dragging.html
浏览文件 @
1c9cba9b
...
...
@@ -64,7 +64,7 @@
camera
=
new
THREE
.
PerspectiveCamera
(
70
,
window
.
innerWidth
/
window
.
innerHeight
,
0.1
,
10
);
user
.
add
(
camera
);
var
geometry
=
new
THREE
.
PlaneGeometry
(
4
,
4
);
var
geometry
=
new
THREE
.
Plane
Buffer
Geometry
(
4
,
4
);
var
material
=
new
THREE
.
MeshStandardMaterial
(
{
color
:
0xeeeeee
,
roughness
:
1.0
,
...
...
@@ -91,11 +91,11 @@
scene
.
add
(
group
);
var
geometries
=
[
new
THREE
.
BoxGeometry
(
0.2
,
0.2
,
0.2
),
new
THREE
.
ConeGeometry
(
0.2
,
0.2
,
64
),
new
THREE
.
CylinderGeometry
(
0.2
,
0.2
,
0.2
,
64
),
new
THREE
.
IcosahedronGeometry
(
0.2
,
3
),
new
THREE
.
TorusGeometry
(
0.2
,
0.04
,
64
,
32
)
new
THREE
.
Box
Buffer
Geometry
(
0.2
,
0.2
,
0.2
),
new
THREE
.
Cone
Buffer
Geometry
(
0.2
,
0.2
,
64
),
new
THREE
.
Cylinder
Buffer
Geometry
(
0.2
,
0.2
,
0.2
,
64
),
new
THREE
.
Icosahedron
Buffer
Geometry
(
0.2
,
3
),
new
THREE
.
Torus
Buffer
Geometry
(
0.2
,
0.04
,
64
,
32
)
];
for
(
var
i
=
0
;
i
<
50
;
i
++
)
{
...
...
@@ -171,9 +171,7 @@
//
var
geometry
=
new
THREE
.
Geometry
();
geometry
.
vertices
.
push
(
new
THREE
.
Vector3
(
0
,
0
,
0
)
);
geometry
.
vertices
.
push
(
new
THREE
.
Vector3
(
0
,
0
,
-
1
)
);
var
geometry
=
new
THREE
.
BufferGeometry
().
setFromPoints
(
[
new
THREE
.
Vector3
(
0
,
0
,
0
),
new
THREE
.
Vector3
(
0
,
0
,
-
1
)
]
);
var
line
=
new
THREE
.
Line
(
geometry
);
line
.
name
=
'
line
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录