[page:Object3D] →

[name]

Creates 6 cameras that render to a [page:WebGLRenderTargetCube].

Examples

[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic]
[example:webgl_materials_cubemap_dynamic2 materials / cubemap / dynamic2]
[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);

Constructor

[name]([page:Number near], [page:Number far], [page:Number cubeResolution])

near -- The near clipping distance.
far -- The far clipping distance
cubeResolution -- Sets the length of the cube's edges.
Constructs a CubeCamera that contains 6 [page:PerspectiveCamera PerspectiveCameras] that render to a [page:WebGLRenderTargetCube].

Properties

See the base [page:Object3D] class for common properties.

[property:WebGLRenderTargetCube renderTarget]

The cube texture that gets generated.

Methods

See the base [page:Object3D] class for common methods.

[method:null update]([page:WebGLRenderer renderer], [page:Scene scene])

renderer -- The current WebGL renderer
scene -- The current scene
Call this to update the [page:CubeCamera.renderTarget renderTarget].

[method:null clear]([page:WebGLRenderer renderer], [page:Boolean color], [page:Boolean depth], [page:Boolean stencil])

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]