[page:Object3D] →

立方相机([name])

创建6个渲染到[page:WebGLCubeRenderTarget]的摄像机。

代码示例

// Create cube render target const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 128, { generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } ); // Create cube camera const cubeCamera = new THREE.CubeCamera( 1, 100000, cubeRenderTarget ); scene.add( cubeCamera ); // Create car const chromeMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: cubeRenderTarget.texture } ); const car = new THREE.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 );

例子

[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic ]

构造器

[name]( [param:Number near], [param:Number far], [param:WebGLCubeRenderTarget renderTarget] )

near -- 近剪切面的距离
far -- 远剪切面的距离
renderTarget -- The destination cube render target.

构造一个包含6个[page:PerspectiveCamera PerspectiveCameras](透视摄像机)的立方摄像机, 并将其拍摄的场景渲染到一个[page:WebGLCubeRenderTarget]上。

属性

共有属性请参见其基类[page:Object3D]。

[property:WebGLCubeRenderTarget renderTarget]

The destination cube render target.

方法

共有方法请参见其基类[page:Object3D]。

[method:undefined update]( [param:WebGLRenderer renderer], [param:Scene scene] )

renderer -- 当前的WebGL渲染器
scene -- 当前的场景

这个方法用来更新[page:CubeCamera.renderTarget renderTarget](渲染目标对象)。

源代码

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]