Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
d2ea31a0
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,发现更多精彩内容 >>
提交
d2ea31a0
编写于
6月 15, 2012
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Another batch of examples resizing fixes.
This thing is neverending story ...
上级
9b05a880
变更
36
显示空白变更内容
内联
并排
Showing
36 changed file
with
252 addition
and
54 deletion
+252
-54
examples/canvas_geometry_cube.html
examples/canvas_geometry_cube.html
+2
-2
examples/canvas_geometry_earth.html
examples/canvas_geometry_earth.html
+2
-2
examples/canvas_geometry_hierarchy.html
examples/canvas_geometry_hierarchy.html
+2
-2
examples/canvas_geometry_terrain.html
examples/canvas_geometry_terrain.html
+2
-2
examples/canvas_geometry_text.html
examples/canvas_geometry_text.html
+2
-2
examples/canvas_lines.html
examples/canvas_lines.html
+2
-2
examples/canvas_lines_sphere.html
examples/canvas_lines_sphere.html
+2
-2
examples/canvas_materials_video.html
examples/canvas_materials_video.html
+2
-2
examples/canvas_particles_floor.html
examples/canvas_particles_floor.html
+2
-2
examples/canvas_particles_random.html
examples/canvas_particles_random.html
+2
-2
examples/canvas_particles_shapes.html
examples/canvas_particles_shapes.html
+5
-3
examples/canvas_particles_sprites.html
examples/canvas_particles_sprites.html
+2
-2
examples/canvas_particles_waves.html
examples/canvas_particles_waves.html
+2
-2
examples/canvas_sandbox.html
examples/canvas_sandbox.html
+2
-2
examples/webgl_lines_colors.html
examples/webgl_lines_colors.html
+2
-2
examples/webgl_loader_obj.html
examples/webgl_loader_obj.html
+2
-2
examples/webgl_loader_scene.html
examples/webgl_loader_scene.html
+2
-2
examples/webgl_loader_scene_blender.html
examples/webgl_loader_scene_blender.html
+2
-2
examples/webgl_loader_utf8.html
examples/webgl_loader_utf8.html
+2
-2
examples/webgl_lod.html
examples/webgl_lod.html
+2
-2
examples/webgl_materials_cars.html
examples/webgl_materials_cars.html
+2
-2
examples/webgl_materials_cars_anaglyph.html
examples/webgl_materials_cars_anaglyph.html
+2
-2
examples/webgl_materials_cars_camaro.html
examples/webgl_materials_cars_camaro.html
+2
-2
examples/webgl_materials_cars_camaro_crosseyed.html
examples/webgl_materials_cars_camaro_crosseyed.html
+2
-2
examples/webgl_materials_cars_parallaxbarrier.html
examples/webgl_materials_cars_parallaxbarrier.html
+2
-2
examples/webgl_materials_cubemap.html
examples/webgl_materials_cubemap.html
+19
-0
examples/webgl_materials_cubemap_balls_reflection.html
examples/webgl_materials_cubemap_balls_reflection.html
+19
-1
examples/webgl_materials_cubemap_balls_reflection_anaglyph.html
...es/webgl_materials_cubemap_balls_reflection_anaglyph.html
+19
-0
examples/webgl_materials_cubemap_balls_refraction.html
examples/webgl_materials_cubemap_balls_refraction.html
+19
-0
examples/webgl_materials_cubemap_balls_refraction_crosseyed.html
...s/webgl_materials_cubemap_balls_refraction_crosseyed.html
+17
-1
examples/webgl_materials_cubemap_escher.html
examples/webgl_materials_cubemap_escher.html
+16
-0
examples/webgl_materials_cubemap_refraction.html
examples/webgl_materials_cubemap_refraction.html
+19
-0
examples/webgl_materials_grass.html
examples/webgl_materials_grass.html
+14
-0
examples/webgl_materials_normalmap.html
examples/webgl_materials_normalmap.html
+20
-0
examples/webgl_materials_shaders.html
examples/webgl_materials_shaders.html
+17
-0
examples/webgl_materials_shaders_fresnel.html
examples/webgl_materials_shaders_fresnel.html
+20
-1
未找到文件。
examples/canvas_geometry_cube.html
浏览文件 @
d2ea31a0
...
...
@@ -100,8 +100,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/canvas_geometry_earth.html
浏览文件 @
d2ea31a0
...
...
@@ -124,8 +124,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/canvas_geometry_hierarchy.html
浏览文件 @
d2ea31a0
...
...
@@ -90,8 +90,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/canvas_geometry_terrain.html
浏览文件 @
d2ea31a0
...
...
@@ -106,8 +106,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/canvas_geometry_text.html
浏览文件 @
d2ea31a0
...
...
@@ -128,8 +128,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/canvas_lines.html
浏览文件 @
d2ea31a0
...
...
@@ -106,8 +106,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/canvas_lines_sphere.html
浏览文件 @
d2ea31a0
...
...
@@ -120,8 +120,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/canvas_materials_video.html
浏览文件 @
d2ea31a0
...
...
@@ -174,8 +174,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/canvas_particles_floor.html
浏览文件 @
d2ea31a0
...
...
@@ -97,8 +97,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/canvas_particles_random.html
浏览文件 @
d2ea31a0
...
...
@@ -90,8 +90,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/canvas_particles_shapes.html
浏览文件 @
d2ea31a0
...
...
@@ -190,9 +190,11 @@
};
var
onParticleCreated
=
function
(
p
)
{
var
onParticleCreated
=
function
(
p
)
{
var
position
=
p
.
position
;
p
.
target
.
position
=
position
;
};
var
onParticleDead
=
function
(
particle
)
{
...
...
@@ -246,8 +248,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/canvas_particles_sprites.html
浏览文件 @
d2ea31a0
...
...
@@ -81,8 +81,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/canvas_particles_waves.html
浏览文件 @
d2ea31a0
...
...
@@ -102,8 +102,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/canvas_sandbox.html
浏览文件 @
d2ea31a0
...
...
@@ -164,8 +164,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/webgl_lines_colors.html
浏览文件 @
d2ea31a0
...
...
@@ -185,8 +185,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/webgl_loader_obj.html
浏览文件 @
d2ea31a0
...
...
@@ -120,8 +120,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/webgl_loader_scene.html
浏览文件 @
d2ea31a0
...
...
@@ -319,8 +319,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/webgl_loader_scene_blender.html
浏览文件 @
d2ea31a0
...
...
@@ -286,8 +286,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/webgl_loader_utf8.html
浏览文件 @
d2ea31a0
...
...
@@ -133,8 +133,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/webgl_lod.html
浏览文件 @
d2ea31a0
...
...
@@ -134,8 +134,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/webgl_materials_cars.html
浏览文件 @
d2ea31a0
...
...
@@ -475,8 +475,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/webgl_materials_cars_anaglyph.html
浏览文件 @
d2ea31a0
...
...
@@ -470,8 +470,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/webgl_materials_cars_camaro.html
浏览文件 @
d2ea31a0
...
...
@@ -148,8 +148,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/webgl_materials_cars_camaro_crosseyed.html
浏览文件 @
d2ea31a0
...
...
@@ -158,8 +158,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/webgl_materials_cars_parallaxbarrier.html
浏览文件 @
d2ea31a0
...
...
@@ -470,8 +470,8 @@
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
...
...
examples/webgl_materials_cubemap.html
浏览文件 @
d2ea31a0
...
...
@@ -156,6 +156,25 @@
loader
.
load
(
"
obj/walt/WaltHead_bin.js
"
,
function
(
geometry
)
{
createScene
(
geometry
,
cubeMaterial1
,
cubeMaterial2
,
cubeMaterial3
)
}
);
//
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
cameraCube
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
cameraCube
.
updateProjectionMatrix
();
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
function
createScene
(
geometry
,
m1
,
m2
,
m3
)
{
...
...
examples/webgl_materials_cubemap_balls_reflection.html
浏览文件 @
d2ea31a0
...
...
@@ -79,7 +79,6 @@
cameraCube
=
new
THREE
.
PerspectiveCamera
(
60
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
100000
);
cubeTarget
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
sceneCube
.
add
(
cameraCube
);
var
geometry
=
new
THREE
.
SphereGeometry
(
100
,
32
,
16
);
...
...
@@ -136,6 +135,25 @@
renderer
.
autoClear
=
false
;
container
.
appendChild
(
renderer
.
domElement
);
//
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
cameraCube
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
cameraCube
.
updateProjectionMatrix
();
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
function
onDocumentMouseMove
(
event
)
{
...
...
examples/webgl_materials_cubemap_balls_reflection_anaglyph.html
浏览文件 @
d2ea31a0
...
...
@@ -127,7 +127,26 @@
renderer
=
new
THREE
.
WebGLRenderer
();
container
.
appendChild
(
renderer
.
domElement
);
var
width
=
window
.
innerWidth
||
2
;
var
height
=
window
.
innerHeight
||
2
;
effect
=
new
THREE
.
AnaglyphEffect
(
renderer
);
effect
.
setSize
(
width
,
height
);
//
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
effect
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
...
...
examples/webgl_materials_cubemap_balls_refraction.html
浏览文件 @
d2ea31a0
...
...
@@ -132,6 +132,25 @@
renderer
.
autoClear
=
false
;
container
.
appendChild
(
renderer
.
domElement
);
//
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
cameraCube
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
cameraCube
.
updateProjectionMatrix
();
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
function
onDocumentMouseMove
(
event
)
{
...
...
examples/webgl_materials_cubemap_balls_refraction_crosseyed.html
浏览文件 @
d2ea31a0
...
...
@@ -133,6 +133,22 @@
document
.
addEventListener
(
'
keydown
'
,
onKeyDown
,
false
);
//
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
effect
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
function
onDocumentMouseMove
(
event
)
{
...
...
examples/webgl_materials_cubemap_escher.html
浏览文件 @
d2ea31a0
...
...
@@ -118,6 +118,22 @@
}
//
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
function
onDocumentMouseMove
(
event
)
{
...
...
examples/webgl_materials_cubemap_refraction.html
浏览文件 @
d2ea31a0
...
...
@@ -150,6 +150,25 @@
document
.
addEventListener
(
'
mousemove
'
,
onDocumentMouseMove
,
false
);
//
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
cameraCube
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
cameraCube
.
updateProjectionMatrix
();
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
function
createScene
(
geometry
,
m1
,
m2
,
m3
)
{
...
...
examples/webgl_materials_grass.html
浏览文件 @
d2ea31a0
...
...
@@ -60,6 +60,19 @@
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
document
.
body
.
appendChild
(
renderer
.
domElement
);
//
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onWindowResize
()
{
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
function
generateTextureBase
()
{
...
...
@@ -84,6 +97,7 @@
context
.
globalCompositeOperation
=
'
lighter
'
;
return
canvas
;
}
function
generateTextureLevel
(
texture
)
{
...
...
examples/webgl_materials_normalmap.html
浏览文件 @
d2ea31a0
...
...
@@ -231,6 +231,26 @@
}
//
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
left
=
window
.
innerWidth
/
-
2
;
camera
.
right
=
window
.
innerWidth
/
2
;
camera
.
top
=
window
.
innerHeight
/
2
;
camera
.
bottom
=
window
.
innerHeight
/
-
2
;
camera
.
updateProjectionMatrix
();
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
function
createScene
(
geometry
,
scale
,
material1
,
material2
)
{
...
...
examples/webgl_materials_shaders.html
浏览文件 @
d2ea31a0
...
...
@@ -189,6 +189,23 @@
document
.
addEventListener
(
'
mousemove
'
,
onDocumentMouseMove
,
false
);
//
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
if
(
webglRenderer
)
webglRenderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
if
(
canvasRenderer
)
canvasRenderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
function
addToruses
(
geometry
)
{
...
...
examples/webgl_materials_shaders_fresnel.html
浏览文件 @
d2ea31a0
...
...
@@ -143,9 +143,28 @@
renderer
.
autoClear
=
false
;
container
.
appendChild
(
renderer
.
domElement
);
//
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onWindowResize
()
{
windowHalfX
=
window
.
innerWidth
/
2
;
windowHalfY
=
window
.
innerHeight
/
2
;
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
cameraCube
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
cameraCube
.
updateProjectionMatrix
();
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
function
onDocumentMouseMove
(
event
)
{
function
onDocumentMouseMove
(
event
)
{
mouseX
=
(
event
.
clientX
-
windowHalfX
)
*
10
;
mouseY
=
(
event
.
clientY
-
windowHalfY
)
*
10
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录