提交 9eb00dc2 编写于 作者: L Leo Singer

Set OrbitControls polar angle limits to [0.01, pi-0.01]

OrbitControls suffers from gimbal lock: if you rotate all the way to the
north or south pole, it will feel 'stuck' in the east-west direction.
This patch fixes the issue by setting the default minimum and maximum
polar angles to 0.01 and pi-0.01 radians, which eliminates any
perceptible gimbal lock effect at ordinary browser frame rates.
上级 d3cb4e7c
......@@ -60,9 +60,10 @@ THREE.OrbitControls = function ( object, domElement ) {
this.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60
// How far you can orbit vertically, upper and lower limits.
// Range is 0 to Math.PI radians.
this.minPolarAngle = 0; // radians
this.maxPolarAngle = Math.PI; // radians
// Range is 0.01 to Math.PI-0.01 radians, which is sufficient to avoid
// noticable gimbal lock.
this.minPolarAngle = 0.01; // radians
this.maxPolarAngle = Math.PI - 0.01; // radians
// Set to true to disable use of the keys
this.noKeys = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册