How to display html content when clicking on object in three.js

You can implement a basic 3D interaction with raycasting. This approach is demonstrated in the following official example: three.js webgl - interactive cubes

Instead of mouseMove you have to add an event listener to the click event. In this way, you will find out whether an 3D object was clicked or not. You also get the exact intersection point that can be used to display a HTML based annotation. However, this point is usually in world space and needs to be converted to screen coordinates. The following post might help in this context:

2 Likes