Hi, I am trying to create an application where I load a GLTF model on screen using AFrame and am using Orbit Controls to pan, rotate and zoom it. When I click on any part of model, it should get isolated( only that part should be visible all others should disappear) and the camera should now focus on that part and Orbit Controls target should also change.
One approach I tried was -
- For isolation : Traverse through nodes. if node.name != clicked part name then make that node’s material transparent and reduce its scale to 0.05 so that it doesn’t take clicks.
- For focus: Instead of changing camera position I scaled and trying to center the isolated part. (Centering mesh isn’t working though)
Here’s my JS Fiddle
My question is should I try to change the camera position so it zooms on the clicked part or continue with the above approach.
Also, for either of the approach I need a bit of help.