mizuwu Posted September 20, 2018 Share Posted September 20, 2018 I want to have less clicks of the arrow keys to pan 360 using ArcRotateCamera. So, for example, if it currently takes me 10 clicks of the left arrow key to do a 360, how can I change it such that it takes me 20 clicks? Thanks~ Quote Link to comment Share on other sites More sharing options...
Guest Posted September 20, 2018 Share Posted September 20, 2018 This will be possible with next commit using camera.inputs.attached.keyboard.angularSpeed *= 2 Quote Link to comment Share on other sites More sharing options...
mizuwu Posted September 20, 2018 Author Share Posted September 20, 2018 24 minutes ago, Deltakosh said: This will be possible with next commit using camera.inputs.attached.keyboard.angularSpeed *= 2 I actually tried solving the above problem by using a map and mapping the different keyboard keys to a function that updates the camera.alpha or camera.beta. if(map["ArrowRight"]){ camera.alpha -= Math.PI; // This achieves a solution that I was aiming for map["ArrowRight"] = undefined; }; But the way the camera moves is very stiff as it moves directly to that position without the smooth transitions that the default settings propose. How can I make the transitions smoother? Quote Link to comment Share on other sites More sharing options...
Guest Posted September 21, 2018 Share Posted September 21, 2018 if you update camera.alpha or beta directly there will be no inertia you should just use the angularSpeed I mentioned previously or update camera.inertialAlphaOffset Quote Link to comment Share on other sites More sharing options...
mizuwu Posted September 21, 2018 Author Share Posted September 21, 2018 2 hours ago, Deltakosh said: if you update camera.alpha or beta directly there will be no inertia you should just use the angularSpeed I mentioned previously or update camera.inertialAlphaOffset I like the angularSpeed solution, but is there also a way for the inertia to stop once it reaches the next specific point that I want it to rotate to? Quote Link to comment Share on other sites More sharing options...
Guest Posted September 21, 2018 Share Posted September 21, 2018 Well yes but you will have to check manually what is the current value of alpha and then set inertialAlphaoffset to 0 Quote Link to comment Share on other sites More sharing options...
mizuwu Posted September 21, 2018 Author Share Posted September 21, 2018 5 hours ago, Deltakosh said: Well yes but you will have to check manually what is the current value of alpha and then set inertialAlphaoffset to 0 Thank you so much for your help! One last question, how can I differentiate events for when a key is pressed vs when a key is held. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 24, 2018 Share Posted September 24, 2018 You will need to manually trigger it by checking keydown and keyup 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.