Capítulo 220 de 859

Chapter 220: CubeTexture

Core Idea

Creates a cube texture made up of six images.

Key Concepts

  • flipY : boolean: If set to true, the texture is flipped along the vertical axis when uploaded to the GPU.
  • images : Array.<Image>: Alias for CubeTexture#image.
  • isCubeTexture : boolean (readonly): This flag can be used for type testing.

Code Examples

const loader = new THREE.CubeTextureLoader();
loader.setPath( 'textures/cube/pisa/' );
const textureCube = loader.load( [
	'px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png'
] );
const material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } );
  • What it demonstrates: Typical usage of CubeTexture.

Reference Tables

Constructor

Signature
new CubeTexture( images : Array.<Image>, mapping : number, wrapS : number, wrapT : number, magFilter : number, minFilter : number, format : number, type : number, anisotropy : number, colorSpace : string )

Properties

PropertyDescription
.flipY : booleanIf set to true, the texture is flipped along the vertical axis when uploaded to the GPU.
.images : Array.<Image>Alias for CubeTexture#image.
.isCubeTexture : boolean (readonly)This flag can be used for type testing.

Key Takeaways

  1. CubeTexture extends: EventDispatcher → Texture
  2. Most relevant properties: flipY, images, isCubeTexture.

Connects To