Use CameraMovementPlugin when a user action should guide the visitor to a panorama and look toward a feature. For narration and a timed script, use Vreo instead.
Sequence a move and a rotation
This function uses the ready Five instance and camera controller from the quickstart. Supply an existing panorama index from the current Work.
import { Five } from '@realsee/five'
import type { CameraMovementPlugin } from '@realsee/dnalogel'
type CameraController = ReturnType<typeof CameraMovementPlugin>
export async function moveAndLook(five: Five, camera: CameraController, panoIndex: number) {
const moved = await camera.move({ mode: Five.Mode.Panorama, panoIndex }, 1200, { preload: true })
if (!moved) return false
return camera.rotate({ panoIndex, longitude: Math.PI / 2, latitude: 0, fov: five.state.fov }, 1000)
}Durations are milliseconds. Longitude and latitude are radians. The example preserves the current field of view explicitly because the published rotation implementation interpolates that value along with the angles.
Await the result before starting the next camera command. The published plugin may resolve false when an animation is interrupted and may reject when a panorama move is cancelled. Handle both outcomes in your calling button or flow and restore the controls in finally.
Avoid competing controllers
Disable repeated activation while your sequence runs. A user gesture, another camera command, or a scene replacement can interrupt a transition. Do not assume that invoking the method means the camera arrived. For a product with a cancel control, define whether cancellation should keep the current view or restore the starting view.
Verify
Run the sequence from two different starting viewpoints. Check the final panorama and orientation, then interrupt it with a gesture and confirm the UI becomes usable again. Re-run after scene replacement using an index from the new Work.
