Place hotspots on all materials or access the userData of a model #3926
Unanswered
subhankar-trisetra
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to place hotspots on all the materials of the model, so that I can in turn change the color of the material.
In my current approach I am listening to the click event of ModelViewer, and then calling
positionAndNormalFromPoint(x, y)
to get the values and then place hotspot, which in turn changes the color of the material.Can anybody help me with ideas to acheive my problem?
I thought of an idea i.e. to traverse through all the children of the model, and then the ones using a material, would have their worldPosition. I was thinking to use that worldPosition to place the hotspot on the object.
But sadly, modelViewer doesn't expose the Three3D DOM.
UPDATE:
I am finally able to access the ThreeJS Scene, which gives me flexibility to work with model viewer.
Beta Was this translation helpful? Give feedback.
All reactions