flimshaw / Valiant360

An in-browser 360 degree panorama video player.
http://flimshaw.github.io/Valiant360/
MIT License
777 stars 151 forks source link

jumps to a low fov when scrolling #31

Closed michellecruz closed 8 years ago

michellecruz commented 8 years ago

this is a great plugin. simple & easy to use. I just have one issue - I have my initial fov set at 135 and it looks like there's a glitch when I try scrolling. It instantly jumps to a low fov, around 10-15.

ghost commented 8 years ago

Add this after Line 112

fovMin: 3,
fovMax: 160,

this after line 165

this._fovMin = this.options.fovMin
this._fovMax = this.options.fovMax

replace on line 410

var fovMin = 3;
var fovMax = 100;

with this

var fovMin = this._fovMin;
var fovMax = this._fovMax;

and finally replace on Line 419

this._camera.setLens(this._fov);
event.preventDefault();

with this

this._camera.fov = this._fov;
this._camera.updateProjectionMatrix();

THREE.js setLens uses focal length in mm not FOV

flimshaw commented 8 years ago

I believe @zlot's recent updates to v0.4.0 implements this fix