Search the Community
Showing results for tags 'gimbal lock'.
Found 1 result
I know I can't stop gimbal lock but I'd like to avoid the circumstances where it occurs in my application i.e. when a lookAt() call returns a vector close to the zenith. Basically I'd like to clamp the rotational pitch from 0 to 85 degrees, rather than allowing it to ever reach 90 degrees. I see the lookAt method has an optional parameter for pitchCor (pitch correction) but that doesn't seem to do what I want. What I'm thinking at the moment is I need to test the lookAt result to see of it's >= 85 degrees pitch and if so then clamp the pitch back to 85 degrees (without altering yaw) before applying the rotation to my mesh, but I'm a bit lost how to achieve that or if there's a better way. EDIT Here's a PG http://www.babylonjs-playground.com/#NM5LIX Basically as the lookAt() approaches the zenith I want to clamp the pitch input (even though it's not accurate this way) in order to eliminate the unnaturally fast spin. I hope this makes sense.