[name]

A Helper class to ease the loading of images of different types.

Properties

[property:string crossOrigin]

The crossOrigin string to implement CORS for loading the image from a different domain that allows CORS.

Methods

[method:DataTexture generateDataTexture]([page:Number width], [page:Number height], [page:Number color])

width -- The width of the texture.
height -- The height of the texture.
color -- The hexadecimal value of the color.
Generates a texture of a single color. It is a DataTexture with format, RGBFormat.

[method:CompressedTexture parseDDS]([page:String buffer], [page:boolean loadMipmaps])

buffer -- A string containing the data of the dds.
loadMipmaps -- A boolean to indicate if you need to load the mipmaps. Default is True.
Parses a DDS Image from the string into a CompressedTexture.

[method:Texture loadTexture]([page:String url], [page:UVMapping mapping], [page:Function onLoad], [page:Function onError])

url -- the url of the texture
mapping -- Can be an instance of [page:UVMapping THREE.UVMapping], [page:CubeReflectionMapping THREE.CubeReflectionMapping] or [page:SphericalReflectionMapping THREE.SphericalReflectionMapping]. Describes how the image is applied to the object.
Use undefined instead of null as a default value. See mapping property of [page:Texture texture] for more details.
onLoad -- callback function
onError -- callback function
A helper function to generates a [page:Texture THREE.Texture] from an image URL. Provides a load and error callback.

[method:canvas getNormalMap]([page:Image image], [page:Float depth])

image -- A loaded image element
depth -- The depth of the normal map. Defaults to between -1 and 1.
Translates an image element into a normal map with the range (-1, -1, -1) to (1, 1, 1) multiplied by the depth. Returns a canvas element.

[method:CubeTexture loadTextureCube]([page:Array array], [page:Textures mapping], [page:function onLoad], [page:function onError])

array -- An array of 6 images
mapping -- Either [page:Textures THREE.CubeReflectionMapping] or [page:Textures THREE.CubeRefractionMapping]
onLoad -- callback
onError -- callback
Creates a [page:CubeTexture] from 6 images.

The images are loaded in the following order where p is positiive and n is negative: [ px, nx, py, ny, pz, nz ]. See [page:CubeTexture] for an example in code.

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]