Creates 6 cameras that render to a WebGLCubeRenderTarget.

Code Example

// Create cube render target const cubeRenderTarget = new v3d.WebGLCubeRenderTarget(128, { format: v3d.RGBFormat, generateMipmaps: true, minFilter: v3d.LinearMipmapLinearFilter }); // Create cube camera const cubeCamera = new v3d.CubeCamera(1, 100000, cubeRenderTarget); scene.add(cubeCamera); // Create car const chromeMaterial = new v3d.MeshLambertMaterial({ color: 0xffffff, envMap: cubeRenderTarget.texture }); const car = new Mesh(carGeometry, chromeMaterial); scene.add(car); // Update the render target cube car.visible = false; cubeCamera.position.copy(car.position); cubeCamera.update(renderer, scene); // Render the scene car.visible = true; renderer.render(scene, camera);


materials / cubemap / dynamic
shading / physical


CubeCamera(near : Number, far : Number, renderTarget : WebGLCubeRenderTarget)

near -- The near clipping distance.
far -- The far clipping distance.
renderTarget -- The destination cube render target.

Constructs a CubeCamera that contains 6 PerspectiveCameras that render to a WebGLCubeRenderTarget.


See the base Object3D class for common properties.

.renderTarget : WebGLCubeRenderTarget

The destination cube render target.


See the base Object3D class for common methods.

.update (renderer : WebGLRenderer, scene : Scene) : null

renderer -- The current WebGL renderer
scene -- The current scene

Call this to update the renderTarget.


For more info on how to obtain the source code of this module see this page.