Searching for assistance to rotate a 3D object along the y-axis with a keyboard input (B). Anyone available to help?
I've been struggling with this issue for days now, every attempt at coding leads to errors.
Please, any help would be greatly appreciated.
This is the 3D object that requires rotation
Here is the code snippet:
var lesson6 = {
scene: null,
camera: null,
renderer: null,
container: null,
controls: null,
clock: null,
stats: null,
init: function() { // Initialization
// Rest of the initialization code here...
},
loadModel: function() {
// Loader and model loading code...
}});
}
};
function animate() {
requestAnimationFrame(animate);
render();
}
function render() {
if (lesson6.renderer) {
lesson6.renderer.render(lesson6.scene, lesson6.camera);
}
}
function initializeLesson() {
lesson6.init();
animate();
}
if (window.addEventListener)
window.addEventListener('load', initializeLesson, false);
else if (window.attachEvent)
window.attachEvent('onload', initializeLesson);
else window.onload = initializeLesson;