Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
fb210eb8
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,发现更多精彩内容 >>
提交
fb210eb8
编写于
7月 24, 2015
作者:
G
gero3
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add new rule disallowNewlineBeforeBlockStatements
上级
92325645
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
32 addition
and
64 deletion
+32
-64
examples/js/Octree.js
examples/js/Octree.js
+1
-2
examples/js/SimplexNoise.js
examples/js/SimplexNoise.js
+1
-2
examples/js/Sparks.js
examples/js/Sparks.js
+10
-20
examples/js/WaterShader.js
examples/js/WaterShader.js
+2
-4
examples/js/crossfade/scenes.js
examples/js/crossfade/scenes.js
+2
-4
examples/js/crossfade/transition.js
examples/js/crossfade/transition.js
+3
-6
examples/js/loaders/AWDLoader.js
examples/js/loaders/AWDLoader.js
+3
-6
examples/js/loaders/AssimpJSONLoader.js
examples/js/loaders/AssimpJSONLoader.js
+1
-2
examples/js/postprocessing/GlitchPass.js
examples/js/postprocessing/GlitchPass.js
+9
-18
未找到文件。
examples/js/Octree.js
浏览文件 @
fb210eb8
...
...
@@ -1929,8 +1929,7 @@
tmin
;
// ray would intersect in reverse direction, i.e. this is behind ray
if
(
tmax
<
0
)
{
if
(
tmax
<
0
)
{
return
false
;
...
...
examples/js/SimplexNoise.js
浏览文件 @
fb210eb8
...
...
@@ -168,8 +168,7 @@ SimplexNoise.prototype.noise3d = function( xin, yin, zin ) {
var
i2
,
j2
,
k2
;
// Offsets for third corner of simplex in (i,j,k) coords
if
(
x0
>=
y0
)
{
if
(
y0
>=
z0
)
{
if
(
y0
>=
z0
)
{
i1
=
1
;
j1
=
0
;
k1
=
0
;
i2
=
1
;
j2
=
1
;
k2
=
0
;
...
...
examples/js/Sparks.js
浏览文件 @
fb210eb8
...
...
@@ -125,8 +125,7 @@ SPARKS.Emitter.prototype = {
// Update activities
len
=
this
.
_activities
.
length
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
{
this
.
_activities
[
i
].
update
(
this
,
time
);
...
...
@@ -139,12 +138,10 @@ SPARKS.Emitter.prototype = {
var
action
;
var
len2
=
this
.
_particles
.
length
;
for
(
j
=
0
;
j
<
len
;
j
++
)
{
for
(
j
=
0
;
j
<
len
;
j
++
)
{
action
=
this
.
_actions
[
j
];
for
(
i
=
0
;
i
<
len2
;
++
i
)
{
for
(
i
=
0
;
i
<
len2
;
++
i
)
{
particle
=
this
.
_particles
[
i
];
action
.
update
(
this
,
particle
,
time
);
...
...
@@ -155,12 +152,10 @@ SPARKS.Emitter.prototype = {
// remove dead particles
for
(
i
=
len2
;
i
--
;
)
{
for
(
i
=
len2
;
i
--
;
)
{
particle
=
this
.
_particles
[
i
];
if
(
particle
.
isDead
)
{
if
(
particle
.
isDead
)
{
//particle =
this
.
_particles
.
splice
(
i
,
1
);
...
...
@@ -389,15 +384,13 @@ SPARKS.Age = function( easing ) {
SPARKS
.
Age
.
prototype
.
update
=
function
(
emitter
,
particle
,
time
)
{
particle
.
age
+=
time
;
if
(
particle
.
age
>=
particle
.
lifetime
)
{
if
(
particle
.
age
>=
particle
.
lifetime
)
{
particle
.
energy
=
0
;
particle
.
isDead
=
true
;
}
else
{
else
{
var
t
=
this
.
_easing
(
particle
.
age
/
particle
.
lifetime
);
particle
.
energy
=
-
1
*
t
+
1
;
...
...
@@ -971,17 +964,14 @@ SPARKS.Utils = {
},
getPerpendicular
:
function
(
v
)
{
getPerpendicular
:
function
(
v
)
{
if
(
v
.
x
==
0
)
{
if
(
v
.
x
==
0
)
{
return
new
THREE
.
Vector3D
(
1
,
0
,
0
);
}
else
{
else
{
var
temp
=
new
THREE
.
Vector3
(
v
.
y
,
-
v
.
x
,
0
);
return
temp
.
normalize
();
...
...
examples/js/WaterShader.js
浏览文件 @
fb210eb8
...
...
@@ -141,8 +141,7 @@ THREE.Water = function ( renderer, camera, scene, options ) {
if
(
camera
instanceof
THREE
.
PerspectiveCamera
)
this
.
camera
=
camera
;
else
{
else
{
this
.
camera
=
new
THREE
.
PerspectiveCamera
();
console
.
log
(
this
.
name
+
'
: camera is not a Perspective Camera!
'
)
...
...
@@ -178,8 +177,7 @@ THREE.Water = function ( renderer, camera, scene, options ) {
this
.
material
.
uniforms
.
eye
.
value
=
this
.
eye
;
if
(
!
THREE
.
Math
.
isPowerOfTwo
(
width
)
||
!
THREE
.
Math
.
isPowerOfTwo
(
height
)
)
{
if
(
!
THREE
.
Math
.
isPowerOfTwo
(
width
)
||
!
THREE
.
Math
.
isPowerOfTwo
(
height
)
)
{
this
.
texture
.
generateMipmaps
=
false
;
this
.
texture
.
minFilter
=
THREE
.
LinearFilter
;
...
...
examples/js/crossfade/scenes.js
浏览文件 @
fb210eb8
...
...
@@ -38,8 +38,7 @@ function generateGeometry( objectType, numObjects ) {
scale
.
x
=
Math
.
random
()
*
200
+
100
;
if
(
objectType
==
"
cube
"
)
{
if
(
objectType
==
"
cube
"
)
{
geom
=
new
THREE
.
BoxGeometry
(
1
,
1
,
1
);
scale
.
y
=
Math
.
random
()
*
200
+
100
;
...
...
@@ -47,8 +46,7 @@ function generateGeometry( objectType, numObjects ) {
color
.
setRGB
(
0
,
0
,
Math
.
random
()
+
0.1
);
}
else
if
(
objectType
==
"
sphere
"
)
{
else
if
(
objectType
==
"
sphere
"
)
{
geom
=
new
THREE
.
IcosahedronGeometry
(
1
,
1
);
scale
.
y
=
scale
.
z
=
scale
.
x
;
...
...
examples/js/crossfade/transition.js
浏览文件 @
fb210eb8
...
...
@@ -120,18 +120,15 @@ function Transition ( sceneA, sceneB ) {
this
.
render
=
function
(
delta
)
{
// Transition animation
if
(
transitionParams
.
animateTransition
)
{
if
(
transitionParams
.
animateTransition
)
{
var
t
=
(
1
+
Math
.
sin
(
transitionParams
.
transitionSpeed
*
clock
.
getElapsedTime
()
/
Math
.
PI
)
)
/
2
;
transitionParams
.
transition
=
THREE
.
Math
.
smoothstep
(
t
,
0.3
,
0.7
);
// Change the current alpha texture after each transition
if
(
transitionParams
.
loopTexture
&&
(
transitionParams
.
transition
==
0
||
transitionParams
.
transition
==
1
)
)
{
if
(
transitionParams
.
loopTexture
&&
(
transitionParams
.
transition
==
0
||
transitionParams
.
transition
==
1
)
)
{
if
(
this
.
needChange
)
{
if
(
this
.
needChange
)
{
transitionParams
.
texture
=
(
transitionParams
.
texture
+
1
)
%
this
.
textures
.
length
;
this
.
quadmaterial
.
uniforms
.
tMixTexture
.
value
=
this
.
textures
[
transitionParams
.
texture
];
...
...
examples/js/loaders/AWDLoader.js
浏览文件 @
fb210eb8
...
...
@@ -55,15 +55,13 @@
AWDProperties
=
function
()
{}
AWDProperties
.
prototype
=
{
set
:
function
(
key
,
value
)
{
set
:
function
(
key
,
value
)
{
this
[
key
]
=
value
;
},
get
:
function
(
key
,
fallback
)
{
get
:
function
(
key
,
fallback
)
{
if
(
this
.
hasOwnProperty
(
key
)
)
return
this
[
key
];
...
...
@@ -548,8 +546,7 @@
mtx_data
=
this
.
parseMatrix4
();
}
else
{
}
else
{
mtx_data
=
new
THREE
.
Matrix4
();
...
...
examples/js/loaders/AssimpJSONLoader.js
浏览文件 @
fb210eb8
...
...
@@ -37,8 +37,7 @@ THREE.AssimpJSONLoader.prototype = {
// This header is used to disambiguate between
// different JSON-based file formats.
metadata
=
json
.
__metadata__
;
if
(
typeof
metadata
!==
'
undefined
'
)
{
if
(
typeof
metadata
!==
'
undefined
'
)
{
// Check if assimp2json at all
if
(
metadata
.
format
!==
'
assimp2json
'
)
{
...
...
examples/js/postprocessing/GlitchPass.js
浏览文件 @
fb210eb8
...
...
@@ -42,15 +42,13 @@ THREE.GlitchPass = function ( dt_size ) {
THREE
.
GlitchPass
.
prototype
=
{
render
:
function
(
renderer
,
writeBuffer
,
readBuffer
,
delta
)
{
render
:
function
(
renderer
,
writeBuffer
,
readBuffer
,
delta
)
{
this
.
uniforms
[
"
tDiffuse
"
].
value
=
readBuffer
;
this
.
uniforms
[
'
seed
'
].
value
=
Math
.
random
();
//default seeding
this
.
uniforms
[
'
byp
'
].
value
=
0
;
if
(
this
.
curF
%
this
.
randX
==
0
||
this
.
goWild
==
true
)
{
if
(
this
.
curF
%
this
.
randX
==
0
||
this
.
goWild
==
true
)
{
this
.
uniforms
[
'
amount
'
].
value
=
Math
.
random
()
/
30
;
this
.
uniforms
[
'
angle
'
].
value
=
THREE
.
Math
.
randFloat
(
-
Math
.
PI
,
Math
.
PI
);
...
...
@@ -62,8 +60,7 @@ THREE.GlitchPass.prototype = {
this
.
generateTrigger
();
}
else
if
(
this
.
curF
%
this
.
randX
<
this
.
randX
/
5
)
{
else
if
(
this
.
curF
%
this
.
randX
<
this
.
randX
/
5
)
{
this
.
uniforms
[
'
amount
'
].
value
=
Math
.
random
()
/
90
;
this
.
uniforms
[
'
angle
'
].
value
=
THREE
.
Math
.
randFloat
(
-
Math
.
PI
,
Math
.
PI
);
...
...
@@ -73,8 +70,7 @@ THREE.GlitchPass.prototype = {
this
.
uniforms
[
'
seed_y
'
].
value
=
THREE
.
Math
.
randFloat
(
-
0.3
,
0.3
);
}
else
if
(
this
.
goWild
==
false
)
{
else
if
(
this
.
goWild
==
false
)
{
this
.
uniforms
[
'
byp
'
].
value
=
1
;
...
...
@@ -82,35 +78,30 @@ THREE.GlitchPass.prototype = {
this
.
curF
++
;
this
.
quad
.
material
=
this
.
material
;
if
(
this
.
renderToScreen
)
{
if
(
this
.
renderToScreen
)
{
renderer
.
render
(
this
.
scene
,
this
.
camera
);
}
else
{
else
{
renderer
.
render
(
this
.
scene
,
this
.
camera
,
writeBuffer
,
false
);
}
},
generateTrigger
:
function
()
{
generateTrigger
:
function
()
{
this
.
randX
=
THREE
.
Math
.
randInt
(
120
,
240
);
},
generateHeightmap
:
function
(
dt_size
)
{
generateHeightmap
:
function
(
dt_size
)
{
var
data_arr
=
new
Float32Array
(
dt_size
*
dt_size
*
3
);
console
.
log
(
dt_size
);
var
length
=
dt_size
*
dt_size
;
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
var
val
=
THREE
.
Math
.
randFloat
(
0
,
1
);
data_arr
[
i
*
3
+
0
]
=
val
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录