dahlbyk Posted February 15, 2016 Share Posted February 15, 2016 Is it by design that an ArcRotateCamera essentially ignores alpha when beta is zero? http://babylonjs-playground.com/#1P6UWU I see that lowerBetaLimit defaults to 0.01 but it's not clear from the documentation or code why setting beta to zero always renders as if alpha = −π/2. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 16, 2016 Share Posted February 16, 2016 Hello this is because the camera tries to maintain upVector to (0, 1, 0) which is impossible with beta = 0 so it changes to a more compatible value Quote Link to comment Share on other sites More sharing options...
dahlbyk Posted February 16, 2016 Author Share Posted February 16, 2016 Is treating beta = 0 as a special case unreasonable? Or, is there a hook that I'm overlooking on camera movements that would let me update lowerBetaLimit when the camera is moved away from top-down? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 16, 2016 Share Posted February 16, 2016 I'm not sure to understand what do you want to achieve Can you elaborate a bit more? Quote Link to comment Share on other sites More sharing options...
dahlbyk Posted February 16, 2016 Author Share Posted February 16, 2016 I'm building a visualization with two camera-manipulation buttons: "Top" animates the camera around and up to alpha = −π/2 and beta = 0. "Spin" animates the camera down to beta = π/4 and then animates alpha to spin around the y axis. The user is also able to manipulate the camera with their mouse. Everything works wonderfully (seriously, kudos on this project), except using the mouse to move the camera up to beta = 0 causes an abrupt rotation to effectively alpha = −π/2. I'm trying to prevent that unexpected change in camera orientation. I can disable the beta = 0 behavior by setting lowerBetaLimit to 0.01, but doing so prevents Top from moving the camera to precisely beta = 0. My work-around is to just use beta = lowerBetaLimit = 0.01, but I thought I'd report the beta = 0 behavior since it did not work as expected (i.e. that alpha would still be respected for orienting the camera around the y axis). Does that help? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 16, 2016 Share Posted February 16, 2016 Ok this is perfect. It is linked to a bug with the lookAtMatrix It should be fixed now Quote Link to comment Share on other sites More sharing options...
dahlbyk Posted February 17, 2016 Author Share Posted February 17, 2016 Fix confirmed: https://github.com/BabylonJS/Babylon.js/commit/d0e62ba510da3877b20a7d0f503c8bba1dc57590 Thanks! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.