How to use the CubeCamera function from three

Find comprehensive JavaScript three.CubeCamera code examples handpicked from public code repositorys.

51
52
53
54
55
56
57
58
59
60
#### Unmanaged CubemapToEquirectangular ####
If you want to use a different CubeMap camera, or do something custom with the render, you will have to set the Unmanaged mode.

You will have to create and manage your THREE.CubeCamera:
```js
var cubeCamera = new THREE.CubeCamera( .1, 1000, 4096 );
```
and manage all your scene update and rendering. When you want to export a panorama, call:
```js
// this is where the developer updates the scene and creates a cubemap of the scene
fork icon37
star icon178
watch icon10

+ 11 other calls in file

6
7
8
9
10
11
12
13
14
15
      var height = 4096;
      var sceneEl = renderer.domElement;
      var camScale = 0.15;


      var cubeCamera = new THREE.CubeCamera(0.01, 100000, height);
//cubeCamera.rotation.order = "YXZ";

      if (window.renderOrigin) {
              cubeCamera.position.copy(window.renderOrigin);
fork icon2
star icon13
watch icon5

+ 9 other calls in file

23
24
25
26
27
28
29
30
31
32
document.body.appendChild(this.renderer.domElement);

this.scene = scene;
this.worldGrid = worldGrid;

this.cubeCamera = new THREE.CubeCamera(1, 1000, 128);
this.cubeCamera.renderTarget.texture.generateMipmaps = true;
this.cubeCamera.renderTarget.texture.minFilter = THREE.LinearMipMapLinearFilter;
// this.cubeCamera.renderTarget.texture.magFilter = THREE.LinearFilter;
this.cubeCamera.renderTarget.texture.mapping = THREE.CubeReflectionMapping;
fork icon0
star icon3
watch icon3

+ 3 other calls in file

0
1
2
3
4
5
6
7
8
9
const THREE = require('three');

export default class Hill {
  constructor() {
    var cubeRenderTarget = new THREE.WebGLCubeRenderTarget(128);
    this.cubeCamera = new THREE.CubeCamera(1, 15000, cubeRenderTarget);
    this.instances = 6;
    this.uniforms = {
      time: {
        type: 'f',
fork icon260
star icon0
watch icon0

27
28
29
30
31
32
33
34
35
    format: THREE.RGBFormat,
    generateMipmaps: true,
    minFilter: THREE.LinearMipmapLinearFilter
})

cube_camera = new THREE.CubeCamera(0.1, 1, cube_render_target)

scene = new THREE.Scene()
scene.background = cube_render_target
fork icon0
star icon0
watch icon0

+ 2 other calls in file

125
126
127
128
129
130
131
132
133
134
135
136
137
}


CubemapToEquirectangular.prototype.getCubeCamera = function( size ) {


	var cubeMapSize = Math.min( this.cubeMapSize, size );
	this.cubeCamera = new THREE.CubeCamera( .1, 1000, cubeMapSize );


	var options = { format: THREE.RGBAFormat, magFilter: THREE.LinearFilter, minFilter: THREE.LinearFilter };
	this.cubeCamera.renderTarget = new THREE.WebGLRenderTargetCube( cubeMapSize, cubeMapSize, options );

fork icon0
star icon0
watch icon0

+ 6 other calls in file

34
35
36
37
38
39
40
41
42
43
directionalLight.position.y = 5
scene.add(directionalLight)

const lightHelper = new THREE.DirectionalLightHelper(directionalLight)
// scene.add(lightHelper)
const cubeCamera = new THREE.CubeCamera(0.01, 1000, 2 ** 9)
cubeCamera.renderTarget.texture.minFilter = THREE.LinearMipMapLinearFilter
cubeCamera.renderTarget.texture.mapping = THREE.CubeReflectionMapping // same as UVMapping

const sphereGeo = new THREE.SphereGeometry(1, 64, 64)
fork icon0
star icon0
watch icon4

+ 5 other calls in file

203
204
205
206
207
208
209
210
211
212
        scene.add(fresnelLabel);
        scene.add(fresnelSphere);
}

const createCubeCamera = () => {
        cubeCamera = new THREE.CubeCamera( 0.1, 2000, 256 );
        scene.add(cubeCamera);
}

/**
fork icon0
star icon0
watch icon1

+ 3 other calls in file

34
35
36
37
38
39
40
41
42
directionalLight.position.y = 5
scene.add(directionalLight)

const lightHelper = new THREE.DirectionalLightHelper(directionalLight)
// scene.add(lightHelper)
const cubeCamera = new THREE.CubeCamera(1, 5, 2 ** 10)
cubeCamera.renderTarget.texture.minFilter = THREE.LinearMipMapLinearFilter
cubeCamera.renderTarget.texture.mapping = THREE.CubeRefractionMapping

fork icon0
star icon0
watch icon4

+ 5 other calls in file

71
72
73
74
75
76
77
78
79
80
    window.innerWidth / window.innerHeight,
    vrDisplay.depthNear,
    vrDisplay.depthFar
)

refractSphereCamera = new THREE.CubeCamera( 0.1, 5000, 512 )
    // refractSphereCamera.renderTarget.mapping = new THREE.CubeRefractionMapping()
scene.add( refractSphereCamera )
    
var shader = THREE.FresnelShader
fork icon0
star icon0
watch icon1

40
41
42
43
44
45
46
47
48
49
directionalLight.position.y = 5
scene.add(directionalLight)

const lightHelper = new THREE.DirectionalLightHelper(directionalLight)
// scene.add(lightHelper)
const cubeCamera = new THREE.CubeCamera(.5, 5, 2 ** 10)
//cubeCamera.renderTarget.texture.minFilter = THREE.LinearMipMapLinearFilter
// cubeCamera.renderTarget.texture.flipY = false

const shader = THREE.FresnelShader
fork icon0
star icon0
watch icon4

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)