logo

G

  • Tutorials
  • API
  • Examples
  • Plugins
  • Productsantv logo arrow
  • 6.1.26
  • Canvas
    • Introduction
    • Options
    • Built-in objects
    • Coordinate system
    • Scenegraph & Lifecycle
    • Event
    • OffscreenCanvas & Server-side Rendering
    • CustomElementRegistry
    • Frequently Asked Questions
  • Renderer
    • Introduction
    • Canvas Renderer
    • Canvaskit Renderer
    • SVG Renderer
    • WebGL Renderer
    • WebGPU Renderer
    • Custom Renderer
  • Camera
    • Introduction
    • Camera Parameters
    • Camera action
    • Camera animation
  • Event
    • Introduction
    • Event Object
    • Gesture & Drag'n'Drop
    • Frequently Asked Questions
  • Animation
    • Web Animations API
    • Lottie
  • Basic Shapes
    • Basic Concepts
    • DisplayObject
    • Group
    • Text
    • Circle
    • Ellipse
    • Rect
    • Image
    • Line
    • Polygon
    • Polyline
    • Path
    • HTML
  • Style System
    • Introduction
    • CSS Typed OM
    • Inheritance
    • CSS Properties & Values API
    • CSS Layout API
    • Pattern
    • Gradient
  • 3D
    • 材质
    • 几何
    • Mesh
    • 光源
    • 雾
    • 交互
  • Built-in Objects
    • EventTarget
    • Node
    • Element
    • Document
    • MutationObserver
    • Utils
  • GPGPU
    • Introduction
    • Programming Model
    • Kernel API
    • Principles of classical GPGPU implementation
    • webgpu-graph
  • Declarative programming
    • 使用 Web Components
  • Devtools
    • G 开发者工具
    • 内置的渲染统计信息
    • 第三方开发调试工具

Camera action

Previous
Camera Parameters
Next
Camera animation

Resource

Ant Design
Galacea Effects
Umi-React Application Framework
Dumi-Component doc generator
ahooks-React Hooks Library

Community

Ant Financial Experience Tech
seeconfSEE Conf-Experience Tech Conference

Help

GitHub
StackOverflow

more productsMore Productions

Ant DesignAnt Design-Enterprise UI design language
yuqueYuque-Knowledge creation and Sharing tool
EggEgg-Enterprise-class Node development framework
kitchenKitchen-Sketch Tool set
GalaceanGalacean-Interactive solution
xtechLiven Experience technology
© Copyright 2025 Ant Group Co., Ltd..备案号:京ICP备15032932号-38

Loading...

The three axes of the camera in the camera coordinate system are uvn.

The camera movements we describe later are actually movement and rotation along these three axes.

The following picture is from Television Production Handbook p.97. The cameras used in the early years of television were moved by tracks.

Disregarding the crane and tongue movements, which rely on the rocker, the translations and rotations along the three uvn axes can be summarized as follows.

ActionCamera PositionFocalPointuvn
dollypan
pedestalpan
truckpan
cantCenter of Rotationrotate
panCenter of Rotationrotate
tiltCenter of Rotationrotate
arcCenter of Rotationrotate

Naturally, depending on the camera type, the same camera action is implemented differently. Let's take dolly action as an example, it's also an action to move the camera position forward and backward, for Orbiting / Exploring mode the point of view remains the same. In Tracking mode, the point of view is adjusted.

pan

Pans the camera along the u / v axis, i.e., horizontally and vertically.

The method signature is as follows.

pan(tx: number, ty: number)

Parameters:

  • tx Positive translation along u-axis
  • ty Positive translation along v-axis

In this example, the following action will cause the object originally at the point of view to be displayed in the upper left corner.

camera.pan(200, 200);

In g-plugin-control we respond to the mouse panning event by calling this method.

dolly

Move the camera along the n-axis. Fix the viewpoint and change the camera position to change the view distance. It will keep the view distance between minDistance and maxDistance.

The method signature is as follows.

dolly(value: number)

Parameters:

  • value 以 dollyingStep 为单位,正向远离视点,负向靠近

Example:

camera.dolly(10); // Away from the point of view
camera.dolly(-10); // Close to the point of view

The effect in the pivot projection is as follows. In g-plugin-control we respond to the mouse wheel event by calling this method.

rotate

Rotate by camera azimuth, counterclockwise is positive.

The method signature is as follows.

rotate(azimuth: number, elevation: number, roll: number)

2D scenes only need to specify rolls, e.g. for the camera to "tilt its head".

camera.rotate(0, 0, 30);