How can I create an interactive button on a CSS3DObject within a cube made up of 6 sides? The button is located on the yellow side, but I'm facing issues with clicking on it. Whenever I attempt to click on the button, the event.target always points to the renderer div instead of the button itself. Interestingly, I am able to click on the button successfully when using the browser inspect mode. Additionally, inserting an <iframe>
into the CSS3DObject works fine.
Here's what I've tried so far:
- Setting the renderer div property to
pointer-events: none
and the CSS3DObject property topointer-events: auto
- Adjusting the
z-index
property for both the renderer div and CSS3DObject
My code snippet looks like this:
JAVASCRIPT
// JavaScript code goes here...
CSS
// CSS code goes here...
Do you have any suggestions on how to prevent clicking on the renderer div and enable interactions with the button as intended?