CubeTextureLoader.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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">Class for loading a [page:CubeTexture CubeTexture].</div>
  13. <h2>Example</h2>
  14. <code>
  15. var scene = new THREE.Scene();
  16. scene.background = new THREE.CubeTextureLoader()
  17. .setPath( 'textures/cubeMaps/' )
  18. .load( [
  19. '1.png',
  20. '2.png',
  21. '3.png',
  22. '4.png',
  23. '5.png',
  24. '6.png'
  25. ] );
  26. </code>
  27. <div>
  28. [example:webgl_materials_cubemap materials / cubemap]<br />
  29. [example:webgl_materials_cubemap_balls_reflection materials / cubemap / balls / reflection]<br />
  30. [example:webgl_materials_cubemap_balls_refraction materials / cubemap / balls / refraction]<br />
  31. [example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic]<br />
  32. [example:webgl_materials_cubemap_dynamic2 materials / cubemap / dynamic2]<br />
  33. [example:webgl_materials_cubemap_refraction materials / cubemap / refraction]
  34. </div>
  35. <h2>Constructor</h2>
  36. <h3>[name]( [page:LoadingManager manager] )</h3>
  37. <div>
  38. [page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
  39. </div>
  40. <div>
  41. Creates a new [name].
  42. </div>
  43. <h2>Properties</h2>
  44. <h3>[property:String crossOrigin]</h3>
  45. <div>
  46. default — *null*.<br />
  47. If set, assigns the *crossOrigin* attribute of the image to the value of *crossOrigin*, prior to starting the load.
  48. </div>
  49. <h2>Methods</h2>
  50. <h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
  51. <div>
  52. [page:String url] — required<br />
  53. [page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<br />
  54. [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 />
  55. [page:Function onError] — Will be called when load errors.<br />
  56. </div>
  57. <div>
  58. Begin loading from url and pass the loaded [page:Texture texture] to onLoad.
  59. </div>
  60. <h3>[method:null setCrossOrigin]( [page:String value] )</h3>
  61. <div>
  62. Set the crossOrigin attribute.
  63. </div>
  64. <h3>[method:null setPath]( [page:String value] )</h3>
  65. <div>
  66. Set the path from which to load textures.
  67. </div>
  68. <h2>Source</h2>
  69. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  70. </body>
  71. </html>