Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cqiang1993
AR.js
提交
68a22c32
A
AR.js
项目概览
cqiang1993
/
AR.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AR.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
68a22c32
编写于
5月 21, 2017
作者:
J
Jerome Etienne
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
made the duck pool round
上级
d818db7f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
11 deletion
+19
-11
three.js/examples/demo-scenes/threex-demoscenes.js
three.js/examples/demo-scenes/threex-demoscenes.js
+19
-11
未找到文件。
three.js/examples/demo-scenes/threex-demoscenes.js
浏览文件 @
68a22c32
...
...
@@ -204,15 +204,22 @@ THREEx.ARjsDemoScenes.prototype._createHolePool = function () {
// Code Separator
//////////////////////////////////////////////////////////////////////////////
function
buildCacheMesh
(){
// add outter cube - invisibility cloak
var
geometry
=
new
THREE
.
BoxGeometry
(
1
,
1
,
1
);
geometry
.
faces
.
splice
(
4
,
2
);
// make hole by removing top two triangles (is this assumption stable?)
var
geometry
=
new
THREE
.
RingGeometry
(
0.5
,
5
,
32
).
rotateX
(
-
Math
.
PI
/
2
);
var
material
=
THREEx
.
HoleInTheWall
.
buildTransparentMaterial
()
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
scale
.
set
(
1
,
1
,
1
).
multiplyScalar
(
1.02
)
mesh
.
position
.
y
=
-
0.5
markerScene
.
add
(
mesh
)
// radiusTop, radiusBottom, height
var
geometry
=
new
THREE
.
CylinderGeometry
(
0.5
,
0.5
,
0.05
,
32
,
1
,
true
)
var
material
=
new
THREE
.
MeshLambertMaterial
(
{
side
:
THREE
.
BackSide
,
color
:
'
lightgrey
'
})
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
)
mesh
.
position
.
y
=
-
geometry
.
parameters
.
height
/
2
markerScene
.
add
(
mesh
);
}
function
buildWater
(){
// build texture
...
...
@@ -241,11 +248,11 @@ THREEx.ARjsDemoScenes.prototype._createHolePool = function () {
normalMap
:
normalMap
})
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
y
=
-
0.
1
;
mesh
.
position
.
y
=
-
0.
05
;
markerScene
.
add
(
mesh
)
}
function
buildPoolWalls
(){
var
geometry
=
new
THREE
.
BoxGeometry
(
1
,
1
,
1
);
var
geometry
=
new
THREE
.
BoxGeometry
(
1
.1
,
1.1
,
1.
1
);
geometry
.
faces
.
splice
(
4
,
2
);
// remove top (though this is a backside material)
geometry
.
elementsNeedUpdate
=
true
;
...
...
@@ -254,7 +261,7 @@ THREEx.ARjsDemoScenes.prototype._createHolePool = function () {
map
:
new
THREE
.
TextureLoader
().
load
(
THREEx
.
ARjsDemoScenes
.
baseURL
+
'
examples/hole-in-the-wall/images/mosaic-256x256.jpg
'
),
})
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
y
=
-
0.5
mesh
.
position
.
y
=
-
geometry
.
parameters
.
height
/
2
markerScene
.
add
(
mesh
)
}
...
...
@@ -346,13 +353,14 @@ THREEx.ARjsDemoScenes.prototype._createHolePortal = function () {
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
rotateX
(
Math
.
PI
/
2
)
mesh
.
position
.
z
=
-
geometry
.
parameters
.
height
/
2
markerScene
.
add
(
mesh
);
markerScene
.
add
(
mesh
);
// add bounding sphere
var
geometry
=
new
THREE
.
SphereGeometry
(
3
,
32
,
16
,
0
,
Math
.
PI
,
Math
.
PI
,
Math
.
PI
);
geometry
.
scale
(
1
,
-
1
,
1
)
var
texture
=
new
THREE
.
TextureLoader
().
load
(
THREEx
.
ARjsDemoScenes
.
baseURL
+
'
examples/hole-in-the-wall/images/32211336474_380b67d014_k.jpg
'
)
var
material
=
new
THREE
.
MeshBasicMaterial
(
{
map
:
new
THREE
.
TextureLoader
().
load
(
THREEx
.
ARjsDemoScenes
.
baseURL
+
'
examples/hole-in-the-wall/images/32211336474_380b67d014_k.jpg
'
)
,
map
:
texture
,
side
:
THREE
.
DoubleSide
});
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录