CubeTexture.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CubeTexture - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Texture.html">Texture</a> → </p>
  13. <h1 translate="no">CubeTexture</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Creates a cube texture made up of six images.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const loader = new THREE.CubeTextureLoader();
  19. loader.setPath( 'textures/cube/pisa/' );
  20. const textureCube = loader.load( [
  21. 'px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png'
  22. ] );
  23. const material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } );
  24. </code></pre></div>
  25. </header>
  26. <article>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="CubeTexture" translate="no">new <a href="#CubeTexture">CubeTexture</a><span class="signature">( images : <span class="param-type">Array.&lt;Image></span>, mapping : <span class="param-type">number</span>, wrapS : <span class="param-type">number</span>, wrapT : <span class="param-type">number</span>, magFilter : <span class="param-type">number</span>, minFilter : <span class="param-type">number</span>, format : <span class="param-type">number</span>, type : <span class="param-type">number</span>, anisotropy : <span class="param-type">number</span>, colorSpace : <span class="param-type">string</span> )</span> </h3>
  30. <div class="method">
  31. <div class="description">
  32. <p>Constructs a new cube texture.</p>
  33. </div>
  34. <table class="params">
  35. <tbody>
  36. <tr>
  37. <td class="name"><code>images</code></td>
  38. <td class="description last"><p>An array holding a image for each side of a cube.<br/>Default is <code>[]</code>.</p></td>
  39. </tr>
  40. <tr>
  41. <td class="name"><code>mapping</code></td>
  42. <td class="description last"><p>The texture mapping.<br/>Default is <code>CubeReflectionMapping</code>.</p></td>
  43. </tr>
  44. <tr>
  45. <td class="name"><code>wrapS</code></td>
  46. <td class="description last"><p>The wrapS value.<br/>Default is <code>ClampToEdgeWrapping</code>.</p></td>
  47. </tr>
  48. <tr>
  49. <td class="name"><code>wrapT</code></td>
  50. <td class="description last"><p>The wrapT value.<br/>Default is <code>ClampToEdgeWrapping</code>.</p></td>
  51. </tr>
  52. <tr>
  53. <td class="name"><code>magFilter</code></td>
  54. <td class="description last"><p>The mag filter value.<br/>Default is <code>LinearFilter</code>.</p></td>
  55. </tr>
  56. <tr>
  57. <td class="name"><code>minFilter</code></td>
  58. <td class="description last"><p>The min filter value.<br/>Default is <code>LinearMipmapLinearFilter</code>.</p></td>
  59. </tr>
  60. <tr>
  61. <td class="name"><code>format</code></td>
  62. <td class="description last"><p>The texture format.<br/>Default is <code>RGBAFormat</code>.</p></td>
  63. </tr>
  64. <tr>
  65. <td class="name"><code>type</code></td>
  66. <td class="description last"><p>The texture type.<br/>Default is <code>UnsignedByteType</code>.</p></td>
  67. </tr>
  68. <tr>
  69. <td class="name"><code>anisotropy</code></td>
  70. <td class="description last"><p>The anisotropy value.<br/>Default is <code>Texture.DEFAULT_ANISOTROPY</code>.</p></td>
  71. </tr>
  72. <tr>
  73. <td class="name"><code>colorSpace</code></td>
  74. <td class="description last"><p>The color space value.<br/>Default is <code>NoColorSpace</code>.</p></td>
  75. </tr>
  76. </tbody>
  77. </table>
  78. </div>
  79. </div>
  80. <h2 class="subsection-title">Properties</h2>
  81. <div class="member">
  82. <h3 class="name" id="flipY" translate="no">.<a href="#flipY">flipY</a><span class="type-signature"> : boolean</span> </h3>
  83. <div class="description">
  84. <p>If set to <code>true</code>, the texture is flipped along the vertical axis when
  85. uploaded to the GPU.</p>
  86. <p>Overwritten and set to <code>false</code> by default.<br/>Default is <code>false</code>.</p>
  87. </div>
  88. <dl class="details">
  89. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#flipY">Texture#flipY</a></dt>
  90. </dl>
  91. </div>
  92. <div class="member">
  93. <h3 class="name" id="images" translate="no">.<a href="#images">images</a><span class="type-signature"> : Array.&lt;Image></span> </h3>
  94. <div class="description">
  95. <p>Alias for <a href="CubeTexture.html#image">CubeTexture#image</a>.</p>
  96. </div>
  97. </div>
  98. <div class="member">
  99. <h3 class="name" id="isCubeTexture" translate="no">.<a href="#isCubeTexture">isCubeTexture</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  100. <div class="description">
  101. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  102. </div>
  103. </div>
  104. <h2 class="subsection-title">Source</h2>
  105. <p>
  106. <a href="https://github.com/mrdoob/three.js/blob/master/src/textures/CubeTexture.js" target="_blank" rel="noopener" translate="no">src/textures/CubeTexture.js</a>
  107. </p>
  108. </article>
  109. </section>
  110. <script src="../scripts/linenumber.js"></script>
  111. <script src="../scripts/page.js"></script>
  112. </body>
  113. </html>
粤ICP备19079148号