My goal is to achieve a similar effect like this response in another post, but with a major difference - I am using an x3d object instead of three.js. The objective is to track the scroll position and utilize it to rotate a 3D object diagonally (from its current position towards the bottom left).
The JavaScript code snippet is as follows:
window.addEventListener("wheel", onMouseWheel);
function onMouseWheel(event){
camera.position.y += event.deltaY * 5; // Since 'camera' is not defined, can it be replaced?
camera.position.x += event.deltaX * 10;
}
This is the x3d object being used:
(Due to numerous coordinates, had to paste it externally.)
I have managed to control the zoom of the object by scrolling over it and can also grab and rotate the object using the cursor. However, I need guidance on integrating the rotation with JavaScript when dealing with an x3d object rather than a three.js one. Any assistance would be highly appreciated.