Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
209c8e1c
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,发现更多精彩内容 >>
提交
209c8e1c
编写于
12月 22, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/dev' into dev
上级
d8f0cfd1
46eaac93
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
29 addition
and
34 deletion
+29
-34
examples/canvas_lines_colors.html
examples/canvas_lines_colors.html
+1
-2
examples/js/renderers/CanvasRenderer.js
examples/js/renderers/CanvasRenderer.js
+1
-1
examples/js/renderers/Projector.js
examples/js/renderers/Projector.js
+1
-1
examples/webgl_geometries2.html
examples/webgl_geometries2.html
+0
-3
examples/webgl_gpgpu_birds.html
examples/webgl_gpgpu_birds.html
+25
-26
src/Three.js
src/Three.js
+1
-1
未找到文件。
examples/canvas_lines_colors.html
浏览文件 @
209c8e1c
...
...
@@ -80,8 +80,7 @@
scene
=
new
THREE
.
Scene
();
renderer
=
new
THREE
.
CanvasRenderer
(
{
antialias
:
false
}
);
renderer
.
setClearColor
(
0x000000
,
1
);
renderer
=
new
THREE
.
CanvasRenderer
();
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
container
.
appendChild
(
renderer
.
domElement
);
...
...
examples/js/renderers/CanvasRenderer.js
浏览文件 @
209c8e1c
...
...
@@ -66,7 +66,7 @@ THREE.CanvasRenderer = function ( parameters ) {
}
),
_clearColor
=
new
THREE
.
Color
(
0x000000
),
_clearAlpha
=
0
,
_clearAlpha
=
parameters
.
alpha
===
true
?
0
:
1
,
_contextGlobalAlpha
=
1
,
_contextGlobalCompositeOperation
=
0
,
...
...
examples/js/renderers/Projector.js
浏览文件 @
209c8e1c
...
...
@@ -145,7 +145,7 @@ THREE.Projector = function () {
this
.
pickingRay
=
function
(
vector
,
camera
)
{
console
.
error
(
'
THREE.Projector: .pickingRay()
has been removed
.
'
);
console
.
error
(
'
THREE.Projector: .pickingRay()
is now raycaster.setFromCamera()
.
'
);
};
...
...
examples/webgl_geometries2.html
浏览文件 @
209c8e1c
...
...
@@ -22,7 +22,6 @@
<script
src=
"js/CurveExtras.js"
></script>
<script
src=
"js/ParametricGeometries.js"
></script>
<script
src=
"js/utils/UVsUtils.js"
></script>
<script>
...
...
@@ -110,7 +109,6 @@
scene
.
add
(
object
);
var
geo
=
new
THREE
.
ParametricGeometry
(
THREE
.
ParametricGeometries
.
plane
(
200
,
200
),
10
,
20
);
// document.body.appendChild( THREE.UVsDebug( geo ));
object
=
THREE
.
SceneUtils
.
createMultiMaterialObject
(
geo
,
materials
);
object
.
position
.
set
(
0
,
0
,
0
);
scene
.
add
(
object
);
...
...
@@ -131,7 +129,6 @@
// scene.add( object );
object
=
THREE
.
SceneUtils
.
createMultiMaterialObject
(
sphere2
,
materials
);
// document.body.appendChild( THREE.UVsDebug( sphere2 ));
object
.
position
.
set
(
200
,
0
,
0
);
scene
.
add
(
object
);
...
...
examples/webgl_gpgpu_birds.html
浏览文件 @
209c8e1c
...
...
@@ -207,54 +207,53 @@
vec3
central
=
vec3
(
0
.,
0
.,
0
.
);
dir
=
selfPosition
-
central
;
dist
=
length
(
dir
);
dir
.
y
*=
2.5
;
velocity
-=
normalize
(
dir
)
*
delta
*
5
.;
for
(
float
y
=
0.0
;
y
<
height
;
y
++
)
{
for
(
float
x
=
0.0
;
x
<
width
;
x
++
)
{
if
(
x
==
gl_FragCoord
.
x
&&
y
==
gl_FragCoord
.
y
)
continue
;
birdPosition
=
texture2D
(
texturePosition
,
vec2
(
x
/
resolution
.
x
,
y
/
resolution
.
y
)
).
xyz
;
vec2
ref
=
vec2
(
x
+
0.5
,
y
+
0.5
)
/
resolution
.
xy
;
birdPosition
=
texture2D
(
texturePosition
,
ref
).
xyz
;
dir
=
birdPosition
-
selfPosition
;
dist
=
length
(
dir
);
distSquared
=
dist
*
dist
;
if
(
dist
>
0.0
&&
distSquared
<
zoneRadiusSquared
)
{
if
(
dist
<
0.0001
)
continue
;
distSquared
=
dist
*
dist
;
percent
=
distSquared
/
zoneRadiusSquared
;
if
(
distSquared
>
zoneRadiusSquared
)
continue
;
if
(
percent
<
separationThresh
)
{
// low
percent
=
distSquared
/
zoneRadiusSquared
;
// Separation - Move apart for comfort
f
=
(
separationThresh
/
percent
-
1.0
)
*
delta
;
velocity
-=
normalize
(
dir
)
*
f
;
if
(
percent
<
separationThresh
)
{
// low
}
else
if
(
percent
<
alignmentThresh
)
{
// high
// Separation - Move apart for comfort
f
=
(
separationThresh
/
percent
-
1.0
)
*
delta
;
velocity
-=
normalize
(
dir
)
*
f
;
// Alignment - fly the same direction
float
threshDelta
=
alignmentThresh
-
separationThresh
;
float
adjustedPercent
=
(
percent
-
separationThresh
)
/
threshDelta
;
}
else
if
(
percent
<
alignmentThresh
)
{
// high
birdVelocity
=
texture2D
(
textureVelocity
,
vec2
(
x
/
resolution
.
x
,
y
/
resolution
.
y
)
).
xyz
;
// Alignment - fly the same direction
float
threshDelta
=
alignmentThresh
-
separationThresh
;
float
adjustedPercent
=
(
percent
-
separationThresh
)
/
threshDelta
;
f
=
(
0.5
-
cos
(
adjustedPercent
*
PI_2
)
*
0.5
+
0.5
)
*
delta
;
velocity
+=
normalize
(
birdVelocity
)
*
f
;
birdVelocity
=
texture2D
(
textureVelocity
,
ref
).
xyz
;
}
else
{
f
=
(
0.5
-
cos
(
adjustedPercent
*
PI_2
)
*
0.5
+
0.5
)
*
delta
;
velocity
+=
normalize
(
birdVelocity
)
*
f
;
// Attraction / Cohesion - move closer
float
threshDelta
=
1.0
-
alignmentThresh
;
float
adjustedPercent
=
(
percent
-
alignmentThresh
)
/
threshDelta
;
}
else
{
f
=
(
0.5
-
(
cos
(
adjustedPercent
*
PI_2
)
*
-
0.5
+
0.5
)
)
*
delta
;
// Attraction / Cohesion - move closer
float
threshDelta
=
1.0
-
alignmentThresh
;
float
adjustedPercent
=
(
percent
-
alignmentThresh
)
/
threshDelta
;
velocity
+=
normalize
(
dir
)
*
f
;
f
=
(
0.5
-
(
cos
(
adjustedPercent
*
PI_2
)
*
-
0.5
+
0.5
)
)
*
delta
;
}
velocity
+=
normalize
(
dir
)
*
f
;
}
...
...
src/Three.js
浏览文件 @
209c8e1c
...
...
@@ -205,7 +205,7 @@ THREE.Projector = function () {
this
.
pickingRay
=
function
(
vector
,
camera
)
{
console
.
error
(
'
THREE.Projector: .pickingRay()
has been removed
.
'
);
console
.
error
(
'
THREE.Projector: .pickingRay()
is now raycaster.setFromCamera()
.
'
);
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录