Parameters Three.JS CombinedCamera调用预定义参数
我正在为Three.JS场景使用组合摄影机库,并希望在切换时为每个模式设置(重置)预定义参数Parameters Three.JS CombinedCamera调用预定义参数,parameters,three.js,camera,call,reset,Parameters,Three.js,Camera,Call,Reset,我正在为Three.JS场景使用组合摄影机库,并希望在切换时为每个模式设置(重置)预定义参数 function changeCameraMode(mode_){ var s = "first person"; if(mode_) { s = "birds view"; } //false: first view, true: bird's eye console.log("mode: " + s); if(mode_) { camera.toOrt
function changeCameraMode(mode_){
var s = "first person";
if(mode_) { s = "birds view"; }
//false: first view, true: bird's eye
console.log("mode: " + s);
if(mode_) { camera.toOrthographic();
camera.cameraO.position = cameraSettings.orpho.position;
camera.cameraO.rotation.onChangeCallback._x = cameraSettings.orpho.rotation.x;
camera.cameraO.rotation.onChangeCallback._y = cameraSettings.orpho.rotation.y;
camera.cameraO.rotation.onChangeCallback._z = cameraSettings.orpho.rotation.z;
camera.cameraO.top = cameraSettings.orpho.top;
camera.cameraO.left = cameraSettings.orpho.left;
camera.cameraO.bottom = cameraSettings.orpho.bottom;
camera.cameraO.right = cameraSettings.orpho.right;
camera.quaternion._x = 0.17446644315139806;
camera.quaternion._y = 0.40250876457862955;
camera.quaternion._z = 0.07844478023909554;
camera.quaternion._w = 0.8952064404955571;
camera.rotation.x = cameraSettings.orpho.rotation.x;
camera.rotation.y = cameraSettings.orpho.rotation.y;
camera.rotation.z = cameraSettings.orpho.rotation.z;
camera.position = cameraSettings.orpho.position;
camera.updateProjectionMatrix();
}
else { camera.toPerspective(); }
}
我已经使用了几乎所有的变量(见上文),但实际上什么都没有发生。
有什么想法吗?我在FirstPersonControl.js中使用过它,实际上我要做的是:
controls.lat = value0_;
controls.lon = value1_;
controls.phi = value2_;
controls.theta = value3_;
camera.lookAt(controls.target);