You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.6 KiB
82 lines
2.6 KiB
2 years ago
|
<!DOCTYPE html>
|
||
|
<html lang="zh">
|
||
|
<head>
|
||
|
<meta charset="utf-8" />
|
||
|
<base href="../../../" />
|
||
|
<script src="page.js"></script>
|
||
|
<link type="text/css" rel="stylesheet" href="page.css" />
|
||
|
</head>
|
||
|
<body>
|
||
|
[page:Loader] →
|
||
|
|
||
|
<h1>[name]</h1>
|
||
|
|
||
|
<p class="desc">
|
||
|
加载[page:CubeTexture CubeTexture]的一个类。
|
||
|
内部使用[page:ImageLoader]来加载文件。
|
||
|
</p>
|
||
|
|
||
|
<h2>代码示例</h2>
|
||
|
|
||
|
<code>
|
||
|
const scene = new THREE.Scene();
|
||
|
scene.background = new THREE.CubeTextureLoader()
|
||
|
.setPath( 'textures/cubeMaps/' )
|
||
|
.load( [
|
||
|
'px.png',
|
||
|
'nx.png',
|
||
|
'py.png',
|
||
|
'ny.png',
|
||
|
'pz.png',
|
||
|
'nz.png'
|
||
|
] );
|
||
|
</code>
|
||
|
|
||
|
<h2>例子</h2>
|
||
|
|
||
|
<p>
|
||
|
[example:webgl_materials_cubemap materials / cubemap]<br />
|
||
|
[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic]<br />
|
||
|
[example:webgl_materials_cubemap_refraction materials / cubemap / refraction]
|
||
|
</p>
|
||
|
|
||
|
<h2>构造函数</h2>
|
||
|
|
||
|
<h3>[name]( [param:LoadingManager manager] )</h3>
|
||
|
<p>
|
||
|
[page:LoadingManager manager] — 加载器使用的[page:LoadingManager loadingManager]。默认为[page:LoadingManager THREE.DefaultLoadingManager].<br /><br />
|
||
|
|
||
|
创建一个新的[name].
|
||
|
</p>
|
||
|
|
||
|
<h2>属性</h2>
|
||
|
<p>共有属性请参见其基类[page:Loader]。</p>
|
||
|
|
||
|
<h2>方法</h2>
|
||
|
<p>共有方法请参见其基类[page:Loader]。</p>
|
||
|
|
||
|
<h3>[method:null load]( [param:String urls], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
|
||
|
<p>
|
||
|
[page:String urls] — 数组长度为6的图像数组,数组内容为URL,每一个URL用于CubeTexture的每一侧。
|
||
|
这些URL将被指定顺序: pos-x, neg-x, pos-y, neg-y, pos-z, neg-z.
|
||
|
数组内容也可以为 [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URIs].<br />
|
||
|
请注意,一般来说,在立方体贴图坐标系中,当查找positive-z轴时,positive-x表示右侧
|
||
|
- 换句话说,此坐标系使用左手坐标系。
|
||
|
由于three.js使用右手坐标系, 环境贴图将在three.js进行pos-x和neg-x进行交互.<br />
|
||
|
[page:Function onLoad] — 加载完成时将调用。回调参数是已被加载的[page:Texture texture].<br />
|
||
|
[page:Function onProgress] — 将在加载过程中进行调用。参数为XMLHttpRequest实例,
|
||
|
其中包含 [page:Integer total] 和 [page:Integer loaded] 字节。<br />
|
||
|
[page:Function onError] — 在加载错误时被调用。<br />
|
||
|
</p>
|
||
|
<p>
|
||
|
从URL中进行加载,并将被加载的[page:Texture texture]传递给onLoad。
|
||
|
</p>
|
||
|
|
||
|
<h2>源</h2>
|
||
|
|
||
|
<p>
|
||
|
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
||
|
</p>
|
||
|
</body>
|
||
|
</html>
|