[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br/><br/>
[page:String url] — the path or URL to the file. This can also be a
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br/>
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Animation animation].<br/>
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br/>
[page:Function onError] — Will be called if load errors.<br/><br/>
[page:String context] — The [page:String AudioContext] for the loader to use. Default is [page:String window.AudioContext].<br/>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br/><br/>
[page:String url] — the path or URL to the file. This can also be a
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br/>
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.<br/>
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br/>
[page:Function onError] — Will be called when load errors.<br/>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
[page:String url] — the path or URL to the file. This can also be a
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].d<br/>
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:BufferGeometry].<br/>
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br/>
[page:Function onError] — Will be called when load errors.<br/>
[page:String url] — the path or URL to the file. This can also be a
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br/>
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded texture.<br/>
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br/>
[page:Function onError] — Will be called when load errors.<br/>
@@ -40,63 +40,62 @@ scene.background = new THREE.CubeTextureLoader()
] );
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:LoadingManager manager] )</h3>
<p>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br/><br/>
[page:String urls] — array of 6 urls to images, one for each side of the CubeTexture.
The urls should be specified in the following order: pos-x, neg-x, pos-y, neg-y, pos-z, neg-z.
They can also be [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URIs].<br/>
Note that, by convention, cube maps are specified in a coordinate system in which positive-x is to the right
when looking up the positive-z axis -- in other words, using a left-handed coordinate system.
Since three.js uses a right-handed coordinate system, environment maps used in three.js will have pos-x and neg-x swapped.<br/>
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<br/>
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br/>
[page:Function onError] — Will be called when load errors.<br/>
[page:String url] — the path or URL to the file. This can also be a
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br/>
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded texture.<br/>
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br/>
[page:Function onError] — Will be called when load errors.<br/>
<p>The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See [page:.setRequestHeader]. Default is *undefined*.</p>
[page:String text] or empty string (default) - returns the data as [page:String string].<br/>
[page:String arraybuffer] - loads the data into a [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer ArrayBuffer] and returns that.<br/>
[page:String blob] - returns the data as a [link:https://developer.mozilla.org/en/docs/Web/API/Blob Blob].<br/>
[page:String document] - parses the file using the [link:https://developer.mozilla.org/en-US/docs/Web/API/DOMParser DOMParser].<br/>
[page:String json] - parses the file using [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse JSON.parse].<br/>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br/><br/>
[page:String url] — the path or URL to the file. This can also be a
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br/>
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<br/>
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br/>
[page:Function onError] — Will be called when load errors.<br/><br/>
var texture = new THREE.CanvasTexture( imageBitmap );
var material = new THREE.MeshBasicMaterial( { map: texture } );
},
// onProgress callback currently not supported
// 目前暂不支持onProgress的回调
undefined,
// onError callback
// onError回调
function ( err ) {
console.log( 'An error happened' );
}
...
...
@@ -48,58 +48,58 @@
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:LoadingManager manager] )</h3>
<p>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br/><br/>
<p>An optional object that sets options for the internally used [link:https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap createImageBitmap] factory method. Default is *undefined*.</p>
请参考[link:https://github.com/mrdoob/three.js/issues/10439#issuecomment-275785639 this thread].
</p>
<h2>Constructor</h2>
<h2>构造方法</h2>
<h3>[name]( [param:LoadingManager manager] )</h3>
<p>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br/><br/>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
[page:String url] — the path or URL to the file. This can also be a
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI]..<br/>
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.<br/>
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br/>
[page:Function onError] — Will be called when load errors.<br/>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br/><br/>
// Alternatively, to parse a previously loaded JSON structure
// 或者,解析先前加载的JSON结构
var object = loader.parse( a_json_object );
scene.add( object );
...
...
@@ -62,102 +62,100 @@
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:LoadingManager manager] )</h3>
<p>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br/><br/>
[page:String url] — the path or URL to the file. This can also be a
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br/>
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Object3D object].<br/>
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br/>
[page:Function onError] — Will be called when load errors.<br/>
请参考[link:https://github.com/mrdoob/three.js/issues/10439#issuecomment-293260145 this thread]。
Please note three.js r84 dropped support for TextureLoader progress events. For a TextureLoader that supports progress events, see [link:https://github.com/mrdoob/three.js/issues/10439#issuecomment-293260145 this thread].
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:LoadingManager manager] )</h3>
<p>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br/><br/>
[page:String url] — the path or URL to the file. This can also be a
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br/>
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<br/>
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br/>
[page:Function onError] — Will be called when load errors.<br/><br/>
Begin loading from the given URL and pass the fully loaded [page:Texture texture] to onLoad. The method also returns a new texture object which can directly be used for material creation.
If you do it this way, the texture may pop up in your scene once the respective loading process is finished.