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:
-
readImageDataEquirectangular image.
-
faceNumberFace to render.
-
rotationNumberImage rotation
-
sizeNumberFace size.
Returns:
Face data.
resampleBilinear
-
read -
write -
x -
y -
index
Resample an image pixel from ImageData to ImageData, using bilinear interpolation.
Parameters:
-
readImageDataWhere to read data from.
-
writeImageDataWhere to write data.
-
xNumberOrigin pixel x.
-
yNumberOrigin pixel y.
-
indexNumberTarget index.
setImages
-
images -
mode
Set new images for this cube texture.
Parameters:
-
imagesArrayCube texture images.
-
modeNumberMode to be used.
setSize
-
size
Set resolution of each face of the cubemap.
The size has to be a power of 2.
Parameters:
-
sizeNumberCube face resolution.
toJSON
-
meta
Serialize cube texture to JSON.
All images of the cube texture are stored individually.
Parameters:
-
metaObject
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
