Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
61086583
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,发现更多精彩内容 >>
提交
61086583
编写于
5月 21, 2018
作者:
W
WestLangley
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
PointsMaterial: add morph target support
上级
a24fe06a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
38 addition
and
6 deletion
+38
-6
docs/api/materials/PointsMaterial.html
docs/api/materials/PointsMaterial.html
+3
-0
examples/webgl_morphtargets_sphere.html
examples/webgl_morphtargets_sphere.html
+27
-6
src/materials/PointsMaterial.js
src/materials/PointsMaterial.js
+6
-0
src/renderers/shaders/ShaderLib/points_vert.glsl
src/renderers/shaders/ShaderLib/points_vert.glsl
+2
-0
未找到文件。
docs/api/materials/PointsMaterial.html
浏览文件 @
61086583
...
...
@@ -84,6 +84,9 @@ scene.add( starField );
<p>
Sets the color of the points using data from a [page:Texture].
</p>
<h3>
[property:Boolean morphTargets]
</h3>
<p>
Define whether the material uses morphTargets. Default is false.
</p>
<h3>
[property:Number size]
</h3>
<p>
Sets the size of the points. Default is 1.0.
</p>
...
...
examples/webgl_morphtargets_sphere.html
浏览文件 @
61086583
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
three.js webgl - morph targets -
hors
e
</title>
<title>
three.js webgl - morph targets -
spher
e
</title>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<style>
...
...
@@ -63,15 +63,13 @@
camera
.
position
.
set
(
0
,
5
,
5
);
scene
=
new
THREE
.
Scene
();
scene
.
background
=
new
THREE
.
Color
(
0x222222
);
scene
.
fog
=
new
THREE
.
Fog
(
0x000000
,
1
,
15000
);
var
light
=
new
THREE
.
PointLight
(
0xff2200
,
0.7
);
light
.
position
.
set
(
100
,
100
,
100
);
scene
.
add
(
light
);
light
=
new
THREE
.
PointLight
(
0x22ff00
,
0.7
);
light
.
position
.
set
(
-
100
,
-
100
,
-
100
);
light
.
position
.
set
(
-
100
,
-
100
,
-
100
);
scene
.
add
(
light
);
light
=
new
THREE
.
AmbientLight
(
0x111111
);
...
...
@@ -90,9 +88,30 @@
mesh
.
rotation
.
z
=
Math
.
PI
/
2
;
//mesh.material.visible = false;
scene
.
add
(
mesh
);
});
//
var
pointsMaterial
=
new
THREE
.
PointsMaterial
(
{
size
:
10
,
sizeAttenuation
:
false
,
map
:
new
THREE
.
TextureLoader
().
load
(
'
textures/sprites/disc.png
'
),
alphaTest
:
0.5
,
morphTargets
:
true
}
);
points
=
new
THREE
.
Points
(
mesh
.
geometry
,
pointsMaterial
);
points
.
morphTargetInfluences
=
mesh
.
morphTargetInfluences
;
points
.
morphTargetDictionary
=
mesh
.
morphTargetDictionary
;
mesh
.
add
(
points
);
}
);
//
...
...
@@ -104,6 +123,8 @@
//
controls
=
new
THREE
.
OrbitControls
(
camera
,
renderer
.
domElement
);
controls
.
minDistance
=
1
;
controls
.
maxDistance
=
20
;
//
...
...
@@ -137,7 +158,7 @@
if
(
mesh
.
morphTargetInfluences
[
1
]
<=
0
||
mesh
.
morphTargetInfluences
[
1
]
>=
1
)
{
sign
*=
-
1
;
sign
*=
-
1
;
}
...
...
src/materials/PointsMaterial.js
浏览文件 @
61086583
...
...
@@ -12,6 +12,8 @@ import { Color } from '../math/Color.js';
*
* size: <float>,
* sizeAttenuation: <bool>
*
* morphTargets: <bool>
* }
*/
...
...
@@ -28,6 +30,8 @@ function PointsMaterial( parameters ) {
this
.
size
=
1
;
this
.
sizeAttenuation
=
true
;
this
.
morphTargets
=
false
;
this
.
lights
=
false
;
this
.
setValues
(
parameters
);
...
...
@@ -50,6 +54,8 @@ PointsMaterial.prototype.copy = function ( source ) {
this
.
size
=
source
.
size
;
this
.
sizeAttenuation
=
source
.
sizeAttenuation
;
this
.
morphTargets
=
source
.
morphTargets
;
return
this
;
};
...
...
src/renderers/shaders/ShaderLib/points_vert.glsl
浏览文件 @
61086583
...
...
@@ -4,6 +4,7 @@ uniform float scale;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
...
...
@@ -11,6 +12,7 @@ void main() {
#include <color_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <project_vertex>
#ifdef USE_SIZEATTENUATION
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录