Producing Interactive Hotspot on Click and Generate accurate camera-orbit to focus on hotspot #4788
skoorbnadroj
started this conversation in
General
Replies: 1 comment 1 reply
-
Are you saying you want to move the camera so the hotspot normal is pointing straight at it? Have you tried something like |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently I have a viewer setup with interactive hotspot generation mapped to right click using the positionAndNormalFromPoint method, and using a database to ensure hotspot datasets are saved and persist everytime a model loads. My goal is to programmatically derive the camera orbit on hotspot generation so that when the user clicks a hotspot with left click, the camera interpolates between the focused hotspot via its data-orbit attribute. Unfortunately, I have not had much success and spent hours trying to generate the correct theta, phi values based on cartesian to spherical coordinate conversion. I had thought there would be a solution by utilizing the normal vector of the hotspot but am not well versed in trigonometry to work out the maths...
Since the intent is for the hotspots to be interactively generated, I do not want to have to utilize a manual process to pre-generate the camera orbits via the editor which seems to have been the recommendation for other folks. Any help or support would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions