Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
1f1125f1
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,体验更适合开发者的 AI 搜索 >>
提交
1f1125f1
编写于
7月 16, 2021
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated examples builds
上级
17d8a12b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
17 deletion
+37
-17
examples/js/lines/LineMaterial.js
examples/js/lines/LineMaterial.js
+3
-3
examples/js/loaders/SVGLoader.js
examples/js/loaders/SVGLoader.js
+34
-14
未找到文件。
examples/js/lines/LineMaterial.js
浏览文件 @
1f1125f1
...
...
@@ -221,7 +221,7 @@
#endif
float alpha =
opacity
;
float alpha =
1.0
;
#ifdef ALPHA_TO_COVERAGE
...
...
@@ -251,12 +251,12 @@
#endif
vec4 diffuseColor = vec4( diffuse, alpha );
vec4 diffuseColor = vec4( diffuse,
opacity *
alpha );
#include <logdepthbuf_fragment>
#include <color_fragment>
gl_FragColor =
vec4( diffuseColor.rgb, alpha )
;
gl_FragColor =
diffuseColor
;
#include <tonemapping_fragment>
#include <encodings_fragment>
...
...
examples/js/loaders/SVGLoader.js
浏览文件 @
1f1125f1
...
...
@@ -651,29 +651,49 @@
const
x
=
parseFloatWithUnits
(
node
.
getAttribute
(
'
x
'
)
||
0
);
const
y
=
parseFloatWithUnits
(
node
.
getAttribute
(
'
y
'
)
||
0
);
const
rx
=
parseFloatWithUnits
(
node
.
getAttribute
(
'
rx
'
)
||
0
);
const
ry
=
parseFloatWithUnits
(
node
.
getAttribute
(
'
ry
'
)
||
0
);
const
rx
=
parseFloatWithUnits
(
node
.
getAttribute
(
'
rx
'
)
||
node
.
getAttribute
(
'
ry
'
)
||
0
);
const
ry
=
parseFloatWithUnits
(
node
.
getAttribute
(
'
ry
'
)
||
node
.
getAttribute
(
'
rx
'
)
||
0
);
const
w
=
parseFloatWithUnits
(
node
.
getAttribute
(
'
width
'
)
);
const
h
=
parseFloatWithUnits
(
node
.
getAttribute
(
'
height
'
)
);
const
path
=
new
THREE
.
ShapePath
();
path
.
moveTo
(
x
+
2
*
rx
,
y
);
path
.
lineTo
(
x
+
w
-
2
*
rx
,
y
);
if
(
rx
!==
0
||
ry
!==
0
)
path
.
bezierCurveTo
(
x
+
w
,
y
,
x
+
w
,
y
,
x
+
w
,
y
+
2
*
ry
);
path
.
lineTo
(
x
+
w
,
y
+
h
-
2
*
ry
);
if
(
rx
!==
0
||
ry
!==
0
)
path
.
bezierCurveTo
(
x
+
w
,
y
+
h
,
x
+
w
,
y
+
h
,
x
+
w
-
2
*
rx
,
y
+
h
);
path
.
lineTo
(
x
+
2
*
rx
,
y
+
h
);
const
h
=
parseFloatWithUnits
(
node
.
getAttribute
(
'
height
'
)
);
// Ellipse arc to Bezier approximation Coefficient (Inversed). See:
// https://spencermortensen.com/articles/bezier-circle/
const
bci
=
1
-
0.551915024494
;
const
path
=
new
THREE
.
ShapePath
();
// top left
path
.
moveTo
(
x
+
rx
,
y
);
// top right
path
.
lineTo
(
x
+
w
-
rx
,
y
);
if
(
rx
!==
0
||
ry
!==
0
)
{
path
.
bezierCurveTo
(
x
,
y
+
h
,
x
,
y
+
h
,
x
,
y
+
h
-
2
*
ry
);
path
.
bezierCurveTo
(
x
+
w
-
rx
*
bci
,
y
,
x
+
w
,
y
+
ry
*
bci
,
x
+
w
,
y
+
ry
);
}
// bottom right
path
.
lineTo
(
x
+
w
,
y
+
h
-
ry
);
if
(
rx
!==
0
||
ry
!==
0
)
{
path
.
bezierCurveTo
(
x
+
w
,
y
+
h
-
ry
*
bci
,
x
+
w
-
rx
*
bci
,
y
+
h
,
x
+
w
-
rx
,
y
+
h
);
}
// bottom left
path
.
lineTo
(
x
+
rx
,
y
+
h
);
if
(
rx
!==
0
||
ry
!==
0
)
{
path
.
bezierCurveTo
(
x
+
rx
*
bci
,
y
+
h
,
x
,
y
+
h
-
ry
*
bci
,
x
,
y
+
h
-
ry
);
}
// back to top left
}
path
.
lineTo
(
x
,
y
+
2
*
ry
);
path
.
lineTo
(
x
,
y
+
ry
);
if
(
rx
!==
0
||
ry
!==
0
)
{
path
.
bezierCurveTo
(
x
,
y
,
x
,
y
,
x
+
2
*
rx
,
y
);
path
.
bezierCurveTo
(
x
,
y
+
ry
*
bci
,
x
+
rx
*
bci
,
y
,
x
+
rx
,
y
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录