CubeTexture.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <!DOCTYPE html>
  2. <html lang="en">
  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:Texture] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">Creates a cube texture made up of six images.</p>
  13. <h2>Code Example</h2>
  14. <code>
  15. const loader = new THREE.CubeTextureLoader();
  16. loader.setPath( 'textures/cube/pisa/' );
  17. const textureCube = loader.load( [
  18. 'px.png', 'nx.png',
  19. 'py.png', 'ny.png',
  20. 'pz.png', 'nz.png'
  21. ] );
  22. const material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } );
  23. </code>
  24. <h2>Constructor</h2>
  25. <h3>[name]( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy )</h3>
  26. <p>
  27. CubeTexture is almost equivalent in functionality and usage to [page:Texture]. The only differences are that the
  28. images are an array of 6 images as opposed to a single image, and the mapping options are
  29. [page:Textures THREE.CubeReflectionMapping] (default) or [page:Textures THREE.CubeRefractionMapping]
  30. </p>
  31. <h2>Properties</h2>
  32. <p>
  33. See the base [page:Texture Texture] class for common properties.
  34. </p>
  35. <h3>[property:Boolean flipY]</h3>
  36. <p>
  37. If set to `true`, the texture is flipped along the vertical axis when uploaded to the GPU. Default is `false`.
  38. </p>
  39. <h3>[property:Boolean isCubeTexture]</h3>
  40. <p>
  41. Read-only flag to check if a given object is of type [name].
  42. </p>
  43. <h2>Methods</h2>
  44. <p>
  45. See the base [page:Texture Texture] class for common methods.
  46. </p>
  47. <h2>Source</h2>
  48. <p>
  49. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  50. </p>
  51. </body>
  52. </html>