Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
5d980245
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,发现更多精彩内容 >>
提交
5d980245
编写于
6月 05, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed multi-holes bug in Text. Fixed spurious globals in Text and WebGLRenderer.
上级
e4b75f1c
变更
6
展开全部
显示空白变更内容
内联
并排
Showing
6 changed file
with
687 addition
and
669 deletion
+687
-669
build/Three.js
build/Three.js
+408
-408
build/custom/ThreeExtras.js
build/custom/ThreeExtras.js
+150
-150
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+87
-87
src/core/Vector2.js
src/core/Vector2.js
+9
-5
src/extras/geometries/Text.js
src/extras/geometries/Text.js
+28
-14
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+5
-5
未找到文件。
build/Three.js
浏览文件 @
5d980245
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
build/custom/ThreeExtras.js
浏览文件 @
5d980245
此差异已折叠。
点击以展开。
build/custom/ThreeWebGL.js
浏览文件 @
5d980245
此差异已折叠。
点击以展开。
src/core/Vector2.js
浏览文件 @
5d980245
...
...
@@ -157,17 +157,21 @@ THREE.Vector2.prototype = {
},
// deprecated: same as normalize
unit
:
function
()
{
return
this
.
normalize
();
// this.multiplyScalar( 1 / this.length() );
// return this;
},
equals
:
function
(
v
)
{
return
(
(
v
.
x
==
this
.
x
)
&&
(
v
.
y
==
this
.
y
)
);
// danger, works only on numbers which are exactly the same
// (which may be not what is expected thanks to floating point precision)
// (should be probably using some tiny epsilon instead of equality)
equals
:
function
(
v
)
{
return
(
(
v
.
x
==
this
.
x
)
&&
(
v
.
y
==
this
.
y
)
);
}
};
src/extras/geometries/Text.js
浏览文件 @
5d980245
/**
* @author zz85 / http://www.lab4games.net/zz85/blog
* @author alteredq / http://alteredqualia.com/
*
* For creating 3D text geometry in three.js
*
...
...
@@ -28,19 +29,25 @@ THREE.Text = function ( text, parameters ) {
var
size
=
parameters
.
size
!==
undefined
?
parameters
.
size
:
100
;
var
height
=
parameters
.
height
!==
undefined
?
parameters
.
height
:
50
;
var
curveSegments
=
parameters
.
curveSegments
!==
undefined
?
parameters
.
curveSegments
:
4
;
var
font
=
parameters
.
font
!==
undefined
?
parameters
.
font
:
"
helvetiker
"
;
var
weight
=
parameters
.
weight
!==
undefined
?
parameters
.
weight
:
"
normal
"
;
var
style
=
parameters
.
style
!==
undefined
?
parameters
.
style
:
"
normal
"
;
THREE
.
FontUtils
.
size
=
size
;
THREE
.
FontUtils
.
divisions
=
curveSegments
;
THREE
.
FontUtils
.
face
=
font
;
THREE
.
FontUtils
.
weight
=
weight
;
THREE
.
FontUtils
.
style
=
style
;
// Get a Font data json object
var
data
=
THREE
.
FontUtils
.
drawText
(
text
);
//console.log( "data", data );
vertices
=
data
.
points
;
faces
=
data
.
faces
;
contour
=
data
.
contour
;
v
ar
v
ertices
=
data
.
points
;
var
faces
=
data
.
faces
;
var
contour
=
data
.
contour
;
var
scope
=
this
;
...
...
@@ -125,15 +132,15 @@ THREE.Text = function ( text, parameters ) {
}
function
f3
(
a
,
b
,
c
)
{
function
f3
(
a
,
b
,
c
)
{
scope
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
b
,
c
)
);
scope
.
faces
.
push
(
new
THREE
.
Face3
(
a
,
b
,
c
)
);
}
function
f4
(
a
,
b
,
c
,
d
)
{
function
f4
(
a
,
b
,
c
,
d
)
{
scope
.
faces
.
push
(
new
THREE
.
Face4
(
a
,
b
,
c
,
d
)
);
scope
.
faces
.
push
(
new
THREE
.
Face4
(
a
,
b
,
c
,
d
)
);
}
...
...
@@ -215,6 +222,7 @@ THREE.FontUtils = {
}
var
firstIndex
,
holes
=
[];
while
(
endPt
<
all
.
length
)
{
...
...
@@ -258,16 +266,19 @@ THREE.FontUtils = {
// http://en.wikipedia.org/wiki/Closest_pair_of_points
// http://stackoverflow.com/questions/1602164/shortest-distance-between-points-algorithm
var
verts
=
[];
var
d
,
nextHoleVert
,
prevHoleVert
,
nextShapeVert
,
prevShapeVert
,
verts
=
[];
for
(
var
shapeId
in
isolatedShapes
)
{
var
shapeGroup
=
isolatedShapes
[
shapeId
];
shape
=
shapeGroup
.
shape
;
holes
=
shapeGroup
.
holes
;
for
(
var
h
in
holes
)
{
shape
=
shapeGroup
.
shape
;
// we slice to each hole when neccessary
var
hole
=
holes
[
h
];
...
...
@@ -353,12 +364,13 @@ THREE.FontUtils = {
// Now we push the "cutted" vertices back to the triangulated indices.
//console.log("we have verts.length",verts.length);
var
j
;
for
(
var
v
=
0
;
v
<
verts
.
length
/
3
;
v
++
)
{
var
v
,
k
,
j
;
for
(
v
=
0
;
v
<
verts
.
length
/
3
;
v
++
)
{
var
face
=
[];
for
(
var
k
=
0
;
k
<
3
;
k
++
)
{
for
(
k
=
0
;
k
<
3
;
k
++
)
{
for
(
j
=
0
;
j
<
points
.
length
;
j
++
)
{
...
...
@@ -493,7 +505,9 @@ THREE.FontUtils = {
extractGlyphPoints
:
function
(
pts
,
c
,
face
,
scale
,
offset
)
{
var
i
,
cpx
,
cpy
,
outline
,
action
,
length
,
var
i
,
x
,
y
,
cpx
,
cpy
,
cpx0
,
cpy0
,
cpx1
,
cpy1
,
outline
,
action
,
length
,
glyph
=
face
.
glyphs
[
c
]
||
face
.
glyphs
[
ctxt
.
options
.
fallbackCharacter
];
if
(
!
glyph
)
return
;
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
5d980245
...
...
@@ -826,7 +826,7 @@ THREE.WebGLRenderer = function ( parameters ) {
obj_skinVerticesB
=
geometry
.
skinVerticesB
,
obj_skinIndices
=
geometry
.
skinIndices
,
obj_skinWeights
=
geometry
.
skinWeights
,
obj_edgeFaces
=
object
instanceof
THREE
.
ShadowVolume
?
geometry
.
edgeFaces
:
undefined
;
obj_edgeFaces
=
object
instanceof
THREE
.
ShadowVolume
?
geometry
.
edgeFaces
:
undefined
,
morphTargets
=
geometry
.
morphTargets
;
...
...
@@ -4343,9 +4343,9 @@ THREE.WebGLRenderer = function ( parameters ) {
//
program
=
_gl
.
createProgram
()
,
program
=
_gl
.
createProgram
()
;
prefix_fragment
=
[
var
prefix_fragment
=
[
"
#ifdef GL_ES
"
,
"
precision highp float;
"
,
...
...
@@ -4366,9 +4366,9 @@ THREE.WebGLRenderer = function ( parameters ) {
"
uniform vec3 cameraPosition;
"
,
""
].
join
(
"
\n
"
)
,
].
join
(
"
\n
"
)
;
prefix_vertex
=
[
var
prefix_vertex
=
[
_supportsVertexTextures
?
"
#define VERTEX_TEXTURES
"
:
""
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录