Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
f6fa6070
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,发现更多精彩内容 >>
提交
f6fa6070
编写于
8月 31, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed texture filtering example.
There was z-fighting and obsolete UVs hacking.
上级
918f36cf
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
28 deletion
+17
-28
examples/webgl_materials_texture_filters.html
examples/webgl_materials_texture_filters.html
+17
-28
未找到文件。
examples/webgl_materials_texture_filters.html
浏览文件 @
f6fa6070
...
...
@@ -109,6 +109,7 @@
context
.
fillStyle
=
"
#444
"
;
context
.
fillRect
(
0
,
0
,
128
,
128
);
context
.
fillStyle
=
"
#fff
"
;
context
.
fillRect
(
0
,
0
,
64
,
64
);
context
.
fillRect
(
64
,
64
,
64
,
64
);
...
...
@@ -117,36 +118,25 @@
materialCanvas
=
new
THREE
.
MeshBasicMaterial
(
{
map
:
textureCanvas
}
);
textureCanvas
.
needsUpdate
=
true
;
textureCanvas
.
repeat
.
set
(
1000
,
1000
);
var
textureCanvas2
=
new
THREE
.
Texture
(
imageCanvas
,
THREE
.
UVMapping
,
THREE
.
RepeatWrapping
,
THREE
.
RepeatWrapping
,
THREE
.
NearestFilter
,
THREE
.
NearestFilter
);
materialCanvas2
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffccaa
,
map
:
textureCanvas2
}
);
materialCanvas2
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffccaa
,
map
:
textureCanvas2
}
);
textureCanvas2
.
needsUpdate
=
true
;
textureCanvas2
.
repeat
.
set
(
1000
,
1000
);
var
i
,
j
,
uvs
,
geometryRepeat
=
new
THREE
.
PlaneGeometry
(
100
,
100
,
1
,
1
);
for
(
i
=
0
;
i
<
geometryRepeat
.
faceVertexUvs
[
0
].
length
;
i
++
)
{
uvs
=
geometryRepeat
.
faceVertexUvs
[
0
][
i
];
for
(
j
=
0
;
j
<
uvs
.
length
;
j
++
)
{
uvs
[
j
].
u
*=
1000
;
uvs
[
j
].
v
*=
1000
;
}
}
var
geometry
=
new
THREE
.
PlaneGeometry
(
100
,
100
);
var
meshCanvas
=
new
THREE
.
Mesh
(
geometry
Repeat
,
materialCanvas
);
var
meshCanvas
=
new
THREE
.
Mesh
(
geometry
,
materialCanvas
);
meshCanvas
.
rotation
.
x
=
Math
.
PI
/
2
;
meshCanvas
.
scale
.
x
=
meshCanvas
.
scale
.
y
=
meshCanvas
.
scale
.
z
=
1000
;
meshCanvas
.
scale
.
set
(
1000
,
1000
,
1000
)
;
meshCanvas
.
doubleSided
=
true
;
var
meshCanvas2
=
new
THREE
.
Mesh
(
geometry
Repeat
,
materialCanvas2
);
var
meshCanvas2
=
new
THREE
.
Mesh
(
geometry
,
materialCanvas2
);
meshCanvas2
.
rotation
.
x
=
Math
.
PI
/
2
;
meshCanvas2
.
scale
.
x
=
meshCanvas2
.
scale
.
y
=
meshCanvas2
.
scale
.
z
=
1000
;
meshCanvas2
.
scale
.
set
(
1000
,
1000
,
1000
)
;
meshCanvas2
.
doubleSided
=
true
;
...
...
@@ -160,7 +150,7 @@
scene
.
addObject
(
meshCanvas
);
scene2
.
addObject
(
meshCanvas2
);
var
geometry
=
new
THREE
.
PlaneGeometry
(
100
,
100
,
1
,
1
),
var
geometry
=
new
THREE
.
PlaneGeometry
(
100
,
100
),
mesh
=
new
THREE
.
Mesh
(
geometry
,
materialPainting
),
mesh2
=
new
THREE
.
Mesh
(
geometry
,
materialPainting2
);
...
...
@@ -174,15 +164,14 @@
zscene
.
addObject
(
zmesh
);
var
meshFrame
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
}
)
);
var
meshFrame
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
polygonOffset
:
true
,
polygonOffsetFactor
:
1
,
polygonOffsetUnits
:
5
}
)
);
meshFrame
.
position
.
z
=
-
0.5
;
meshFrame
.
scale
.
x
=
1.1
*
image
.
width
/
100
;
meshFrame
.
scale
.
y
=
1.1
*
image
.
height
/
100
;
zscene
.
addObject
(
meshFrame
);
var
meshShadow
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
opacity
:
0.9
}
)
);
var
meshShadow
=
new
THREE
.
Mesh
(
geometry
,
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
opacity
:
0.9
,
transparent
:
true
}
)
);
meshShadow
.
position
.
z
=
-
1.1
*
image
.
height
/
2
;
meshShadow
.
scale
.
x
=
1.1
*
image
.
width
/
100
;
...
...
@@ -202,8 +191,8 @@
var
texturePainting
=
THREE
.
ImageUtils
.
loadTexture
(
"
textures/758px-Canestra_di_frutta_(Caravaggio).jpg
"
,
THREE
.
UVMapping
,
callbackPainting
),
texturePainting2
=
new
THREE
.
Texture
(),
materialPainting
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffffff
,
map
:
texturePainting
}
),
materialPainting2
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffccaa
,
map
:
texturePainting2
}
);
materialPainting
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffffff
,
map
:
texturePainting
}
),
materialPainting2
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffccaa
,
map
:
texturePainting2
}
);
texturePainting2
.
minFilter
=
texturePainting2
.
magFilter
=
THREE
.
NearestFilter
;
texturePainting
.
minFilter
=
texturePainting
.
magFilter
=
THREE
.
LinearFilter
;
...
...
@@ -211,12 +200,12 @@
renderer
=
new
THREE
.
WebGLRenderer
();
renderer
.
setSize
(
SCREEN_WIDTH
,
SCREEN_HEIGHT
);
renderer
.
domElement
.
style
.
position
=
"
relative
"
;
container
.
appendChild
(
renderer
.
domElement
);
renderer
.
setClearColor
(
scene
.
fog
.
color
,
1
);
renderer
.
autoClear
=
false
;
renderer
.
domElement
.
style
.
position
=
"
relative
"
;
container
.
appendChild
(
renderer
.
domElement
);
stats
=
new
Stats
();
stats
.
domElement
.
style
.
position
=
'
absolute
'
;
stats
.
domElement
.
style
.
top
=
'
0px
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录