diff --git a/src/Scene.js b/src/Scene.js index 199d14693..e22d7888a 100644 --- a/src/Scene.js +++ b/src/Scene.js @@ -233,6 +233,20 @@ var Scene = Node.extend(function () { } }, + /** + * Set main camera of the scene. + * @param {claygl.Camera} camera + */ + setMainCamera: function (camera) { + var idx = this._cameraList.indexOf(camera); + if (idx >= 0) { + this._cameraList.splice(idx, 1); + } + this._cameraList.unshift(camera); + }, + /** + * Get main camera of the scene. + */ getMainCamera: function () { return this._cameraList[0]; }, diff --git a/src/loader/GLTF.js b/src/loader/GLTF.js index 09fac4cef..5e6f6a84a 100644 --- a/src/loader/GLTF.js +++ b/src/loader/GLTF.js @@ -999,7 +999,7 @@ function () { return new PerspectiveCamera({ name: nodeInfo.name, aspect: perspectiveInfo.aspectRatio, - fov: perspectiveInfo.yfov, + fov: perspectiveInfo.yfov / Math.PI * 180, far: perspectiveInfo.zfar, near: perspectiveInfo.znear });