I need your help.
I’m trying to recreate something like this website → https://www.magische-spiegelungen.de/ (press on discover the experience)
What I need to do, as the reference shows, is make the camera follow a path on scroll and still make the camera rotate around the point in which it stops, if the user drags.
Since the animation could be very complex, I wanted to make a “ghost cube” in the model and animating its position and rotation, then export the whole model and work on the animationGroups already made in the scene.
I experimented the different cameras but it seems like I can’t make it work right with none of them.
In my scene the FreeCamera, when I set as lockedTarget the cube mesh, it just looks at it, without following, while the effects it makes when dragging is right, cause it rotates around the point as if it were a first person pov.
The follow camera, when I set its lockedTarget as the cube mesh, and I put:
camera.radius = 0; camera.heightOffset = 0; camera.rotationOffset = 0;
it follows the mesh correctly, preserving the animation (rotation + position) I made on the external model, but when I drag it just changes the height offset and gets far away from the target, without rotating around point.
Also, the arcFollowCamera seems not the right one to use because it also doesn’t pivots around a point but has other rotation logic.
From this experiment it looks like the FreeCamera might be the right one as first person perspective, while the FollowCamera is the right one as following the mesh behaviour.
I tried to make a playground, but I don’t think it’s really effective because it’s too simple, there are no reference in the space and the animation is not imported but set as key frames. So it differs from my situation.
Babylon.js Playground (drag a little to see the scene moving)
I noticed a difference between this playground and my project, here the FreeCamera, when I set its position as the target position, it keeps following, while on my project it doesn’t follow the mesh only by setting that property.
Any help or suggestions about how to proceed to get this result, is really appreciated.
Thank you very much