Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
3a33a47f
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,体验更适合开发者的 AI 搜索 >>
提交
3a33a47f
编写于
5月 25, 2019
作者:
T
Takahiro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add BasisTextureLoader example
上级
a858d4d4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
110 addition
and
0 deletion
+110
-0
examples/files.js
examples/files.js
+1
-0
examples/textures/compressed/kodim20.basis
examples/textures/compressed/kodim20.basis
+0
-0
examples/webgl_loader_texture_basis.html
examples/webgl_loader_texture_basis.html
+109
-0
未找到文件。
examples/files.js
浏览文件 @
3a33a47f
...
...
@@ -126,6 +126,7 @@ var files = {
"
webgl_loader_sea3d_sound
"
,
"
webgl_loader_stl
"
,
"
webgl_loader_svg
"
,
"
webgl_loader_texture_basis
"
,
"
webgl_loader_texture_dds
"
,
"
webgl_loader_texture_exr
"
,
"
webgl_loader_texture_hdr
"
,
...
...
examples/textures/compressed/kodim20.basis
0 → 100644
浏览文件 @
3a33a47f
文件已添加
examples/webgl_loader_texture_basis.html
0 → 100644
浏览文件 @
3a33a47f
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
three.js webgl - basis texture loader
</title>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<style>
body
{
margin
:
0px
;
background-color
:
#050505
;
color
:
#fff
;
overflow
:
hidden
;
}
a
{
color
:
#e00
}
#info
{
position
:
absolute
;
top
:
0px
;
width
:
100%
;
color
:
#ffffff
;
padding
:
5px
;
font-family
:
Monospace
;
font-size
:
13px
;
text-align
:
center
;
z-index
:
1000
;
}
</style>
</head>
<body>
<div
id=
"info"
>
<a
href=
"http://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
- webgl - basis texture loader
<br
/>
<a
href=
"https://github.com/binomialLLC/basis_universal"
target=
"_blank"
>
Basis Universal GPU Texture Codec
</a>
</div>
<script
src=
"../build/three.js"
></script>
<script
src=
"js/loaders/BasisTextureLoader.js"
></script>
<script>
var
camera
,
scene
,
renderer
;
var
mesh
;
var
clock
=
new
THREE
.
Clock
();
init
();
animate
();
function
init
()
{
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
true
}
);
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
document
.
body
.
appendChild
(
renderer
.
domElement
);
camera
=
new
THREE
.
PerspectiveCamera
(
50
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
2000
);
camera
.
position
.
z
=
500
;
scene
=
new
THREE
.
Scene
();
var
geometry
=
new
THREE
.
BoxBufferGeometry
(
200
,
200
,
200
);
var
material
=
new
THREE
.
MeshBasicMaterial
();
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
scene
.
add
(
mesh
);
var
loader
=
new
THREE
.
BasisTextureLoader
();
loader
.
setTranscoderPath
(
'
js/libs/basis/
'
);
loader
.
detectSupport
(
renderer
);
loader
.
load
(
'
textures/compressed/kodim20.basis
'
,
function
(
texture
)
{
material
.
map
=
texture
;
material
.
needsUpdate
=
true
;
}
);
window
.
addEventListener
(
'
resize
'
,
onWindowResize
,
false
);
}
function
onWindowResize
()
{
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
updateProjectionMatrix
();
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
}
function
animate
()
{
requestAnimationFrame
(
animate
);
var
delta
=
clock
.
getDelta
()
*
0.5
;
mesh
.
rotation
.
x
+=
delta
;
mesh
.
rotation
.
y
+=
delta
;
renderer
.
render
(
scene
,
camera
);
}
</script>
</body>
</html>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录