CubeTextureLoader.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. <h1>[name]</h1>
  12. <div class="desc">
  13. Class for loading a [page:CubeTexture CubeTexture].
  14. This uses the [page:ImageLoader] internally for loading files.
  15. </div>
  16. <h2>Example</h2>
  17. <div>
  18. [example:webgl_materials_cubemap materials / cubemap]<br />
  19. [example:webgl_materials_cubemap_balls_reflection materials / cubemap / balls / reflection]<br />
  20. [example:webgl_materials_cubemap_balls_refraction materials / cubemap / balls / refraction]<br />
  21. [example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic]<br />
  22. [example:webgl_materials_cubemap_dynamic2 materials / cubemap / dynamic2]<br />
  23. [example:webgl_materials_cubemap_refraction materials / cubemap / refraction]
  24. </div>
  25. <code>
  26. var scene = new THREE.Scene();
  27. scene.background = new THREE.CubeTextureLoader()
  28. .setPath( 'textures/cubeMaps/' )
  29. .load( [
  30. '1.png',
  31. '2.png',
  32. '3.png',
  33. '4.png',
  34. '5.png',
  35. '6.png'
  36. ] );
  37. </code>
  38. <h2>Constructor</h2>
  39. <h3>[name]( [page:LoadingManager manager] )</h3>
  40. <div>
  41. [page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br /><br />
  42. Creates a new [name].
  43. </div>
  44. <h2>Properties</h2>
  45. <h3>[property:String crossOrigin]</h3>
  46. <div>
  47. If set, assigns the [link:https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes crossOrigin]
  48. attribute of the image to the value of *crossOrigin*,
  49. prior to starting the load. Default is *undefined*.
  50. </div>
  51. <h3>[property:LoadingManager manager]</h3>
  52. <div>
  53. The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager].
  54. </div>
  55. <h2>Methods</h2>
  56. <h3>[method:null load]( [page:String urls], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
  57. <div>
  58. [page:String urls] — array of 6 urls to images, one for each side of the CubeTexture.<br />
  59. [page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<br />
  60. [page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
  61. [page:Function onError] — Will be called when load errors.<br />
  62. </div>
  63. <div>
  64. Begin loading from url and pass the loaded [page:Texture texture] to onLoad.
  65. </div>
  66. <h3>[method:null setCrossOrigin]( [page:String value] )</h3>
  67. <div> Set the [page:.crossOrigin] attribute.</div>
  68. <h3>[method:FileLoader setPath]( [page:String path] )</h3>
  69. <div>
  70. Set the base path or URL from which to load files. This can be useful if
  71. you are loading many textures from the same directory.
  72. </div>
  73. <h2>Source</h2>
  74. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  75. </body>
  76. </html>