Your system asks for reduced motion, so VFX-JS draws nothing. Demos on this site show plain HTML.

Type

OrbitCameraParams

effects/src/_orbit-camera.ts:30 ↗
import type { OrbitCameraParams } from "@vfx-js/effects";

The camera params of the 3D shape effects (GlassEffect, SwirlParticleEffect). Angles are in degrees.

Properties

cameraOrigin

cameraOrigin: "element" | "viewport"

Where the camera stands:

  • "element" (default): in front of the element's centre, so the shape looks the same wherever the element is on the page.
  • "viewport": in front of the centre of the viewport, at the same distance. The z = 0 plane still lands on the element's rect, but the perspective converges on the viewport's centre: an element away from the centre is seen from the side, shows its side walls (those facing the centre), and changes as the page scrolls. Its front draws further out from the centre than the element, so a small pad can clip it.

The rotations (yaw, pitch, the orbitAnimation, drags, the hover tilt) turn the shape about its own centre in both cases.

drag

drag: boolean

Orbit the camera by dragging the pointer. A drag starts on the element's box and can then leave it. While on, it listens for pointer events on window, and a drag that orbits keeps the browser from dragging the element (an image, a link) or selecting its text; UI on top of the element that should not orbit can stop pointerdown propagation.

fov

fov: number

Field of view in degrees, measured across the element's long side. The camera moves so the z = 0 plane keeps the element's size, so this only changes the strength of the perspective (like a dolly zoom).

orbitAnimation

orbitAnimation: number

Amplitude of the orbit animation, a slow back-and-forth swing of the camera, in degrees of yaw (the pitch swings 0.3 times as far). 0 keeps the camera still (pointer drags still orbit it when drag is on).

orbitSpeed

orbitSpeed: number

Speed of the orbitAnimation, as a multiple of the base speed: at 1, a yaw swing takes about 48 seconds. 0 holds the animation where it is. A change while it runs carries on from there.

pitch

pitch: number

Camera pitch in degrees. 0 looks straight at the front cap; positive turns the front cap down, showing the top.

pointerStrength

pointerStrength: number

Strength of the pointer interaction, 0 to 100 (default 1). With the effect's pointer at "tilt", the shape turns to face the pointer by up to 20° × pointerStrength (capped at 90°), reached when the pointer is half a viewport away from the element's centre, and eases back to the rest pose once the pointer leaves the page; 0 turns it off. The tilt adds to yaw / pitch, the orbitAnimation and drags. Other pointer modes say what it does for them.

yaw

yaw: number

Camera yaw in degrees. 0 looks straight at the front cap; positive turns the front cap to the right.

zoom

zoom: number

Camera zoom. 1 = the z = 0 plane matches the element size.