translating from current position to the clicked threejs geometry

  • Hi everyone,

    I'm working on a Krpano project with Three.js integration. My goal is to translate to a clicked point (which is a Three.js sphere geometry). However, I am encountering issues with scaling and proportionality in the translation calculations.

    Let's say I have a series of sphere geometries inside the Krpano viewer, and if I click on, for example, sphere 4, I should transition to that particular coordinate. Since the coordinates of the sphere geometries are Vector3(), I tried taking the vector difference and translating based on the offset, but that doesn't seem to give the expected result.

    Thank you in advance for your help!


    klaus.krpano please look into this.

    Edited once, last by kishor (November 26, 2024 at 1:02 PM).

  • Thankyou klaus.krpano but we want the camera/view to follow a trajectory path which we have set through a three.js plugin. The path should dynamically move and reposition itself with respect to the clicked sphere(which is an hotspot set directly on the trajectory path). so that this whole interface would mimic a tour where the user can move inside the tour while following the set path and let's say - we move to 3rd scene by clicking on the 3rd hotspot and when we look back we should be able to see the path on which we have travelled/moved to the clicked position and now the problem we are encountering now is - regarding the misalignment of this path (it is not being aligned properly after clicking and moving through scenes)

    attaching an image for better understanding of the expected end result.

  • Hi klaus.krpano yes, attaching a link for the video demonstration of what we are trying to achieve - https://drive.google.com/file/d/1AwE9ap…ew?usp=drivesdk


    Regarding our approach - we are using a three.js plugin to create a trajectory path using tube geometry and we overlayed a group of spheres as the clickable Hotspots on top of the same trajectory line and the only issue is with the trajectory path not being updated accurately and it is being misaligned when moving inside the tour by clicking on these Hotspots.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!