CubeTextureLoader.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <!DOCTYPE html>
  2. <html lang="it">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:Loader] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. Classe per il caricamento di una [page:CubeTexture CubeTexture].
  14. Utilizza internamente l'[page:ImageLoader] per caricare i file.
  15. </p>
  16. <p>
  17. The loaded [page:CubeTexture] is in sRGB color space. Meaning the [page:Texture.colorSpace colorSpace]
  18. property is set to `THREE.SRGBColorSpace` by default.
  19. </p>
  20. <h2>Codice di Esempio</h2>
  21. <code>
  22. const scene = new THREE.Scene();
  23. scene.background = new THREE.CubeTextureLoader()
  24. .setPath( 'textures/cubeMaps/' )
  25. .load( [
  26. 'px.png',
  27. 'nx.png',
  28. 'py.png',
  29. 'ny.png',
  30. 'pz.png',
  31. 'nz.png'
  32. ] );
  33. </code>
  34. <h2>Esempi</h2>
  35. <p>
  36. [example:webgl_materials_cubemap materials / cubemap]<br />
  37. [example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic]<br />
  38. [example:webgl_materials_cubemap_refraction materials / cubemap / refraction]
  39. </p>
  40. <h2>Costruttore</h2>
  41. <h3>[name]( [param:LoadingManager manager] )</h3>
  42. <p>
  43. [page:LoadingManager manager] — Il [page:LoadingManager loadingManager] del loader da utilizzare. Il valore predefinito è [page:LoadingManager THREE.DefaultLoadingManager].<br /><br />
  44. Crea un nuovo [name].
  45. </p>
  46. <h2>Proprietà</h2>
  47. <p>Vedi la classe base [page:Loader] per le proprietà comuni.</p>
  48. <h2>Metodi</h2>
  49. <p>Vedi la classe base [page:Loader] per i metodi comuni.</p>
  50. <h3>[method:CubeTexture load]( [param:String urls], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
  51. <p>
  52. [page:String urls] — array di 6 url di immagini, una per ogni lato della CubeTexture.
  53. Le url devono essere specificate nel seguente ordine: pos-x, neg-x, pos-y, neg-y, pos-z, neg-z.
  54. Possono anche essere [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URIs].<br />
  55. Si noti che, per convenzione, le mappe cubiche sono specificate in un sistema di coordinate in cui la x positiva è
  56. a destra quando si guarda l'asse z positivo -- in altre parole, utilizza un sistema di coordinate sinistrorso.
  57. Poiché Three.js utilizza un sistema di coordinate destrorso, le mappe d'ambiente utilizzate in three.js avranno pos-x e neg-x invertiti.<br />
  58. [page:Function onLoad] (opzionale) — Verrà chiamato quando il caricamento sarà completato. L'argomento sarà la [page:CubeTexture texture] caricata.<br />
  59. [page:Function onProgress] (opzionale) — Questa funzione di callback non è al momento supportata.<br />
  60. [page:Function onError] (opzionale) — Verrà chiamato in caso di errori di caricamento.<br />
  61. </p>
  62. <p>
  63. Inizia il caricamento dall'url e passa la [page:CubeTexture texture] caricata a onLoad.
  64. Il metodo inoltre restituisce un nuovo oggetto texture che può essere direttamente utilizzato per la creazione di materiale.
  65. </p>
  66. <h2>Source</h2>
  67. <p>
  68. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  69. </p>
  70. </body>
  71. </html>