Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
0d872b4f
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,发现更多精彩内容 >>
提交
0d872b4f
编写于
11月 17, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated examples to the new *Mapping API.
上级
94b644d8
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
32 addition
and
32 deletion
+32
-32
editor/js/libs/ui.three.js
editor/js/libs/ui.three.js
+1
-3
examples/canvas_materials.html
examples/canvas_materials.html
+2
-2
examples/canvas_materials_reflection.html
examples/canvas_materials_reflection.html
+1
-1
examples/canvas_sandbox.html
examples/canvas_sandbox.html
+1
-1
examples/js/MD2Character.js
examples/js/MD2Character.js
+1
-1
examples/js/MD2CharacterComplex.js
examples/js/MD2CharacterComplex.js
+1
-1
examples/js/UCSCharacter.js
examples/js/UCSCharacter.js
+1
-1
examples/js/renderers/CanvasRenderer.js
examples/js/renderers/CanvasRenderer.js
+5
-3
examples/misc_controls_transform.html
examples/misc_controls_transform.html
+1
-1
examples/webgl_effects_stereo.html
examples/webgl_effects_stereo.html
+1
-1
examples/webgl_geometry_terrain.html
examples/webgl_geometry_terrain.html
+1
-1
examples/webgl_geometry_terrain_fog.html
examples/webgl_geometry_terrain_fog.html
+1
-1
examples/webgl_geometry_terrain_raycast.html
examples/webgl_geometry_terrain_raycast.html
+1
-1
examples/webgl_loader_json_objconverter.html
examples/webgl_loader_json_objconverter.html
+1
-1
examples/webgl_marchingcubes.html
examples/webgl_marchingcubes.html
+1
-1
examples/webgl_materials_cubemap.html
examples/webgl_materials_cubemap.html
+1
-1
examples/webgl_materials_cubemap_balls_refraction.html
examples/webgl_materials_cubemap_balls_refraction.html
+1
-1
examples/webgl_materials_cubemap_dynamic2.html
examples/webgl_materials_cubemap_dynamic2.html
+1
-1
examples/webgl_materials_cubemap_refraction.html
examples/webgl_materials_cubemap_refraction.html
+1
-1
examples/webgl_materials_texture_compressed.html
examples/webgl_materials_texture_compressed.html
+3
-3
examples/webgl_materials_texture_pvrtc.html
examples/webgl_materials_texture_pvrtc.html
+2
-2
examples/webgl_sandbox.html
examples/webgl_sandbox.html
+2
-2
examples/webgl_shading_physical.html
examples/webgl_shading_physical.html
+1
-1
未找到文件。
editor/js/libs/ui.three.js
浏览文件 @
0d872b4f
...
...
@@ -189,9 +189,7 @@ UI.CubeTexture = function () {
var
image
=
document
.
createElement
(
'
img
'
);
image
.
addEventListener
(
'
load
'
,
function
(
event
)
{
var
array
=
[
this
,
this
,
this
,
this
,
this
,
this
];
var
texture
=
new
THREE
.
Texture
(
array
,
new
THREE
.
CubeReflectionMapping
()
);
var
texture
=
new
THREE
.
Texture
(
this
,
THREE
.
SphericalReflectionMapping
);
texture
.
sourceFile
=
file
.
name
;
texture
.
needsUpdate
=
true
;
...
...
examples/canvas_materials.html
浏览文件 @
0d872b4f
...
...
@@ -76,8 +76,8 @@
new
THREE
.
MeshDepthMaterial
(
{
overdraw
:
0.5
}
),
new
THREE
.
MeshNormalMaterial
(
{
overdraw
:
0.5
}
),
new
THREE
.
MeshBasicMaterial
(
{
map
:
THREE
.
ImageUtils
.
loadTexture
(
'
textures/land_ocean_ice_cloud_2048.jpg
'
)
}
),
new
THREE
.
MeshBasicMaterial
(
{
envMap
:
THREE
.
ImageUtils
.
loadTexture
(
'
textures/envmap.png
'
,
new
THREE
.
SphericalReflectionMapping
()
),
overdraw
:
0.5
}
),
new
THREE
.
MeshBasicMaterial
(
{
envMap
:
THREE
.
ImageUtils
.
loadTexture
(
'
textures/envmap.png
'
,
new
THREE
.
SphericalRefractionMapping
()
),
overdraw
:
0.5
}
)
new
THREE
.
MeshBasicMaterial
(
{
envMap
:
THREE
.
ImageUtils
.
loadTexture
(
'
textures/envmap.png
'
,
THREE
.
SphericalReflectionMapping
),
overdraw
:
0.5
}
),
new
THREE
.
MeshBasicMaterial
(
{
envMap
:
THREE
.
ImageUtils
.
loadTexture
(
'
textures/envmap.png
'
,
THREE
.
SphericalRefractionMapping
),
overdraw
:
0.5
}
)
];
...
...
examples/canvas_materials_reflection.html
浏览文件 @
0d872b4f
...
...
@@ -67,7 +67,7 @@
geometry
.
computeVertexNormals
();
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshBasicMaterial
(
{
envMap
:
THREE
.
ImageUtils
.
loadTexture
(
'
textures/metal.jpg
'
,
new
THREE
.
SphericalReflectionMapping
()
),
overdraw
:
0.5
}
)
);
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshBasicMaterial
(
{
envMap
:
THREE
.
ImageUtils
.
loadTexture
(
'
textures/metal.jpg
'
,
THREE
.
SphericalReflectionMapping
),
overdraw
:
0.5
}
)
);
scene
.
add
(
mesh
);
}
);
...
...
examples/canvas_sandbox.html
浏览文件 @
0d872b4f
...
...
@@ -94,7 +94,7 @@
geometry
=
new
THREE
.
IcosahedronGeometry
(
100
,
1
);
material
=
new
THREE
.
MeshBasicMaterial
(
{
envMap
:
THREE
.
ImageUtils
.
loadTexture
(
'
textures/metal.jpg
'
,
new
THREE
.
SphericalReflectionMapping
()
),
overdraw
:
0.5
}
);
material
=
new
THREE
.
MeshBasicMaterial
(
{
envMap
:
THREE
.
ImageUtils
.
loadTexture
(
'
textures/metal.jpg
'
,
THREE
.
SphericalReflectionMapping
),
overdraw
:
0.5
}
);
for
(
var
i
=
0
;
i
<
10
;
i
++
)
{
...
...
examples/js/MD2Character.js
浏览文件 @
0d872b4f
...
...
@@ -183,7 +183,7 @@ THREE.MD2Character = function () {
function
loadTextures
(
baseUrl
,
textureUrls
)
{
var
mapping
=
new
THREE
.
UVMapping
()
;
var
mapping
=
THREE
.
UVMapping
;
var
textures
=
[];
for
(
var
i
=
0
;
i
<
textureUrls
.
length
;
i
++
)
{
...
...
examples/js/MD2CharacterComplex.js
浏览文件 @
0d872b4f
...
...
@@ -506,7 +506,7 @@ THREE.MD2CharacterComplex = function () {
function
loadTextures
(
baseUrl
,
textureUrls
)
{
var
mapping
=
new
THREE
.
UVMapping
()
;
var
mapping
=
THREE
.
UVMapping
;
var
textures
=
[];
for
(
var
i
=
0
;
i
<
textureUrls
.
length
;
i
++
)
{
...
...
examples/js/UCSCharacter.js
浏览文件 @
0d872b4f
...
...
@@ -78,7 +78,7 @@ THREE.UCSCharacter = function() {
}
function
loadTextures
(
baseUrl
,
textureUrls
)
{
var
mapping
=
new
THREE
.
UVMapping
()
;
var
mapping
=
THREE
.
UVMapping
;
var
textures
=
[];
for
(
var
i
=
0
;
i
<
textureUrls
.
length
;
i
++
)
{
...
...
examples/js/renderers/CanvasRenderer.js
浏览文件 @
0d872b4f
...
...
@@ -700,8 +700,10 @@ THREE.CanvasRenderer = function ( parameters ) {
material
instanceof
THREE
.
MeshPhongMaterial
)
{
if
(
material
.
map
!==
null
)
{
var
mapping
=
material
.
map
.
mapping
;
if
(
ma
terial
.
map
.
mapping
instanceof
THREE
.
UVMapping
)
{
if
(
ma
pping
===
THREE
.
UVMapping
)
{
_uvs
=
element
.
uvs
;
patternPath
(
_v1x
,
_v1y
,
_v2x
,
_v2y
,
_v3x
,
_v3y
,
_uvs
[
uv1
].
x
,
_uvs
[
uv1
].
y
,
_uvs
[
uv2
].
x
,
_uvs
[
uv2
].
y
,
_uvs
[
uv3
].
x
,
_uvs
[
uv3
].
y
,
material
.
map
);
...
...
@@ -710,7 +712,7 @@ THREE.CanvasRenderer = function ( parameters ) {
}
else
if
(
material
.
envMap
!==
null
)
{
if
(
ma
terial
.
envMap
.
mapping
instanceof
THREE
.
SphericalReflectionMapping
)
{
if
(
ma
pping
===
THREE
.
SphericalReflectionMapping
)
{
_normal
.
copy
(
element
.
vertexNormalsModel
[
uv1
]
).
applyMatrix3
(
_normalViewMatrix
);
_uv1x
=
0.5
*
_normal
.
x
+
0.5
;
...
...
@@ -726,7 +728,7 @@ THREE.CanvasRenderer = function ( parameters ) {
patternPath
(
_v1x
,
_v1y
,
_v2x
,
_v2y
,
_v3x
,
_v3y
,
_uv1x
,
_uv1y
,
_uv2x
,
_uv2y
,
_uv3x
,
_uv3y
,
material
.
envMap
);
}
else
if
(
ma
terial
.
envMap
.
mapping
instanceof
THREE
.
SphericalRefractionMapping
)
{
}
else
if
(
ma
pping
===
THREE
.
SphericalRefractionMapping
)
{
_normal
.
copy
(
element
.
vertexNormalsModel
[
uv1
]
).
applyMatrix3
(
_normalViewMatrix
);
_uv1x
=
-
0.5
*
_normal
.
x
+
0.5
;
...
...
examples/misc_controls_transform.html
浏览文件 @
0d872b4f
...
...
@@ -60,7 +60,7 @@
scene
.
add
(
light
);
var
texture
=
THREE
.
ImageUtils
.
loadTexture
(
'
textures/crate.gif
'
,
new
THREE
.
UVMapping
()
,
render
);
var
texture
=
THREE
.
ImageUtils
.
loadTexture
(
'
textures/crate.gif
'
,
THREE
.
UVMapping
,
render
);
texture
.
anisotropy
=
renderer
.
getMaxAnisotropy
();
var
geometry
=
new
THREE
.
BoxGeometry
(
200
,
200
,
200
);
...
...
examples/webgl_effects_stereo.html
浏览文件 @
0d872b4f
...
...
@@ -86,7 +86,7 @@
path
+
'
pz
'
+
format
,
path
+
'
nz
'
+
format
];
var
textureCube
=
THREE
.
ImageUtils
.
loadTextureCube
(
urls
,
new
THREE
.
CubeRefractionMapping
()
);
var
textureCube
=
THREE
.
ImageUtils
.
loadTextureCube
(
urls
,
THREE
.
CubeRefractionMapping
);
var
material
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffffff
,
envMap
:
textureCube
,
refractionRatio
:
0.95
}
);
for
(
var
i
=
0
;
i
<
500
;
i
++
)
{
...
...
examples/webgl_geometry_terrain.html
浏览文件 @
0d872b4f
...
...
@@ -92,7 +92,7 @@
}
texture
=
new
THREE
.
Texture
(
generateTexture
(
data
,
worldWidth
,
worldDepth
),
new
THREE
.
UVMapping
()
,
THREE
.
ClampToEdgeWrapping
,
THREE
.
ClampToEdgeWrapping
);
texture
=
new
THREE
.
Texture
(
generateTexture
(
data
,
worldWidth
,
worldDepth
),
THREE
.
UVMapping
,
THREE
.
ClampToEdgeWrapping
,
THREE
.
ClampToEdgeWrapping
);
texture
.
needsUpdate
=
true
;
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshBasicMaterial
(
{
map
:
texture
}
)
);
...
...
examples/webgl_geometry_terrain_fog.html
浏览文件 @
0d872b4f
...
...
@@ -94,7 +94,7 @@
}
texture
=
new
THREE
.
Texture
(
generateTexture
(
data
,
worldWidth
,
worldDepth
),
new
THREE
.
UVMapping
()
,
THREE
.
ClampToEdgeWrapping
,
THREE
.
ClampToEdgeWrapping
);
texture
=
new
THREE
.
Texture
(
generateTexture
(
data
,
worldWidth
,
worldDepth
),
THREE
.
UVMapping
,
THREE
.
ClampToEdgeWrapping
,
THREE
.
ClampToEdgeWrapping
);
texture
.
needsUpdate
=
true
;
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshBasicMaterial
(
{
map
:
texture
}
)
);
...
...
examples/webgl_geometry_terrain_raycast.html
浏览文件 @
0d872b4f
...
...
@@ -98,7 +98,7 @@
geometry
.
computeFaceNormals
();
texture
=
new
THREE
.
Texture
(
generateTexture
(
data
,
worldWidth
,
worldDepth
),
new
THREE
.
UVMapping
()
,
THREE
.
ClampToEdgeWrapping
,
THREE
.
ClampToEdgeWrapping
);
texture
=
new
THREE
.
Texture
(
generateTexture
(
data
,
worldWidth
,
worldDepth
),
THREE
.
UVMapping
,
THREE
.
ClampToEdgeWrapping
,
THREE
.
ClampToEdgeWrapping
);
texture
.
needsUpdate
=
true
;
mesh
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshBasicMaterial
(
{
map
:
texture
}
)
);
...
...
examples/webgl_loader_json_objconverter.html
浏览文件 @
0d872b4f
...
...
@@ -101,7 +101,7 @@
xc
.
fillStyle
=
"
#555
"
;
xc
.
fillRect
(
96
,
96
,
32
,
32
);
var
xm
=
new
THREE
.
MeshBasicMaterial
(
{
map
:
new
THREE
.
Texture
(
x
,
new
THREE
.
UVMapping
()
,
THREE
.
RepeatWrapping
,
THREE
.
RepeatWrapping
)
}
);
var
xm
=
new
THREE
.
MeshBasicMaterial
(
{
map
:
new
THREE
.
Texture
(
x
,
THREE
.
UVMapping
,
THREE
.
RepeatWrapping
,
THREE
.
RepeatWrapping
)
}
);
xm
.
map
.
needsUpdate
=
true
;
xm
.
map
.
repeat
.
set
(
10
,
10
);
...
...
examples/webgl_marchingcubes.html
浏览文件 @
0d872b4f
...
...
@@ -263,7 +263,7 @@
var
reflectionCube
=
THREE
.
ImageUtils
.
loadTextureCube
(
urls
);
reflectionCube
.
format
=
THREE
.
RGBFormat
;
var
refractionCube
=
new
THREE
.
Texture
(
reflectionCube
.
image
,
new
THREE
.
CubeRefractionMapping
()
);
var
refractionCube
=
new
THREE
.
Texture
(
reflectionCube
.
image
,
THREE
.
CubeRefractionMapping
);
reflectionCube
.
format
=
THREE
.
RGBFormat
;
// toons
...
...
examples/webgl_materials_cubemap.html
浏览文件 @
0d872b4f
...
...
@@ -108,7 +108,7 @@
var
reflectionCube
=
THREE
.
ImageUtils
.
loadTextureCube
(
urls
);
reflectionCube
.
format
=
THREE
.
RGBFormat
;
var
refractionCube
=
new
THREE
.
CubeTexture
(
reflectionCube
.
image
,
new
THREE
.
CubeRefractionMapping
()
);
var
refractionCube
=
new
THREE
.
CubeTexture
(
reflectionCube
.
image
,
THREE
.
CubeRefractionMapping
);
refractionCube
.
format
=
THREE
.
RGBFormat
;
//var cubeMaterial3 = new THREE.MeshPhongMaterial( { color: 0x000000, specular:0xaa0000, envMap: reflectionCube, combine: THREE.MixOperation, reflectivity: 0.25 } );
...
...
examples/webgl_materials_cubemap_balls_refraction.html
浏览文件 @
0d872b4f
...
...
@@ -86,7 +86,7 @@
path
+
'
pz
'
+
format
,
path
+
'
nz
'
+
format
];
var
textureCube
=
THREE
.
ImageUtils
.
loadTextureCube
(
urls
,
new
THREE
.
CubeRefractionMapping
()
);
var
textureCube
=
THREE
.
ImageUtils
.
loadTextureCube
(
urls
,
THREE
.
CubeRefractionMapping
);
var
material
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffffff
,
envMap
:
textureCube
,
refractionRatio
:
0.95
}
);
for
(
var
i
=
0
;
i
<
500
;
i
++
)
{
...
...
examples/webgl_materials_cubemap_dynamic2.html
浏览文件 @
0d872b4f
...
...
@@ -45,7 +45,7 @@
lat
=
0
,
onMouseDownLat
=
0
,
phi
=
0
,
theta
=
0
;
var
texture
=
THREE
.
ImageUtils
.
loadTexture
(
'
textures/2294472375_24a3b8ef46_o.jpg
'
,
new
THREE
.
UVMapping
()
,
function
()
{
var
texture
=
THREE
.
ImageUtils
.
loadTexture
(
'
textures/2294472375_24a3b8ef46_o.jpg
'
,
THREE
.
UVMapping
,
function
()
{
init
();
animate
();
...
...
examples/webgl_materials_cubemap_refraction.html
浏览文件 @
0d872b4f
...
...
@@ -103,7 +103,7 @@
r
+
"
py.jpg
"
,
r
+
"
ny.jpg
"
,
r
+
"
pz.jpg
"
,
r
+
"
nz.jpg
"
];
var
textureCube
=
THREE
.
ImageUtils
.
loadTextureCube
(
urls
,
new
THREE
.
CubeRefractionMapping
()
);
var
textureCube
=
THREE
.
ImageUtils
.
loadTextureCube
(
urls
,
THREE
.
CubeRefractionMapping
);
var
cubeMaterial3
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xccddff
,
envMap
:
textureCube
,
refractionRatio
:
0.98
,
reflectivity
:
0.9
}
);
var
cubeMaterial2
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xccfffd
,
envMap
:
textureCube
,
refractionRatio
:
0.985
}
);
...
...
examples/webgl_materials_texture_compressed.html
浏览文件 @
0d872b4f
...
...
@@ -95,21 +95,21 @@
var
cubemap1
=
loader
.
load
(
'
textures/compressed/Mountains.dds
'
,
function
(
texture
)
{
texture
.
magFilter
=
THREE
.
LinearFilter
texture
.
minFilter
=
THREE
.
LinearFilter
;
texture
.
mapping
=
new
THREE
.
CubeReflectionMapping
()
;
texture
.
mapping
=
THREE
.
CubeReflectionMapping
;
material1
.
needsUpdate
=
true
;
}
);
var
cubemap2
=
loader
.
load
(
'
textures/compressed/Mountains_argb_mip.dds
'
,
function
(
texture
)
{
texture
.
magFilter
=
THREE
.
LinearFilter
;
texture
.
minFilter
=
THREE
.
LinearFilter
;
texture
.
mapping
=
new
THREE
.
CubeReflectionMapping
()
;
texture
.
mapping
=
THREE
.
CubeReflectionMapping
;
material5
.
needsUpdate
=
true
;
}
);
var
cubemap3
=
loader
.
load
(
'
textures/compressed/Mountains_argb_nomip.dds
'
,
function
(
texture
)
{
texture
.
magFilter
=
THREE
.
LinearFilter
;
texture
.
minFilter
=
THREE
.
LinearFilter
;
texture
.
mapping
=
new
THREE
.
CubeReflectionMapping
()
;
texture
.
mapping
=
THREE
.
CubeReflectionMapping
;
material6
.
needsUpdate
=
true
;
}
);
...
...
examples/webgl_materials_texture_pvrtc.html
浏览文件 @
0d872b4f
...
...
@@ -73,14 +73,14 @@
var
onCube1Loaded
=
function
(
texture
){
texture
.
magFilter
=
THREE
.
LinearFilter
;
texture
.
minFilter
=
THREE
.
LinearFilter
;
texture
.
mapping
=
new
THREE
.
CubeReflectionMapping
()
;
texture
.
mapping
=
THREE
.
CubeReflectionMapping
;
material6
.
needsUpdate
=
true
;
};
var
onCube2Loaded
=
function
(
texture
){
texture
.
magFilter
=
THREE
.
LinearFilter
;
// texture.minFilter = THREE.LinearMipMapNearestFilter;
texture
.
minFilter
=
THREE
.
LinearFilter
;
texture
.
mapping
=
new
THREE
.
CubeReflectionMapping
()
;
texture
.
mapping
=
THREE
.
CubeReflectionMapping
;
material8
.
needsUpdate
=
true
;
};
...
...
examples/webgl_sandbox.html
浏览文件 @
0d872b4f
...
...
@@ -77,8 +77,8 @@
var
vertexShader
=
shader
.
vertexShader
;
var
fragmentShader
=
shader
.
fragmentShader
;
var
texture1
=
new
THREE
.
Texture
(
generateTexture
(
0
,
0.5
,
1
),
new
THREE
.
UVMapping
()
);
var
texture2
=
new
THREE
.
Texture
(
generateTexture
(
0
,
1
,
0
),
new
THREE
.
SphericalReflectionMapping
()
);
var
texture1
=
new
THREE
.
Texture
(
generateTexture
(
0
,
0.5
,
1
),
THREE
.
UVMapping
);
var
texture2
=
new
THREE
.
Texture
(
generateTexture
(
0
,
1
,
0
),
THREE
.
SphericalReflectionMapping
);
var
texture3
=
THREE
.
ImageUtils
.
loadTexture
(
'
textures/land_ocean_ice_cloud_2048.jpg
'
)
texture1
.
needsUpdate
=
true
;
...
...
examples/webgl_shading_physical.html
浏览文件 @
0d872b4f
...
...
@@ -146,7 +146,7 @@
xc
.
fillStyle
=
"
#555
"
;
xc
.
fillRect
(
96
,
96
,
32
,
32
);
var
texturePattern
=
new
THREE
.
Texture
(
x
,
new
THREE
.
UVMapping
()
,
THREE
.
RepeatWrapping
,
THREE
.
RepeatWrapping
);
var
texturePattern
=
new
THREE
.
Texture
(
x
,
THREE
.
UVMapping
,
THREE
.
RepeatWrapping
,
THREE
.
RepeatWrapping
);
texturePattern
.
needsUpdate
=
true
;
texturePattern
.
repeat
.
set
(
1000
,
1000
);
texturePattern
.
format
=
THREE
.
RGBFormat
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录