Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
deddb9dd
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,发现更多精彩内容 >>
提交
deddb9dd
编写于
3月 18, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Converted webgl_effects_cardboard to webvr_shadow. See #8400.
上级
355f686f
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
23 addition
and
26 deletion
+23
-26
examples/files.js
examples/files.js
+1
-1
examples/webvr_shadow.html
examples/webvr_shadow.html
+22
-25
未找到文件。
examples/files.js
浏览文件 @
deddb9dd
...
@@ -8,7 +8,6 @@ var files = {
...
@@ -8,7 +8,6 @@ var files = {
"
webgl_camera_logarithmicdepthbuffer
"
,
"
webgl_camera_logarithmicdepthbuffer
"
,
"
webgl_decals
"
,
"
webgl_decals
"
,
"
webgl_effects_anaglyph
"
,
"
webgl_effects_anaglyph
"
,
"
webgl_effects_cardboard
"
,
"
webgl_effects_parallaxbarrier
"
,
"
webgl_effects_parallaxbarrier
"
,
"
webgl_effects_peppersghost
"
,
"
webgl_effects_peppersghost
"
,
"
webgl_effects_stereo
"
,
"
webgl_effects_stereo
"
,
...
@@ -239,6 +238,7 @@ var files = {
...
@@ -239,6 +238,7 @@ var files = {
"
webvr_cubes
"
,
"
webvr_cubes
"
,
"
webvr_panorama
"
,
"
webvr_panorama
"
,
"
webvr_rollercoaster
"
,
"
webvr_rollercoaster
"
,
"
webvr_shadow
"
,
"
webvr_video
"
"
webvr_video
"
],
],
"
css3d
"
:
[
"
css3d
"
:
[
...
...
examples/web
gl_effects_cardboard
.html
→
examples/web
vr_shadow
.html
浏览文件 @
deddb9dd
...
@@ -14,11 +14,22 @@
...
@@ -14,11 +14,22 @@
<body>
<body>
<script
src=
"../build/three.min.js"
></script>
<script
src=
"../build/three.min.js"
></script>
<script
src=
"js/effects/CardboardEffect.js"
></script>
<script
src=
"js/WebVR.js"
></script>
<script
src=
"js/controls/VRControls.js"
></script>
<script
src=
"js/effects/VREffect.js"
></script>
<script>
<script>
if
(
WEBVR
.
isLatestAvailable
()
===
false
)
{
document
.
body
.
appendChild
(
WEBVR
.
getMessage
()
);
}
//
var
camera
,
scene
,
renderer
;
var
camera
,
scene
,
renderer
;
var
effect
;
var
effect
,
controls
;
init
();
init
();
animate
();
animate
();
...
@@ -62,40 +73,24 @@
...
@@ -62,40 +73,24 @@
//
//
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
fals
e
}
);
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
tru
e
}
);
renderer
.
setClearColor
(
0x101010
);
renderer
.
setClearColor
(
0x101010
);
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
renderer
.
shadowMap
.
enabled
=
true
;
renderer
.
shadowMap
.
enabled
=
true
;
document
.
body
.
appendChild
(
renderer
.
domElement
);
document
.
body
.
appendChild
(
renderer
.
domElement
);
renderer
.
domElement
.
addEventListener
(
'
click
'
,
function
()
{
//
if
(
this
.
requestFullscreen
)
{
this
.
requestFullscreen
();
}
else
if
(
this
.
msRequestFullscreen
)
{
this
.
msRequestFullscreen
();
}
else
if
(
this
.
mozRequestFullScreen
)
{
this
.
mozRequestFullScreen
();
controls
=
new
THREE
.
VRControls
(
camera
);
effect
=
new
THREE
.
VREffect
(
renderer
);
}
else
if
(
this
.
webkitRequestFullscreen
)
{
if
(
WEBVR
.
isAvailable
()
===
true
)
{
this
.
webkitRequestFullscreen
(
);
document
.
body
.
appendChild
(
WEBVR
.
getButton
(
effect
)
);
}
}
}
);
//
effect
=
new
THREE
.
CardboardEffect
(
renderer
);
effect
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
//
//
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
...
@@ -129,6 +124,8 @@
...
@@ -129,6 +124,8 @@
mesh
.
rotation
.
x
=
time
*
2
;
mesh
.
rotation
.
x
=
time
*
2
;
mesh
.
rotation
.
y
=
time
*
5
;
mesh
.
rotation
.
y
=
time
*
5
;
controls
.
update
();
effect
.
render
(
scene
,
camera
);
effect
.
render
(
scene
,
camera
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录