CubeTextureLoader.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. [page:Loader] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">
  14. Class for loading a [page:CubeTexture CubeTexture].
  15. This uses the [page:ImageLoader] internally for loading files.
  16. </p>
  17. <h2>Code Example</h2>
  18. <code>
  19. var scene = new THREE.Scene();
  20. scene.background = new THREE.CubeTextureLoader()
  21. .setPath( 'textures/cubeMaps/' )
  22. .load( [
  23. 'px.png',
  24. 'nx.png',
  25. 'py.png',
  26. 'ny.png',
  27. 'pz.png',
  28. 'nz.png'
  29. ] );
  30. </code>
  31. <h2>Examples</h2>
  32. <p>
  33. [example:webgl_materials_cubemap materials / cubemap]<br />
  34. [example:webgl_materials_cubemap_balls_reflection materials / cubemap / balls / reflection]<br />
  35. [example:webgl_materials_cubemap_balls_refraction materials / cubemap / balls / refraction]<br />
  36. [example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic]<br />
  37. [example:webgl_materials_cubemap_refraction materials / cubemap / refraction]
  38. </p>
  39. <h2>Constructor</h2>
  40. <h3>[name]( [param:LoadingManager manager] )</h3>
  41. <p>
  42. [page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br /><br />
  43. Creates a new [name].
  44. </p>
  45. <h2>Properties</h2>
  46. <p>See the base [page:Loader] class for common properties.</p>
  47. <h2>Methods</h2>
  48. <p>See the base [page:Loader] class for common methods.</p>
  49. <h3>[method:CubeTexture load]( [param:String urls], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
  50. <p>
  51. [page:String urls] — array of 6 urls to images, one for each side of the CubeTexture.
  52. The urls should be specified in the following order: pos-x, neg-x, pos-y, neg-y, pos-z, neg-z.
  53. They can also be [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URIs].<br />
  54. Note that, by convention, cube maps are specified in a coordinate system in which positive-x is to the right
  55. when looking up the positive-z axis -- in other words, using a left-handed coordinate system.
  56. Since three.js uses a right-handed coordinate system, environment maps used in three.js will have pos-x and neg-x swapped.<br />
  57. [page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<br />
  58. [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 />
  59. [page:Function onError] — Will be called when load errors.<br />
  60. </p>
  61. <p>
  62. Begin loading from url and pass the loaded [page:CubeTexture texture] to onLoad.
  63. </p>
  64. <h2>Source</h2>
  65. <p>
  66. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  67. </p>
  68. </body>
  69. </html>