I’ve imported 3 GLTF files into a scene, but I am now trying to make them interactive and use the raycaster to trigger mouse over events. I’m not sure how to interact with the objects that I’ve imported (is it a mesh or what??)and any help would be appreciated.
I import the three objects using the following code:
And then attempt to trigger the mouse over event in the following piece of code:
The objects are THREE.Scene, THREE.Object3D, and THREE.Mesh instances, or (most likely) a nested tree of several things. The Object3D docs will be helpful, and you’ll likely also want to use the recursive option when calling intersectObjects. To see what’s actually in your model, try opening it in http://gltf-viewer.donmccurdy.com/ and looking at the JS console.
I believe this is exactly what you’re looking for. I made a detailed post about the concept. The goal is to make gltf object interactivity with the mouse as easy as a any other html element, simply with events.
Please have a look at this post and let me know if you have any question: