Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
83b394eb
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,发现更多精彩内容 >>
未验证
提交
83b394eb
编写于
8月 25, 2018
作者:
M
Mr.doob
提交者:
GitHub
8月 25, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14785 from Mugen87/dev2
Examples: Removed unused variables
上级
3830394c
34e3dac8
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
43 addition
and
109 deletion
+43
-109
examples/canvas_lines.html
examples/canvas_lines.html
+2
-9
examples/canvas_materials_normal.html
examples/canvas_materials_normal.html
+2
-5
examples/canvas_materials_reflection.html
examples/canvas_materials_reflection.html
+0
-2
examples/js/MD2Character.js
examples/js/MD2Character.js
+25
-20
examples/webgl_animation_cloth.html
examples/webgl_animation_cloth.html
+1
-3
examples/webgl_animation_skinning_morph.html
examples/webgl_animation_skinning_morph.html
+0
-19
examples/webgl_camera_logarithmicdepthbuffer.html
examples/webgl_camera_logarithmicdepthbuffer.html
+0
-2
examples/webgl_geometry_terrain.html
examples/webgl_geometry_terrain.html
+1
-2
examples/webgl_geometry_terrain_fog.html
examples/webgl_geometry_terrain_fog.html
+1
-2
examples/webgl_geometry_terrain_raycast.html
examples/webgl_geometry_terrain_raycast.html
+1
-2
examples/webgl_lights_physical.html
examples/webgl_lights_physical.html
+0
-1
examples/webgl_loader_babylon.html
examples/webgl_loader_babylon.html
+4
-4
examples/webgl_loader_nrrd.html
examples/webgl_loader_nrrd.html
+0
-7
examples/webgl_materials_normalmap.html
examples/webgl_materials_normalmap.html
+0
-2
examples/webgl_materials_reflectivity.html
examples/webgl_materials_reflectivity.html
+0
-2
examples/webgl_materials_variations_basic.html
examples/webgl_materials_variations_basic.html
+0
-4
examples/webgl_materials_variations_lambert.html
examples/webgl_materials_variations_lambert.html
+0
-4
examples/webgl_materials_variations_phong.html
examples/webgl_materials_variations_phong.html
+1
-4
examples/webgl_materials_variations_standard.html
examples/webgl_materials_variations_standard.html
+1
-4
examples/webgl_materials_variations_toon.html
examples/webgl_materials_variations_toon.html
+1
-4
examples/webgl_physics_volume.html
examples/webgl_physics_volume.html
+1
-1
examples/webgl_postprocessing_sao.html
examples/webgl_postprocessing_sao.html
+0
-1
examples/webgl_shaders_vector.html
examples/webgl_shaders_vector.html
+0
-1
examples/webgl_shadowmap_performance.html
examples/webgl_shadowmap_performance.html
+1
-1
examples/webgl_sprites.html
examples/webgl_sprites.html
+1
-1
examples/webgl_tonemapping.html
examples/webgl_tonemapping.html
+0
-2
未找到文件。
examples/canvas_lines.html
浏览文件 @
83b394eb
...
...
@@ -30,10 +30,6 @@
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
SEPARATION
=
200
,
AMOUNTX
=
10
,
AMOUNTY
=
10
,
camera
,
scene
,
renderer
;
init
();
...
...
@@ -41,10 +37,7 @@
function
init
()
{
var
container
,
separation
=
100
,
amountX
=
50
,
amountY
=
50
,
particles
,
particle
;
container
=
document
.
createElement
(
'
div
'
);
var
container
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
container
);
camera
=
new
THREE
.
PerspectiveCamera
(
75
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
10000
);
...
...
@@ -77,7 +70,7 @@
for
(
var
i
=
0
;
i
<
100
;
i
++
)
{
particle
=
new
THREE
.
Sprite
(
material
);
var
particle
=
new
THREE
.
Sprite
(
material
);
particle
.
position
.
x
=
Math
.
random
()
*
2
-
1
;
particle
.
position
.
y
=
Math
.
random
()
*
2
-
1
;
particle
.
position
.
z
=
Math
.
random
()
*
2
-
1
;
...
...
examples/canvas_materials_normal.html
浏览文件 @
83b394eb
...
...
@@ -46,8 +46,7 @@
<script>
var
camera
,
scene
,
renderer
,
loader
,
mesh
;
var
camera
,
scene
,
renderer
,
mesh
;
init
();
animate
();
...
...
@@ -61,7 +60,7 @@
scene
=
new
THREE
.
Scene
();
loader
=
new
THREE
.
BufferGeometryLoader
();
var
loader
=
new
THREE
.
BufferGeometryLoader
();
loader
.
load
(
'
models/json/WaltHeadLo_buffergeometry.json
'
,
function
(
geometry
)
{
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshNormalMaterial
(
{
overdraw
:
0.5
}
)
);
...
...
@@ -100,8 +99,6 @@
function
render
()
{
var
time
=
Date
.
now
()
*
0.0005
;
if
(
mesh
)
{
mesh
.
rotation
.
x
-=
0.005
;
...
...
examples/canvas_materials_reflection.html
浏览文件 @
83b394eb
...
...
@@ -105,8 +105,6 @@
function
render
()
{
var
time
=
Date
.
now
()
*
0.0005
;
if
(
mesh
)
mesh
.
rotation
.
y
-=
0.01
;
renderer
.
render
(
scene
,
camera
);
...
...
examples/js/MD2Character.js
浏览文件 @
83b394eb
...
...
@@ -42,7 +42,7 @@ THREE.MD2Character = function () {
var
loader
=
new
THREE
.
MD2Loader
();
loader
.
load
(
config
.
baseUrl
+
config
.
body
,
function
(
geo
)
{
loader
.
load
(
config
.
baseUrl
+
config
.
body
,
function
(
geo
)
{
geo
.
computeBoundingBox
();
scope
.
root
.
position
.
y
=
-
scope
.
scale
*
geo
.
boundingBox
.
min
.
y
;
...
...
@@ -55,7 +55,7 @@ THREE.MD2Character = function () {
scope
.
meshBody
=
mesh
;
scope
.
meshBody
.
clipOffset
=
0
;
scope
.
activeAnimationClipName
=
mesh
.
geometry
.
animations
[
0
].
name
;
scope
.
activeAnimationClipName
=
mesh
.
geometry
.
animations
[
0
].
name
;
scope
.
mixer
=
new
THREE
.
AnimationMixer
(
mesh
);
...
...
@@ -67,7 +67,7 @@ THREE.MD2Character = function () {
var
generateCallback
=
function
(
index
,
name
)
{
return
function
(
geo
)
{
return
function
(
geo
)
{
var
mesh
=
createPart
(
geo
,
scope
.
skinsWeapon
[
index
]
);
mesh
.
scale
.
set
(
scope
.
scale
,
scope
.
scale
,
scope
.
scale
);
...
...
@@ -82,7 +82,7 @@ THREE.MD2Character = function () {
checkLoadingComplete
();
}
}
;
};
...
...
@@ -96,11 +96,14 @@ THREE.MD2Character = function () {
this
.
setPlaybackRate
=
function
(
rate
)
{
if
(
rate
!==
0
)
{
if
(
rate
!==
0
)
{
this
.
mixer
.
timeScale
=
1
/
rate
;
}
else
{
}
else
{
this
.
mixer
.
timeScale
=
0
;
}
};
...
...
@@ -121,7 +124,7 @@ THREE.MD2Character = function () {
};
this
.
setSkin
=
function
(
index
)
{
this
.
setSkin
=
function
(
index
)
{
if
(
this
.
meshBody
&&
this
.
meshBody
.
material
.
wireframe
===
false
)
{
...
...
@@ -152,13 +155,16 @@ THREE.MD2Character = function () {
if
(
this
.
meshBody
)
{
if
(
this
.
meshBody
.
activeAction
)
{
if
(
this
.
meshBody
.
activeAction
)
{
this
.
meshBody
.
activeAction
.
stop
();
this
.
meshBody
.
activeAction
=
null
;
}
var
action
=
this
.
mixer
.
clipAction
(
clipName
,
this
.
meshBody
);
if
(
action
)
{
if
(
action
)
{
this
.
meshBody
.
activeAction
=
action
.
play
();
...
...
@@ -172,35 +178,34 @@ THREE.MD2Character = function () {
};
this
.
syncWeaponAnimation
=
function
()
{
this
.
syncWeaponAnimation
=
function
()
{
var
clipName
=
scope
.
activeClipName
;
if
(
scope
.
meshWeapon
)
{
if
(
this
.
meshWeapon
.
activeAction
)
{
if
(
this
.
meshWeapon
.
activeAction
)
{
this
.
meshWeapon
.
activeAction
.
stop
();
this
.
meshWeapon
.
activeAction
=
null
;
}
var
geometry
=
this
.
meshWeapon
.
geometry
,
animations
=
geometry
.
animations
;
}
var
action
=
this
.
mixer
.
clipAction
(
clipName
,
this
.
meshWeapon
);
if
(
action
)
{
this
.
meshWeapon
.
activeAction
=
action
.
syncWith
(
this
.
meshBody
.
activeAction
).
play
();
if
(
action
)
{
this
.
meshWeapon
.
activeAction
=
action
.
syncWith
(
this
.
meshBody
.
activeAction
).
play
();
}
}
}
}
;
this
.
update
=
function
(
delta
)
{
if
(
this
.
mixer
)
this
.
mixer
.
update
(
delta
);
if
(
this
.
mixer
)
this
.
mixer
.
update
(
delta
);
};
...
...
examples/webgl_animation_cloth.html
浏览文件 @
83b394eb
...
...
@@ -104,11 +104,9 @@
// lights
var
light
,
materials
;
scene
.
add
(
new
THREE
.
AmbientLight
(
0x666666
)
);
light
=
new
THREE
.
DirectionalLight
(
0xdfebff
,
1
);
var
light
=
new
THREE
.
DirectionalLight
(
0xdfebff
,
1
);
light
.
position
.
set
(
50
,
200
,
100
);
light
.
position
.
multiplyScalar
(
1.3
);
...
...
examples/webgl_animation_skinning_morph.html
浏览文件 @
83b394eb
...
...
@@ -181,19 +181,9 @@
function
createScene
(
geometry
,
materials
,
x
,
y
,
z
,
s
)
{
//ensureLoop( geometry.animation );
geometry
.
computeBoundingBox
();
var
bb
=
geometry
.
boundingBox
;
var
path
=
"
textures/cube/Park2/
"
;
var
format
=
'
.jpg
'
;
var
urls
=
[
path
+
'
posx
'
+
format
,
path
+
'
negx
'
+
format
,
path
+
'
posy
'
+
format
,
path
+
'
negy
'
+
format
,
path
+
'
posz
'
+
format
,
path
+
'
negz
'
+
format
];
for
(
var
i
=
0
;
i
<
materials
.
length
;
i
++
)
{
var
m
=
materials
[
i
];
...
...
@@ -201,17 +191,8 @@
m
.
morphTargets
=
true
;
m
.
specular
.
setHSL
(
0
,
0
,
0.1
);
m
.
color
.
setHSL
(
0.6
,
0
,
0.6
);
//m.map = map;
//m.envMap = envMap;
//m.bumpMap = bumpMap;
//m.bumpScale = 2;
//m.combine = THREE.MixOperation;
//m.reflectivity = 0.75;
}
mesh
=
new
THREE
.
SkinnedMesh
(
geometry
,
materials
);
...
...
examples/webgl_camera_logarithmicdepthbuffer.html
浏览文件 @
83b394eb
...
...
@@ -193,8 +193,6 @@
emissive
:
0x000000
};
var
meshes
=
[];
var
geometry
=
new
THREE
.
SphereBufferGeometry
(
0.5
,
24
,
12
);
for
(
var
i
=
0
;
i
<
labeldata
.
length
;
i
++
)
{
...
...
examples/webgl_geometry_terrain.html
浏览文件 @
83b394eb
...
...
@@ -152,8 +152,7 @@
function
generateTexture
(
data
,
width
,
height
)
{
var
canvas
,
canvasScaled
,
context
,
image
,
imageData
,
level
,
diff
,
vector3
,
sun
,
shade
;
var
canvas
,
canvasScaled
,
context
,
image
,
imageData
,
vector3
,
sun
,
shade
;
vector3
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
...
...
examples/webgl_geometry_terrain_fog.html
浏览文件 @
83b394eb
...
...
@@ -155,8 +155,7 @@
function
generateTexture
(
data
,
width
,
height
)
{
var
canvas
,
canvasScaled
,
context
,
image
,
imageData
,
level
,
diff
,
vector3
,
sun
,
shade
;
var
canvas
,
canvasScaled
,
context
,
image
,
imageData
,
vector3
,
sun
,
shade
;
vector3
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
...
...
examples/webgl_geometry_terrain_raycast.html
浏览文件 @
83b394eb
...
...
@@ -168,8 +168,7 @@
// bake lighting into texture
var
canvas
,
canvasScaled
,
context
,
image
,
imageData
,
level
,
diff
,
vector3
,
sun
,
shade
;
var
canvas
,
canvasScaled
,
context
,
image
,
imageData
,
vector3
,
sun
,
shade
;
vector3
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
...
...
examples/webgl_lights_physical.html
浏览文件 @
83b394eb
...
...
@@ -290,7 +290,6 @@
hemiLight
.
intensity
=
hemiLuminousIrradiances
[
params
.
hemiIrradiance
];
var
time
=
Date
.
now
()
*
0.0005
;
var
delta
=
clock
.
getDelta
();
bulbLight
.
position
.
y
=
Math
.
cos
(
time
)
*
0.75
+
1.25
;
...
...
examples/webgl_loader_babylon.html
浏览文件 @
83b394eb
...
...
@@ -60,15 +60,15 @@
};
var
texture
=
new
THREE
.
Texture
();
var
material
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
'
red
'
}
);
var
onProgress
=
function
(
xhr
)
{
if
(
xhr
.
lengthComputable
)
{
var
percentComplete
=
xhr
.
loaded
/
xhr
.
total
*
100
;
console
.
log
(
Math
.
round
(
percentComplete
,
2
)
+
'
% downloaded
'
);
}
};
var
onError
=
function
(
xhr
)
{
...
...
examples/webgl_loader_nrrd.html
浏览文件 @
83b394eb
...
...
@@ -103,10 +103,7 @@
var
loader
=
new
THREE
.
NRRDLoader
();
loader
.
load
(
"
models/nrrd/I.nrrd
"
,
function
(
volume
)
{
var
geometry
,
canvas
,
canvasMap
,
material
,
plane
,
sliceZ
,
sliceY
,
sliceX
;
...
...
@@ -122,18 +119,14 @@
scene
.
add
(
cube
);
//z plane
var
indexZ
=
0
;
sliceZ
=
volume
.
extractSlice
(
'
z
'
,
Math
.
floor
(
volume
.
RASDimensions
[
2
]
/
4
));
scene
.
add
(
sliceZ
.
mesh
);
//y plane
var
indexY
=
0
;
sliceY
=
volume
.
extractSlice
(
'
y
'
,
Math
.
floor
(
volume
.
RASDimensions
[
1
]
/
2
));
scene
.
add
(
sliceY
.
mesh
);
//x plane
var
indexX
=
0
;
sliceX
=
volume
.
extractSlice
(
'
x
'
,
Math
.
floor
(
volume
.
RASDimensions
[
0
]
/
2
));
scene
.
add
(
sliceX
.
mesh
);
...
...
examples/webgl_materials_normalmap.html
浏览文件 @
83b394eb
...
...
@@ -158,8 +158,6 @@
var
effectColor
=
new
THREE
.
ShaderPass
(
THREE
.
ColorCorrectionShader
);
effectFXAA
=
new
THREE
.
ShaderPass
(
THREE
.
FXAAShader
);
var
canvas
=
renderer
.
context
.
canvas
;
effectFXAA
.
uniforms
[
'
resolution
'
].
value
.
set
(
1
/
window
.
innerWidth
,
1
/
window
.
innerHeight
);
effectBleach
.
uniforms
[
'
opacity
'
].
value
=
0.4
;
...
...
examples/webgl_materials_reflectivity.html
浏览文件 @
83b394eb
...
...
@@ -260,8 +260,6 @@
renderer
.
toneMappingExposure
=
params
.
exposure
;
var
timer
=
Date
.
now
()
*
0.00025
;
camera
.
lookAt
(
scene
.
position
);
if
(
params
.
autoRotate
)
{
...
...
examples/webgl_materials_variations_basic.html
浏览文件 @
83b394eb
...
...
@@ -76,10 +76,6 @@
imgTexture
.
anisotropy
=
16
;
imgTexture
=
null
;
var
shininess
=
50
,
specular
=
0x333333
;
var
materials
=
[];
var
cubeWidth
=
400
;
var
numberOfSphersPerSide
=
5
;
var
sphereRadius
=
(
cubeWidth
/
numberOfSphersPerSide
)
*
0.8
*
0.5
;
...
...
examples/webgl_materials_variations_lambert.html
浏览文件 @
83b394eb
...
...
@@ -76,10 +76,6 @@
imgTexture
.
anisotropy
=
16
;
imgTexture
=
null
;
var
shininess
=
50
,
specular
=
0x333333
;
var
materials
=
[];
var
cubeWidth
=
400
;
var
numberOfSphersPerSide
=
5
;
var
sphereRadius
=
(
cubeWidth
/
numberOfSphersPerSide
)
*
0.8
*
0.5
;
...
...
examples/webgl_materials_variations_phong.html
浏览文件 @
83b394eb
...
...
@@ -76,10 +76,7 @@
imgTexture
.
anisotropy
=
16
;
imgTexture
=
null
;
var
shininess
=
50
,
specular
=
0x333333
,
bumpScale
=
1
;
var
materials
=
[];
var
bumpScale
=
1
;
var
cubeWidth
=
400
;
var
numberOfSphersPerSide
=
5
;
var
sphereRadius
=
(
cubeWidth
/
numberOfSphersPerSide
)
*
0.8
*
0.5
;
...
...
examples/webgl_materials_variations_standard.html
浏览文件 @
83b394eb
...
...
@@ -101,10 +101,7 @@
hdrCubeRenderTarget
=
pmremCubeUVPacker
.
CubeUVRenderTarget
;
var
shininess
=
50
,
specular
=
0x333333
,
bumpScale
=
1
;
var
materials
=
[];
var
bumpScale
=
1
;
var
cubeWidth
=
400
;
var
numberOfSphersPerSide
=
5
;
var
sphereRadius
=
(
cubeWidth
/
numberOfSphersPerSide
)
*
0.8
*
0.5
;
...
...
examples/webgl_materials_variations_toon.html
浏览文件 @
83b394eb
...
...
@@ -78,10 +78,7 @@
imgTexture
.
anisotropy
=
16
;
imgTexture
=
null
;
var
shininess
=
50
,
specular
=
0x333333
,
bumpScale
=
1
;
var
materials
=
[];
var
bumpScale
=
1
;
var
cubeWidth
=
400
;
var
numberOfSphersPerSide
=
5
;
var
sphereRadius
=
(
cubeWidth
/
numberOfSphersPerSide
)
*
0.8
*
0.5
;
...
...
examples/webgl_physics_volume.html
浏览文件 @
83b394eb
...
...
@@ -204,7 +204,7 @@
var
geometry
=
new
THREE
.
Geometry
().
fromBufferGeometry
(
bufGeometry
);
// Merge the vertices so the triangle soup is converted to indexed triangles
var
vertsDiff
=
geometry
.
mergeVertices
();
geometry
.
mergeVertices
();
// Convert again to BufferGeometry, indexed
var
indexedBufferGeom
=
createIndexedBufferGeometryFromGeometry
(
geometry
);
...
...
examples/webgl_postprocessing_sao.html
浏览文件 @
83b394eb
...
...
@@ -183,7 +183,6 @@
var
width
=
window
.
innerWidth
||
1
;
var
height
=
window
.
innerHeight
||
1
;
var
devicePixelRatio
=
window
.
devicePixelRatio
||
1
;
camera
.
aspect
=
width
/
height
;
camera
.
updateProjectionMatrix
();
...
...
examples/webgl_shaders_vector.html
浏览文件 @
83b394eb
...
...
@@ -119,7 +119,6 @@
var
vA
=
new
THREE
.
Vector2
();
var
vB
=
new
THREE
.
Vector2
();
var
vDot
=
new
THREE
.
Vector2
();
function
processShape
(
path
,
reverse
)
{
...
...
examples/webgl_shadowmap_performance.html
浏览文件 @
83b394eb
...
...
@@ -238,7 +238,7 @@
for
(
var
i
=
0
;
i
!==
ANIMATION_GROUPS
;
++
i
)
{
var
group
=
new
THREE
.
AnimationObjectGroup
();
animGroups
.
push
(
new
THREE
.
AnimationObjectGroup
()
);
animGroups
.
push
(
group
);
}
...
...
examples/webgl_sprites.html
浏览文件 @
83b394eb
...
...
@@ -54,7 +54,7 @@
var
textureLoader
=
new
THREE
.
TextureLoader
();
var
mapA
=
textureLoader
.
load
(
"
textures/sprite0.png
"
,
createHUDSprites
);
textureLoader
.
load
(
"
textures/sprite0.png
"
,
createHUDSprites
);
var
mapB
=
textureLoader
.
load
(
"
textures/sprite1.png
"
);
mapC
=
textureLoader
.
load
(
"
textures/sprite2.png
"
);
...
...
examples/webgl_tonemapping.html
浏览文件 @
83b394eb
...
...
@@ -265,8 +265,6 @@
renderer
.
toneMappingExposure
=
params
.
exposure
;
renderer
.
toneMappingWhitePoint
=
params
.
whitePoint
;
var
timer
=
Date
.
now
()
*
0.00025
;
camera
.
lookAt
(
scene
.
position
);
for
(
var
i
=
0
,
l
=
group
.
children
.
length
;
i
<
l
;
i
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录