jeromeetienne / threex.domevents

three.js extension which provide dom events inside your 3d scene.
http://jeromeetienne.github.io/threex.domevents/examples/demo.html
MIT License
246 stars 113 forks source link

Domevents can only recognize global variables? #33

Open Habacef opened 2 years ago

Habacef commented 2 years ago

I have a strange problem, I load a model using a gltf loader, and within the loader I save the object to a local variable.

However when implementing a mouseover and mouseout, It does not work as Domevents thinks that the object is still the empty variable..

I get it running when setting a "dummy object" in the variable, and later update it, but then domevents raycasts the "dummy" object and not the real one that was added to the scene...

How can I save an object into a variable that Domevents gets always the updated object to raycast?