Skip to content

Commit

Permalink
fix(OrbitControls): no pan, less speed, no zoom (#52)
Browse files Browse the repository at this point in the history
* configure orbit controls to have an intuitive movement for rotation as we are rotation the sphere from the inside of it, and disabled panning and zooming as this could lead to exiting the sphere
* only render on the inside of the projection sphere, no use for the texture to be visible from the outside
  • Loading branch information
developpeur2000 authored and brandonocasey committed Feb 20, 2018
1 parent dd7adc1 commit 44b6d41
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class VR extends Plugin {
this.videoTexture.magFilter = THREE.LinearFilter;
this.videoTexture.format = THREE.RGBFormat;

this.movieMaterial = new THREE.MeshBasicMaterial({ map: this.videoTexture, overdraw: true, side: THREE.DoubleSide });
this.movieMaterial = new THREE.MeshBasicMaterial({ map: this.videoTexture, overdraw: true, side: THREE.FrontSide });

this.changeProjection_(this.currentProjection_);

Expand Down Expand Up @@ -483,6 +483,9 @@ class VR extends Plugin {
this.log('no vr displays found going to use OrbitControls');
this.controls3d = new OrbitControls(this.camera, this.renderedCanvas);
this.controls3d.target.set(0, 0, -1);
this.controls3d.enableZoom = false;
this.controls3d.enablePan = false;
this.controls3d.rotateSpeed = -0.5;
}
this.animationFrameId_ = this.requestAnimationFrame(this.animate_);
});
Expand Down

0 comments on commit 44b6d41

Please sign in to comment.