CubeTexture Class
CubeTextures represent 360 view using six images, these images correspond to the faces of a cube.
CubeTextures can be used to simulate reflections and transparency refraction in materials.
Is also possible to create dynamic cubetextures using the CubeCamera object.
Item Index
Methods
renderEquirectFace
-
read
-
face
-
rotation
-
size
Render a cube face from equirectangular projection.
Parameters:
-
read
ImageDataEquirectangular image.
-
face
NumberFace to render.
-
rotation
NumberImage rotation
-
size
NumberFace size.
Returns:
Face data.
resampleBilinear
-
read
-
write
-
x
-
y
-
index
Resample an image pixel from ImageData to ImageData, using bilinear interpolation.
Parameters:
-
read
ImageDataWhere to read data from.
-
write
ImageDataWhere to write data.
-
x
NumberOrigin pixel x.
-
y
NumberOrigin pixel y.
-
index
NumberTarget index.
setImages
-
images
-
mode
Set new images for this cube texture.
Parameters:
-
images
ArrayCube texture images.
-
mode
NumberMode to be used.
setSize
-
size
Set resolution of each face of the cubemap.
The size has to be a power of 2.
Parameters:
-
size
NumberCube face resolution.
toJSON
-
meta
Serialize cube texture to JSON.
All images of the cube texture are stored individually.
Parameters:
-
meta
Object
Returns:
json
updateImages
()
Updates the CubeTexture images, should be called after changing the images attached to the texture
Properties
mode
Number
Cube texture mode, the mode specifies how the cube texture is created.
Source format may vary from a mode to another.
size
Number
Size of each one of the texture that compose the CubeTexture.
Default: 512