Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
4a32ee68
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,发现更多精彩内容 >>
未验证
提交
4a32ee68
编写于
5月 03, 2018
作者:
M
Mr.doob
提交者:
GitHub
5月 03, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13936 from Mugen87/dev11
Examples: Clean up
上级
2012e3ef
c5fc7438
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
26 addition
and
43 deletion
+26
-43
examples/webgl_raycast_texture.html
examples/webgl_raycast_texture.html
+5
-10
examples/webgl_shaders_tonemapping.html
examples/webgl_shaders_tonemapping.html
+1
-15
examples/webgl_shadowmap.html
examples/webgl_shadowmap.html
+2
-2
examples/webgl_shadowmap_performance.html
examples/webgl_shadowmap_performance.html
+2
-2
examples/webvr_vive.html
examples/webvr_vive.html
+3
-3
examples/webvr_vive_paint.html
examples/webvr_vive_paint.html
+9
-7
examples/webvr_vive_sculpt.html
examples/webvr_vive_sculpt.html
+4
-4
未找到文件。
examples/webgl_raycast_texture.html
浏览文件 @
4a32ee68
...
...
@@ -225,20 +225,15 @@
cubeTexture
=
new
THREE
.
Texture
(
undefined
,
THREE
.
UVMapping
,
THREE
.
RepeatWrapping
,
THREE
.
RepeatWrapping
);
canvas
=
new
CanvasTexture
(
cubeTexture
);
var
cubeMaterial
=
new
THREE
.
MeshBasicMaterial
(
{
map
:
cubeTexture
}
);
var
cubeGeometry
=
new
THREE
.
BoxGeometry
(
20
,
20
,
20
);
var
cubeGeometry
=
new
THREE
.
BoxBufferGeometry
(
20
,
20
,
20
);
var
uvs
=
cubeGeometry
.
attributes
.
uv
.
array
;
// Set a specific texture mapping.
var
uvs
;
for
(
var
i
=
0
;
i
<
cubeGeometry
.
faceVertexUvs
[
0
].
length
;
i
++
)
{
uvs
=
cubeGeometry
.
faceVertexUvs
[
0
][
i
];
for
(
var
j
=
0
;
j
<
3
;
j
++
)
{
if
(
uvs
[
j
].
x
<
0.1
)
uvs
[
j
].
x
=
-
1
;
if
(
uvs
[
j
].
y
<
0.1
)
uvs
[
j
].
y
=
-
1
;
for
(
var
i
=
0
;
i
<
uvs
.
length
;
i
++
)
{
}
uvs
[
i
]
*=
2
;
}
var
cube
=
new
THREE
.
Mesh
(
cubeGeometry
,
cubeMaterial
);
cube
.
position
.
x
=
4
;
cube
.
position
.
y
=
-
5
;
...
...
examples/webgl_shaders_tonemapping.html
浏览文件 @
4a32ee68
...
...
@@ -323,22 +323,8 @@
var
textureCube
=
new
THREE
.
CubeTextureLoader
().
load
(
urls
);
textureCube
.
format
=
THREE
.
RGBFormat
;
var
skyboxShader
=
THREE
.
ShaderLib
[
"
cube
"
];
skyboxShader
.
uniforms
[
"
tCube
"
].
value
=
textureCube
;
var
skyboxMaterial
=
new
THREE
.
ShaderMaterial
(
{
fragmentShader
:
skyboxShader
.
fragmentShader
,
vertexShader
:
skyboxShader
.
vertexShader
,
uniforms
:
skyboxShader
.
uniforms
,
depthWrite
:
false
,
side
:
THREE
.
BackSide
}
),
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
BoxGeometry
(
100
,
100
,
100
),
skyboxMaterial
);
sceneCube
.
add
(
mesh
);
sceneCube
.
background
=
textureCube
;
renderer
=
new
THREE
.
WebGLRenderer
();
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
...
...
examples/webgl_shadowmap.html
浏览文件 @
4a32ee68
...
...
@@ -241,7 +241,7 @@
// CUBES
var
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
BoxGeometry
(
1500
,
220
,
150
),
planeMaterial
);
var
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
Box
Buffer
Geometry
(
1500
,
220
,
150
),
planeMaterial
);
mesh
.
position
.
y
=
FLOOR
-
50
;
mesh
.
position
.
z
=
20
;
...
...
@@ -251,7 +251,7 @@
scene
.
add
(
mesh
);
var
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
BoxGeometry
(
1600
,
170
,
250
),
planeMaterial
);
var
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
Box
Buffer
Geometry
(
1600
,
170
,
250
),
planeMaterial
);
mesh
.
position
.
y
=
FLOOR
-
50
;
mesh
.
position
.
z
=
20
;
...
...
examples/webgl_shadowmap_performance.html
浏览文件 @
4a32ee68
...
...
@@ -212,7 +212,7 @@
// CUBES
var
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
BoxGeometry
(
1500
,
220
,
150
),
planeMaterial
);
var
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
Box
Buffer
Geometry
(
1500
,
220
,
150
),
planeMaterial
);
mesh
.
position
.
y
=
FLOOR
-
50
;
mesh
.
position
.
z
=
20
;
...
...
@@ -222,7 +222,7 @@
scene
.
add
(
mesh
);
var
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
BoxGeometry
(
1600
,
170
,
250
),
planeMaterial
);
var
mesh
=
new
THREE
.
Mesh
(
new
THREE
.
Box
Buffer
Geometry
(
1600
,
170
,
250
),
planeMaterial
);
mesh
.
position
.
y
=
FLOOR
-
50
;
mesh
.
position
.
z
=
20
;
...
...
examples/webvr_vive.html
浏览文件 @
4a32ee68
...
...
@@ -60,7 +60,7 @@
camera
=
new
THREE
.
PerspectiveCamera
(
70
,
window
.
innerWidth
/
window
.
innerHeight
,
0.1
,
10
);
room
=
new
THREE
.
Mesh
(
new
THREE
.
BoxGeometry
(
6
,
6
,
6
,
8
,
8
,
8
),
new
THREE
.
Box
Buffer
Geometry
(
6
,
6
,
6
,
8
,
8
,
8
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x404040
,
wireframe
:
true
}
)
);
room
.
position
.
y
=
3
;
...
...
@@ -72,7 +72,7 @@
light
.
position
.
set
(
1
,
1
,
1
).
normalize
();
scene
.
add
(
light
);
var
geometry
=
new
THREE
.
BoxGeometry
(
0.2
,
0.2
,
0.2
);
var
geometry
=
new
THREE
.
Box
Buffer
Geometry
(
0.2
,
0.2
,
0.2
);
for
(
var
i
=
0
;
i
<
200
;
i
++
)
{
...
...
@@ -217,7 +217,7 @@
var
cube
=
room
.
children
[
i
];
if
(
cube
.
geometry
instanceof
THREE
.
BoxGeometry
===
false
)
continue
;
if
(
cube
.
geometry
instanceof
THREE
.
Box
Buffer
Geometry
===
false
)
continue
;
// cube.position.add( cube.userData.velocity );
...
...
examples/webvr_vive_paint.html
浏览文件 @
4a32ee68
...
...
@@ -71,7 +71,7 @@
camera
=
new
THREE
.
PerspectiveCamera
(
70
,
window
.
innerWidth
/
window
.
innerHeight
,
0.01
,
50
);
var
geometry
=
new
THREE
.
BoxGeometry
(
0.5
,
0.8
,
0.5
);
var
geometry
=
new
THREE
.
Box
Buffer
Geometry
(
0.5
,
0.8
,
0.5
);
var
material
=
new
THREE
.
MeshStandardMaterial
(
{
color
:
0x444444
,
roughness
:
1.0
,
...
...
@@ -93,7 +93,7 @@
scene.add( table );
*/
var
geometry
=
new
THREE
.
PlaneGeometry
(
4
,
4
);
var
geometry
=
new
THREE
.
Plane
Buffer
Geometry
(
4
,
4
);
var
material
=
new
THREE
.
MeshStandardMaterial
(
{
color
:
0x222222
,
roughness
:
1.0
,
...
...
@@ -162,8 +162,8 @@
controller
.
receiveShadow
=
true
;
// var pivot = new THREE.Group();
// var pivot = new THREE.Mesh( new THREE.BoxGeometry( 0.01, 0.01, 0.01 ) );
var
pivot
=
new
THREE
.
Mesh
(
new
THREE
.
IcosahedronGeometry
(
0.01
,
2
)
);
// var pivot = new THREE.Mesh( new THREE.Box
Buffer
Geometry( 0.01, 0.01, 0.01 ) );
var
pivot
=
new
THREE
.
Mesh
(
new
THREE
.
Icosahedron
Buffer
Geometry
(
0.01
,
2
)
);
pivot
.
name
=
'
pivot
'
;
pivot
.
position
.
y
=
-
0.016
;
pivot
.
position
.
z
=
-
0.043
;
...
...
@@ -230,20 +230,22 @@
scene
.
add
(
line
);
// Shapes
shapes
[
'
tube
'
]
=
getTubeShapes
(
1.0
);
shapes
[
'
tube
'
]
=
getTubeShapes
(
1.0
);
}
function
getTubeShapes
(
size
)
{
function
getTubeShapes
(
size
)
{
var
PI2
=
Math
.
PI
*
2
;
var
sides
=
10
;
var
array
=
[];
var
radius
=
0.01
*
size
;
for
(
var
i
=
0
;
i
<
sides
;
i
++
){
for
(
var
i
=
0
;
i
<
sides
;
i
++
)
{
var
angle
=
(
i
/
sides
)
*
PI2
;
array
.
push
(
new
THREE
.
Vector3
(
Math
.
sin
(
angle
)
*
radius
,
Math
.
cos
(
angle
)
*
radius
,
0
)
);
}
return
array
;
...
...
examples/webvr_vive_sculpt.html
浏览文件 @
4a32ee68
...
...
@@ -61,7 +61,7 @@
camera
=
new
THREE
.
PerspectiveCamera
(
70
,
window
.
innerWidth
/
window
.
innerHeight
,
0.01
,
50
);
var
geometry
=
new
THREE
.
BoxGeometry
(
0.5
,
0.8
,
0.5
);
var
geometry
=
new
THREE
.
Box
Buffer
Geometry
(
0.5
,
0.8
,
0.5
);
var
material
=
new
THREE
.
MeshStandardMaterial
(
{
color
:
0x444444
,
roughness
:
1.0
,
...
...
@@ -74,7 +74,7 @@
table
.
receiveShadow
=
true
;
scene
.
add
(
table
);
var
geometry
=
new
THREE
.
PlaneGeometry
(
4
,
4
);
var
geometry
=
new
THREE
.
Plane
Buffer
Geometry
(
4
,
4
);
var
material
=
new
THREE
.
MeshStandardMaterial
(
{
color
:
0x222222
,
roughness
:
1.0
,
...
...
@@ -139,8 +139,8 @@
controller
.
castShadow
=
true
;
controller
.
receiveShadow
=
true
;
// var pivot = new THREE.Mesh( new THREE.BoxGeometry( 0.01, 0.01, 0.01 ) );
var
pivot
=
new
THREE
.
Mesh
(
new
THREE
.
IcosahedronGeometry
(
0.002
,
2
),
blob
.
material
);
// var pivot = new THREE.Mesh( new THREE.Box
Buffer
Geometry( 0.01, 0.01, 0.01 ) );
var
pivot
=
new
THREE
.
Mesh
(
new
THREE
.
Icosahedron
Buffer
Geometry
(
0.002
,
2
),
blob
.
material
);
pivot
.
name
=
'
pivot
'
;
pivot
.
position
.
y
=
-
0.016
;
pivot
.
position
.
z
=
-
0.043
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录