CubeTexture.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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">
  38. <strong>images</strong>
  39. </td>
  40. <td class="description last">
  41. <p>An array holding a image for each side of a cube.</p>
  42. <p>Default is <code>[]</code>.</p>
  43. </td>
  44. </tr>
  45. <tr>
  46. <td class="name">
  47. <strong>mapping</strong>
  48. </td>
  49. <td class="description last">
  50. <p>The texture mapping.</p>
  51. <p>Default is <code>CubeReflectionMapping</code>.</p>
  52. </td>
  53. </tr>
  54. <tr>
  55. <td class="name">
  56. <strong>wrapS</strong>
  57. </td>
  58. <td class="description last">
  59. <p>The wrapS value.</p>
  60. <p>Default is <code>ClampToEdgeWrapping</code>.</p>
  61. </td>
  62. </tr>
  63. <tr>
  64. <td class="name">
  65. <strong>wrapT</strong>
  66. </td>
  67. <td class="description last">
  68. <p>The wrapT value.</p>
  69. <p>Default is <code>ClampToEdgeWrapping</code>.</p>
  70. </td>
  71. </tr>
  72. <tr>
  73. <td class="name">
  74. <strong>magFilter</strong>
  75. </td>
  76. <td class="description last">
  77. <p>The mag filter value.</p>
  78. <p>Default is <code>LinearFilter</code>.</p>
  79. </td>
  80. </tr>
  81. <tr>
  82. <td class="name">
  83. <strong>minFilter</strong>
  84. </td>
  85. <td class="description last">
  86. <p>The min filter value.</p>
  87. <p>Default is <code>LinearMipmapLinearFilter</code>.</p>
  88. </td>
  89. </tr>
  90. <tr>
  91. <td class="name">
  92. <strong>format</strong>
  93. </td>
  94. <td class="description last">
  95. <p>The texture format.</p>
  96. <p>Default is <code>RGBAFormat</code>.</p>
  97. </td>
  98. </tr>
  99. <tr>
  100. <td class="name">
  101. <strong>type</strong>
  102. </td>
  103. <td class="description last">
  104. <p>The texture type.</p>
  105. <p>Default is <code>UnsignedByteType</code>.</p>
  106. </td>
  107. </tr>
  108. <tr>
  109. <td class="name">
  110. <strong>anisotropy</strong>
  111. </td>
  112. <td class="description last">
  113. <p>The anisotropy value.</p>
  114. <p>Default is <code>Texture.DEFAULT_ANISOTROPY</code>.</p>
  115. </td>
  116. </tr>
  117. <tr>
  118. <td class="name">
  119. <strong>colorSpace</strong>
  120. </td>
  121. <td class="description last">
  122. <p>The color space value.</p>
  123. <p>Default is <code>NoColorSpace</code>.</p>
  124. </td>
  125. </tr>
  126. </tbody>
  127. </table>
  128. </div>
  129. </div>
  130. <h2 class="subsection-title">Properties</h2>
  131. <div class="member">
  132. <h3 class="name" id="flipY" translate="no">.<a href="#flipY">flipY</a><span class="type-signature"> : boolean</span> </h3>
  133. <div class="description">
  134. <p>If set to <code>true</code>, the texture is flipped along the vertical axis when
  135. uploaded to the GPU.</p>
  136. <p>Overwritten and set to <code>false</code> by default.</p>
  137. <p>Default is <code>false</code>.</p>
  138. </div>
  139. <dl class="details">
  140. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#flipY">Texture#flipY</a></dt>
  141. </dl>
  142. </div>
  143. <div class="member">
  144. <h3 class="name" id="images" translate="no">.<a href="#images">images</a><span class="type-signature"> : Array.&lt;Image></span> </h3>
  145. <div class="description">
  146. <p>Alias for <a href="CubeTexture.html#image">CubeTexture#image</a>.</p>
  147. </div>
  148. </div>
  149. <div class="member">
  150. <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>
  151. <div class="description">
  152. <p>This flag can be used for type testing.</p>
  153. <p>Default is <code>true</code>.</p>
  154. </div>
  155. </div>
  156. <h2 class="subsection-title">Source</h2>
  157. <p>
  158. <a href="https://github.com/mrdoob/three.js/blob/master/src/textures/CubeTexture.js" translate="no" target="_blank" rel="noopener">src/textures/CubeTexture.js</a>
  159. </p>
  160. </article>
  161. </section>
  162. <script src="../scripts/linenumber.js"></script>
  163. <script src="../scripts/page.js"></script>
  164. </body>
  165. </html>
粤ICP备19079148号