How to use the VREffect function from three

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

136
137
138
139
140
141
142
143
144
145
};

Client.prototype.addVRHandlers = function () {
  var self = this;

  this.vreffect = new THREE.VREffect(this.renderer);
  this.vreffect.setSize(window.innerWidth, window.innerHeight);

  function exitFullscreen () {
    if (document.webkitFullscreenElement === null || document.mozFullScreenElement === null) {
fork icon2
star icon7
watch icon4

+ 7 other calls in file

40
41
42
43
44
45
46
47
48

// Store the position of the VR HMD in a dummy camera to allow for panning and junk
fakeCamera = new three.Object3D();
vrControls = new three.VRControls(fakeCamera);
// Apply VR stereo rendering to renderer.
effect = new three.VREffect(renderer);
effect.setSize(window.innerWidth, window.innerHeight);
// Create a VR manager helper to enter and exit VR mode.
manager = new webvrmanager.WebVRManager(renderer, effect, {hideButton: false});
fork icon1
star icon3
watch icon5

+ 9 other calls in file

64
65
66
67
68
69
70
71
72
73
  end: end
}



// var effect = new THREE.VREffect( threeEnv.renderer );


// var controls = new THREE.DeviceOrientationControls(threeEnv.camera);
//var WebVRManager = require('./webvr-manager');
fork icon0
star icon4
watch icon2

21
22
23
24
25
26
27
28
29
30
31
require('three/examples/js/loaders/OBJLoader');  // THREE.OBJLoader
require('three/examples/js/loaders/MTLLoader');  // THREE.MTLLoader
require('three/examples/js/BlendCharacter');  // THREE.BlendCharacter
require('three/examples/js/loaders/ColladaLoader');  // THREE.ColladaLoader
require('../../vendor/VRControls');  // THREE.VRControls
require('../../vendor/VREffect');  // THREE.VREffect


THREE.ColladaLoader.prototype.crossOrigin = 'anonymous';
THREE.MTLLoader.prototype.crossOrigin = 'anonymous';
THREE.OBJLoader.prototype.crossOrigin = 'anonymous';
fork icon0
star icon0
watch icon0

+ 7 other calls in file

20
21
22
23
24
25
26
27
28
// TODO: Eventually include these only if they are needed by a component.
require('../../node_modules/three/examples/js/loaders/OBJLoader');  // THREE.OBJLoader
require('../../node_modules/three/examples/js/loaders/MTLLoader');  // THREE.MTLLoader
require('../../node_modules/three/examples/js/loaders/ColladaLoader');  // THREE.ColladaLoader
require('../../node_modules/three/examples/js/controls/VRControls');  // THREE.VRControls
require('../../node_modules/three/examples/js/effects/VREffect');  // THREE.VREffect


module.exports = THREE;
fork icon0
star icon0
watch icon0

+ 3 other calls in file

40
41
42
43
44
45
46
47
48
49

// Round down fractional DPR values for better performance.
renderer.setPixelRatio(Math.max(1, Math.floor(window.devicePixelRatio)));

var controls = new THREE.VRControls(camera);
var effect = new THREE.VREffect(renderer);
effect.setSize(window.innerWidth, window.innerHeight);

this.minFocalLength = 3;
this.maxFocalLength = 36;
fork icon0
star icon0
watch icon0

Other functions in three

Sorted by popularity

function icon

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