Camera animations for a View —
fly-to a target, jump-to a target, or animate the camera along
a multi-frame path with eased segments.
The cameraFlight module animates a
Camera between viewpoints rather
than snapping it. Two entry points:
CameraFlightAnimation — fly to or jump to a single
target ({eye, look, up} triple, an AABB, or a
ViewObject). Used for
"focus on this object" and "frame this region" interactions.
CameraPathAnimation — animate the camera along a
pre-defined CameraPath of timed frames. Used for
scripted tours and recorded camera fly-throughs.
Shape
%%{init:{"theme":"dark"}}%%
classDiagram
direction TB
class CameraFlightAnimation {
+view : View
+duration / fitFOV / fit
+flyTo(params)
+jumpTo(params)
+stop()
+destroy()
}
class CameraPath {
+frames : { eye, look, up, t }[]
+addFrame(frame)
+loadFromJSON(json)
+saveToJSON()
}
class CameraPathAnimation {
+view : View
+path : CameraPath
+play() / pause() / stop()
+seek(t)
}
class FlyToParams {
+eye? / look? / up?
+aabb? : AABB3
+viewObject? : ViewObject
+projection?
+duration?
}
class View {
<<viewer>>
}
class Camera {
<<viewer>>
}
class ViewObject {
<<viewer>>
}
CameraFlightAnimation o-- View : drives Camera
CameraFlightAnimation ..> FlyToParams : reads
FlyToParams o-- ViewObject : optional target
CameraPathAnimation o-- View
CameraPathAnimation o-- CameraPath : plays
View *-- Camera
%%{init:{"theme":"default"}}%%
classDiagram
direction TB
class CameraFlightAnimation {
+view : View
+duration / fitFOV / fit
+flyTo(params)
+jumpTo(params)
+stop()
+destroy()
}
class CameraPath {
+frames : { eye, look, up, t }[]
+addFrame(frame)
+loadFromJSON(json)
+saveToJSON()
}
class CameraPathAnimation {
+view : View
+path : CameraPath
+play() / pause() / stop()
+seek(t)
}
class FlyToParams {
+eye? / look? / up?
+aabb? : AABB3
+viewObject? : ViewObject
+projection?
+duration?
}
class View {
<<viewer>>
}
class Camera {
<<viewer>>
}
class ViewObject {
<<viewer>>
}
CameraFlightAnimation o-- View : drives Camera
CameraFlightAnimation ..> FlyToParams : reads
FlyToParams o-- ViewObject : optional target
CameraPathAnimation o-- View
CameraPathAnimation o-- CameraPath : plays
View *-- Camera
classDiagram
direction TB
class CameraFlightAnimation {
+view : View
+duration / fitFOV / fit
+flyTo(params)
+jumpTo(params)
+stop()
+destroy()
}
class CameraPath {
+frames : { eye, look, up, t }[]
+addFrame(frame)
+loadFromJSON(json)
+saveToJSON()
}
class CameraPathAnimation {
+view : View
+path : CameraPath
+play() / pause() / stop()
+seek(t)
}
class FlyToParams {
+eye? / look? / up?
+aabb? : AABB3
+viewObject? : ViewObject
+projection?
+duration?
}
class View {
<<viewer>>
}
class Camera {
<<viewer>>
}
class ViewObject {
<<viewer>>
}
CameraFlightAnimation o-- View : drives Camera
CameraFlightAnimation ..> FlyToParams : reads
FlyToParams o-- ViewObject : optional target
CameraPathAnimation o-- View
CameraPathAnimation o-- CameraPath : plays
View *-- Camera
Features
Fly to a target — point the camera at a
ViewObject or AABB without
the caller computing camera positions; the helper fits the
target to the View's FOV.
Jump to a target — same target shapes, instant transition.
Right for keyboard shortcuts and reset-view actions.
Eased transitions — flights use a smooth in-out easing so
they read naturally; per-call duration overrides the default.
Projection switch in flight — pass projection: "ortho" / "perspective" to switch projection during the
transition; the View's projection mode flips at the end.
xeokit Camera Flight
Camera animations for a View — fly-to a target, jump-to a target, or animate the camera along a multi-frame path with eased segments.
The
cameraFlightmodule animates a Camera between viewpoints rather than snapping it. Two entry points:{eye, look, up}triple, an AABB, or a ViewObject). Used for "focus on this object" and "frame this region" interactions.Shape
Features
durationoverrides the default.projection: "ortho"/"perspective"to switch projection during the transition; the View's projection mode flips at the end.{eye, look, up, t}build scripted fly-throughs; CameraPathAnimation plays / pauses / scrubs them.saveToJSON()and load vialoadFromJSON(), so tours travel with a project.Installation
Quick Start
1) Import the entry points
2) Fly to a ViewObject
3) Jump to an explicit camera pose
4) Switch projection during the fly
5) Play a recorded path
6) Save and restore a path