You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I'm trying to implement interactive 3D model based on this example
Idea is that on click action model will be zoomed in on certain point based on position of mouse.
I've partly achieved that by adding few line of code in the example as a part of "recenter" method.
Question is: is it possible to make some parts "labeld", like if we have human body 3D model when user clicks on head to zoom on that part (i've done this via code above) to give us some feedback that that certain part is clicked so I can use it later on as a trigger for other methods? Some sort like if head is clicked than do smth else? Is this some sort of invisible hotspot or some math? :)
UPDATE: Found solution, after getting positionAndNormalFromPoint from a mouse click and storing that in hit variable. I comapred hit.position.y (or x,z) depends on what you need, with value of models part for x,y or z.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey, I'm trying to implement interactive 3D model based on this example
Idea is that on click action model will be zoomed in on certain point based on position of mouse.
I've partly achieved that by adding few line of code in the example as a part of "recenter" method.
Question is: is it possible to make some parts "labeld", like if we have human body 3D model when user clicks on head to zoom on that part (i've done this via code above) to give us some feedback that that certain part is clicked so I can use it later on as a trigger for other methods? Some sort like if head is clicked than do smth else? Is this some sort of invisible hotspot or some math? :)
UPDATE: Found solution, after getting positionAndNormalFromPoint from a mouse click and storing that in hit variable. I comapred hit.position.y (or x,z) depends on what you need, with value of models part for x,y or z.
Beta Was this translation helpful? Give feedback.
All reactions