Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
827c00ad
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,发现更多精彩内容 >>
提交
827c00ad
编写于
4月 20, 2018
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Examples: Clean up
上级
3bbef603
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
59 deletion
+18
-59
examples/webgl_shaders_vector.html
examples/webgl_shaders_vector.html
+18
-59
未找到文件。
examples/webgl_shaders_vector.html
浏览文件 @
827c00ad
...
...
@@ -74,26 +74,7 @@
var
camera
,
scene
,
renderer
,
controls
;
var
group
,
text
;
var
t
=
false
;
function
toggle
()
{
if
(
t
)
{
text2
.
visible
=
0
;
text1
.
visible
=
1
;
}
else
{
text2
.
visible
=
1
;
text1
.
visible
=
0
;
}
t
=
!
t
;
}
var
group
;
var
loader
=
new
THREE
.
FontLoader
();
loader
.
load
(
'
fonts/helvetiker_regular.typeface.json
'
,
function
(
font
)
{
...
...
@@ -106,35 +87,32 @@
function
init
(
font
)
{
camera
=
new
THREE
.
PerspectiveCamera
(
50
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
10000
);
camera
.
position
.
set
(
0
,
100
,
500
);
camera
.
position
.
set
(
5
0
,
100
,
500
);
controls
=
new
THREE
.
OrbitControls
(
camera
);
controls
.
target
.
set
(
0
,
100
,
0
);
controls
.
target
.
set
(
5
0
,
100
,
0
);
controls
.
update
();
scene
=
new
THREE
.
Scene
();
scene
.
background
=
new
THREE
.
Color
(
0xf0f0f0
);
var
theText
=
"
&
"
;
// i % & j b 8
var
theText
=
'
&
'
;
// i % & j b 8
group
=
new
THREE
.
Group
();
scene
.
add
(
group
);
var
textMaterial
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
new
THREE
.
Color
(
0
,
0
,
1
),
color
:
new
THREE
.
Color
(
0
,
0
,
1
),
side
:
THREE
.
DoubleSide
,
wireframe
:
true
}
);
var
textShapes
=
font
.
generateShapes
(
theText
,
180
,
2
);
var
text3d
=
new
THREE
.
ShapeBufferGeometry
(
textShapes
);
text3d
.
computeBoundingBox
();
var
centerOffset
=
-
0.5
*
(
text3d
.
boundingBox
.
max
.
x
-
text3d
.
boundingBox
.
min
.
x
);
text
=
new
THREE
.
Mesh
(
text3d
,
textMaterial
);
var
geometry
=
new
THREE
.
ShapeBufferGeometry
(
textShapes
);
text
.
position
.
x
=
centerOffset
-
150
;
var
text
=
new
THREE
.
Mesh
(
geometry
,
textMaterial
);
text
.
position
.
x
=
-
200
;
group
.
add
(
text
);
//
...
...
@@ -234,7 +212,6 @@
for
(
var
i
=
0
;
i
<
subshape
.
holes
.
length
;
i
++
)
{
hole
=
subshape
.
holes
[
i
];
// console.log('hole', hole);
process
=
processShape
(
hole
.
curves
,
true
);
...
...
@@ -271,21 +248,17 @@
bezierGeometry
.
addAttribute
(
'
uv
'
,
new
THREE
.
Float32BufferAttribute
(
uvs
,
2
)
);
bezierGeometry
.
addAttribute
(
'
invert
'
,
new
THREE
.
Float32BufferAttribute
(
invert
,
1
)
);
text3d
=
new
THREE
.
ShapeBufferGeometry
(
convexhullShapeGroup
);
text3d
.
computeBoundingBox
();
var
centerOffset
=
-
0.5
*
(
text3d
.
boundingBox
.
max
.
x
-
text3d
.
boundingBox
.
min
.
x
);
geometry
=
new
THREE
.
ShapeBufferGeometry
(
convexhullShapeGroup
);
var
text1
=
new
THREE
.
Mesh
(
text3d
,
textMaterial
);
text
1
.
position
.
x
=
centerOffset
+
15
0
;
group
.
add
(
text
1
);
text
=
new
THREE
.
Mesh
(
geometry
,
textMaterial
);
text
.
position
.
x
=
20
0
;
group
.
add
(
text
);
text3d
=
new
THREE
.
ShapeBufferGeometry
(
solidShapeGroup
);
text3d
.
computeBoundingBox
();
var
centerOffset
=
-
0.5
*
(
text3d
.
boundingBox
.
max
.
x
-
text3d
.
boundingBox
.
min
.
x
);
geometry
=
new
THREE
.
ShapeBufferGeometry
(
solidShapeGroup
);
var
text2
=
new
THREE
.
Mesh
(
text3d
,
new
THREE
.
MeshBasicMaterial
(
{
color
:
new
THREE
.
Color
(
1
,
0
,
0
),
side
:
THREE
.
DoubleSide
,
wireframe
:
true
}
)
);
text
2
.
position
.
x
=
centerOffset
+
15
0
;
group
.
add
(
text
2
);
text
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshBasicMaterial
(
{
color
:
new
THREE
.
Color
(
1
,
0
,
0
),
side
:
THREE
.
DoubleSide
,
wireframe
:
true
}
)
);
text
.
position
.
x
=
20
0
;
group
.
add
(
text
);
//
...
...
@@ -299,11 +272,6 @@
}
);
text
=
new
THREE
.
Mesh
(
bezierGeometry
,
newMaterial
);
text
.
position
.
x
=
centerOffset
;
text
.
position
.
y
=
0
;
text
.
position
.
z
=
0
;
text
.
rotation
.
x
=
0
;
text
.
rotation
.
y
=
Math
.
PI
*
2
;
group
.
add
(
text
);
...
...
@@ -311,15 +279,9 @@
//
text3d
=
new
THREE
.
ShapeBufferGeometry
(
solidShapeGroup
);
text3d
.
computeBoundingBox
();
text
=
new
THREE
.
Mesh
(
text3d
,
new
THREE
.
MeshBasicMaterial
(
{
color
:
0.45
*
0xffffff
,
side
:
THREE
.
DoubleSide
}
)
);
text
.
position
.
x
=
centerOffset
;
text
.
position
.
y
=
0
;
text
.
position
.
z
=
0
;
geometry
=
new
THREE
.
ShapeBufferGeometry
(
solidShapeGroup
);
text
.
rotation
.
x
=
0
;
text
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshBasicMaterial
(
{
color
:
0.45
*
0xffffff
,
side
:
THREE
.
DoubleSide
}
)
)
;
text
.
rotation
.
y
=
Math
.
PI
*
2
;
group
.
add
(
text
);
...
...
@@ -334,8 +296,6 @@
stats
=
new
Stats
();
document
.
body
.
appendChild
(
stats
.
dom
);
document
.
addEventListener
(
'
mousedown
'
,
toggle
,
false
);
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
...
...
@@ -349,7 +309,6 @@
}
//
function
animate
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录