Creates 6 cameras that render to a [page:WebGLRenderTargetCube].
[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic]
[example:webgl_shading_physical shading / physical]
// Create cube camera
var cubeCamera = new v3d.CubeCamera(1, 100000, 128);
scene.add(cubeCamera);
// Create car
var chromeMaterial = new v3d.MeshLambertMaterial({ color: 0xffffff, envMap: cubeCamera.renderTarget });
var car = new Mesh(carGeometry, chromeMaterial);
scene.add(car);
// Update the render target cube
car.setVisible(false);
cubeCamera.position.copy(car.position);
cubeCamera.update(renderer, scene);
// Render the scene
car.setVisible(true);
renderer.render(scene, camera);
near -- The near clipping distance.
far -- The far clipping distance
cubeResolution -- Sets the length of the cube's edges.
options - (optional) object that holds texture parameters passed to the auto-generated WebGLRenderTargetCube.
If not specified, the options default to:
{ format: RGBFormat, magFilter: LinearFilter, minFilter: LinearFilter }
Constructs a CubeCamera that contains 6 [page:PerspectiveCamera PerspectiveCameras] that render to a [page:WebGLRenderTargetCube].
See the base [page:Object3D] class for common properties.
The cube texture that gets generated.
See the base [page:Object3D] class for common methods.
renderer -- The current WebGL renderer
scene -- The current scene
Call this to update the [page:CubeCamera.renderTarget renderTarget].
Call this to clear the [page:CubeCamera.renderTarget renderTarget] color, depth, and/or stencil buffers. The color buffer is set to the renderer's current clear color. Arguments default to *true*.
[sourceHint]