Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
662818a9
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,发现更多精彩内容 >>
提交
662818a9
编写于
7月 10, 2017
作者:
M
Mr.doob
提交者:
GitHub
7月 10, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11728 from Mugen87/dev2
Docs: Added TextBufferGeometry
上级
c4066d10
2c2ff5c9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
232 addition
and
1 deletion
+232
-1
docs/api/geometries/TextBufferGeometry.html
docs/api/geometries/TextBufferGeometry.html
+161
-0
docs/list.js
docs/list.js
+1
-0
docs/scenes/js/geometry.js
docs/scenes/js/geometry.js
+70
-1
未找到文件。
docs/api/geometries/TextBufferGeometry.html
0 → 100644
浏览文件 @
662818a9
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
/>
<base
href=
"../../"
/>
<script
src=
"list.js"
></script>
<script
src=
"page.js"
></script>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"page.css"
/>
</head>
<body>
[page:ExtrudeBufferGeometry]
→
<h1>
[name]
</h1>
<div
class=
"desc"
>
A class for generating text as a single geometry. It is constructed by providing a string of text, and a hash of
parameters consisting of a loaded [page:Font] and settings for the geometry's parent [page:ExtrudeBufferGeometry].
See the [page:Font], [page:FontLoader] and [page:Creating_Text] pages for additional details.
</div>
<iframe
id=
"scene"
src=
"scenes/geometry-browser.html#TextBufferGeometry"
></iframe>
<script>
// iOS iframe auto-resize workaround
if
(
/
(
iPad|iPhone|iPod
)
/g
.
test
(
navigator
.
userAgent
)
)
{
var
scene
=
document
.
getElementById
(
'
scene
'
);
scene
.
style
.
width
=
getComputedStyle
(
scene
).
width
;
scene
.
style
.
height
=
getComputedStyle
(
scene
).
height
;
scene
.
setAttribute
(
'
scrolling
'
,
'
no
'
);
}
</script>
<h2>
Examples
</h2>
<div>
[example:webgl_geometry_text geometry / text ]
<br/>
[example:webgl_geometry_text2 geometry / text2 ]
</div>
<code>
var loader = new THREE.FontLoader();
loader.load( 'fonts/helvetiker_regular.typeface.json', function ( font ) {
var geometry = new THREE.TextBufferGeometry( 'Hello three.js!', {
font: font,
size: 80,
height: 5,
curveSegments: 12,
bevelEnabled: true,
bevelThickness: 10,
bevelSize: 8,
bevelSegments: 5
} );
} );
</code>
<h2>
Constructor
</h2>
<h3>
[name]([page:String text], [page:Object parameters])
</h3>
<div>
text — The text that needs to be shown.
<br
/>
parameters — Object that can contains the following parameters.
<ul>
<li>
font — an instance of THREE.Font.
</li>
<li>
size — Float. Size of the text. Default is 100.
</li>
<li>
height — Float. Thickness to extrude text. Default is 50.
</li>
<li>
curveSegments — Integer. Number of points on the curves. Default is 12.
</li>
<li>
bevelEnabled — Boolean. Turn on bevel. Default is False.
</li>
<li>
bevelThickness — Float. How deep into text bevel goes. Default is 10.
</li>
<li>
bevelSize — Float. How far from text outline is bevel. Default is 8.
</li>
<li>
bevelSegments — Integer. Number of bevel segments. Default is 3.
</li>
</ul>
</div>
<h2>
Available Fonts
</h2>
<div>
TextGeometry uses
<a
href=
'http://gero3.github.io/facetype.js/'
target=
"_top"
>
typeface.json
</a>
generated fonts.
Some existing fonts can be found located in
<b>
/examples/fonts
</b>
and must be included in the page.
</div>
<table>
<tr>
<th>
Font
</th>
<th>
Weight
</th>
<th>
Style
</th>
<th>
File Path
</th>
</tr>
<tr>
<td>
helvetiker
</td>
<td>
normal
</td>
<td>
normal
</td>
<td>
/examples/fonts/helvetiker_regular.typeface.json
</td>
</tr>
<tr>
<td>
helvetiker
</td>
<td>
bold
</td>
<td>
normal
</td>
<td>
/examples/fonts/helvetiker_bold.typeface.json
</td>
</tr>
<tr>
<td>
optimer
</td>
<td>
normal
</td>
<td>
normal
</td>
<td>
/examples/fonts/optimer_regular.typeface.json
</td>
</tr>
<tr>
<td>
optimer
</td>
<td>
bold
</td>
<td>
normal
</td>
<td>
/examples/fonts/optimer_bold.typeface.json
</td>
</tr>
<tr>
<td>
gentilis
</td>
<td>
normal
</td>
<td>
normal
</td>
<td>
/examples/fonts/gentilis_regular.typeface.json
</td>
</tr>
<tr>
<td>
gentilis
</td>
<td>
bold
</td>
<td>
normal
</td>
<td>
/examples/fonts/gentilis_bold.typeface.json
</td>
</tr>
<tr>
<td>
droid sans
</td>
<td>
normal
</td>
<td>
normal
</td>
<td>
/examples/fonts/droid/droid_sans_regular.typeface.json
</td>
</tr>
<tr>
<td>
droid sans
</td>
<td>
bold
</td>
<td>
normal
</td>
<td>
/examples/fonts/droid/droid_sans_bold.typeface.json
</td>
</tr>
<tr>
<td>
droid serif
</td>
<td>
normal
</td>
<td>
normal
</td>
<td>
/examples/fonts/droid/droid_serif_regular.typeface.json
</td>
</tr>
<tr>
<td>
droid serif
</td>
<td>
bold
</td>
<td>
normal
</td>
<td>
/examples/fonts/droid/droid_serif_bold.typeface.json
</td>
</tr>
</table>
<h2>
Source
</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
docs/list.js
浏览文件 @
662818a9
...
...
@@ -168,6 +168,7 @@ var list = {
"
SphereGeometry
"
:
"
api/geometries/SphereGeometry
"
,
"
TetrahedronBufferGeometry
"
:
"
api/geometries/TetrahedronBufferGeometry
"
,
"
TetrahedronGeometry
"
:
"
api/geometries/TetrahedronGeometry
"
,
"
TextBufferGeometry
"
:
"
api/geometries/TextBufferGeometry
"
,
"
TextGeometry
"
:
"
api/geometries/TextGeometry
"
,
"
TorusBufferGeometry
"
:
"
api/geometries/TorusBufferGeometry
"
,
"
TorusGeometry
"
:
"
api/geometries/TorusGeometry
"
,
...
...
docs/scenes/js/geometry.js
浏览文件 @
662818a9
...
...
@@ -977,6 +977,75 @@ var guis = {
},
TextBufferGeometry
:
function
(
mesh
)
{
var
data
=
{
text
:
"
TextBufferGeometry
"
,
size
:
5
,
height
:
2
,
curveSegments
:
12
,
font
:
"
helvetiker
"
,
weight
:
"
regular
"
,
bevelEnabled
:
false
,
bevelThickness
:
1
,
bevelSize
:
0.5
,
bevelSegments
:
3
};
var
fonts
=
[
"
helvetiker
"
,
"
optimer
"
,
"
gentilis
"
,
"
droid/droid_serif
"
];
var
weights
=
[
"
regular
"
,
"
bold
"
];
function
generateGeometry
()
{
var
loader
=
new
THREE
.
FontLoader
();
loader
.
load
(
'
../../examples/fonts/
'
+
data
.
font
+
'
_
'
+
data
.
weight
+
'
.typeface.json
'
,
function
(
font
)
{
var
geometry
=
new
THREE
.
TextBufferGeometry
(
data
.
text
,
{
font
:
font
,
size
:
data
.
size
,
height
:
data
.
height
,
curveSegments
:
data
.
curveSegments
,
bevelEnabled
:
data
.
bevelEnabled
,
bevelThickness
:
data
.
bevelThickness
,
bevelSize
:
data
.
bevelSize
,
bevelSegments
:
data
.
bevelSegments
}
);
geometry
.
center
();
updateGroupGeometry
(
mesh
,
geometry
);
}
);
}
//Hide the wireframe
mesh
.
children
[
0
].
visible
=
false
;
var
folder
=
gui
.
addFolder
(
'
THREE.TextBufferGeometry
'
);
folder
.
add
(
data
,
'
text
'
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
size
'
,
1
,
30
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
height
'
,
1
,
20
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
curveSegments
'
,
1
,
20
).
step
(
1
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
font
'
,
fonts
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
weight
'
,
weights
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
bevelEnabled
'
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
bevelThickness
'
,
0.1
,
3
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
bevelSize
'
,
0.1
,
3
).
onChange
(
generateGeometry
);
folder
.
add
(
data
,
'
bevelSegments
'
,
0
,
8
).
step
(
1
).
onChange
(
generateGeometry
);
generateGeometry
();
},
TorusBufferGeometry
:
function
(
mesh
)
{
var
data
=
{
...
...
@@ -1349,7 +1418,7 @@ function chooseFromHash ( mesh ) {
}
if
(
selectedGeometry
===
'
TextGeometry
'
)
{
if
(
selectedGeometry
===
'
TextGeometry
'
||
selectedGeometry
===
'
TextBufferGeometry
'
)
{
return
{
fixed
:
true
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录