Three .js Object Rotation On Keypress
I'm desperate. been trying for so long to simply rotate an object on key press event. I can't just figure it, can anyone please show how to do it? this is my model https://www.drop
Solution 1:
You have different problems in your code.
1) You use the variable "letter" to rotate the object. This variable is only defined in the function onLoad. So you need to get a gloabal variable and asign the letter to it.
2) Try to rotate the hole scene first. "lesson6.scene.rotation.y += 1;" With that you could test how to use the button controls. In your code it will rotate only once per click. I think you need to use "setInterval" and "window.clearInterval" http://www.w3schools.com/js/js_timing.asp
Post a Comment for "Three .js Object Rotation On Keypress"