I have a 3D model rendered using three.js, and I've managed to make it so that when you click on a part of it, that area turns red. However, what I want to do is not only highlight the clicked area but also display information about it in a modal window. The challenge I'm facing is figuring out how to link the clicked area with the relevant data. For example, if the model represents a car and the user clicks on a tire, I want to show details about that specific tire.
How should I go about implementing this feature? Should I add custom data to the model during its creation process? While I don't directly build the model myself, I have the ability to modify it if necessary, although I'm unsure if this is the correct approach.
Upon inspecting the object for the clicked MESH, I noticed an empty UserData object, which made me consider the possibility of adding custom data to the model before exporting it.
Any assistance or advice on this matter would be highly appreciated. Thank you,