Object3D

CubeCamera

Creates 6 cameras that render to a WebGLCubeRenderTarget.

Code Example

// create cube render target const cubeRenderTarget = new v3d.WebGLCubeRenderTarget(128, { generateMipmaps: true, minFilter: v3d.LinearMipmapLinearFilter }); // create cube camera const cubeCamera = new v3d.CubeCamera(1, 100000, cubeRenderTarget); app.scene.add(cubeCamera); // assign car material const chromeMaterial = new v3d.MeshStandardMaterial({ color: 0xffffff, metalness: 1, roughness: 0.3, envMap: cubeRenderTarget.texture }); chromeMaterial.envMapAutoAssign = false; const car = app.scene.getObjectByName("Car"); car.material = chromeMaterial; // update the render target cube car.visible = false; cubeCamera.position.copy(car.position); cubeCamera.update(app.renderer, app.scene); // render the scene car.visible = true; app.renderer.render(app.scene, app.camera);

Constructor

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

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

Properties

See the base Object3D class for common properties.

.renderTarget : WebGLCubeRenderTarget

The destination cube render target.

Methods

See the base Object3D class for common methods.

.update(renderer : WebGLRenderer, scene : Scene)

Call this to update the renderTarget.

Source

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