---
title: "Introduction to Cameras in Twinfinity"
canonical: "https://help.twinfinity.com/space/HCFD/136249345/Introduction%20to%20Cameras%20in%20Twinfinity"
format: markdown
---
The camera is an essential tool in Twinfinity, shaping the user experience in digital twin applications.
It's not just about what the camera shows, but also how it moves and behaves, influencing how users
interact with and perceive the digital twin environment.

### Projection types

Twinfinity supports two camera projections:

1. **Perspective projection** (the default) mimics real-world vision: objects appear smaller as they
move away from the viewer, giving a realistic sense of depth.
2. **Orthographic projection** drops perspective entirely, so objects keep the same size regardless of
distance. This is what you want for plan-like, technical views.

Switching projection is a single call:

```ts
// 'perspective' (the default) keeps depth; 'orthographic' removes it.
api.camera.setProjection('orthographic');
```

See it in the playground: [Orthographic projection](https://playground.twinfinity.dev/?pgId=camera/orthographic-projection).
It's still a 3D scene — true 2D geometry comes from the [section examples](https://playground.twinfinity.dev/?pgId=sections/slab-section).

### Restricting camera movement

In many applications, constraining the camera makes navigation simpler and more predictable. A common
pattern is a top-down view that can only be panned and zoomed — especially effective with orthographic
projection. Frame the model from above and turn rotation off:

```ts
// Look straight down and fit the model to the view.
api.viewer.camera.zoomToExtent(api.ifc.getRegionBoundingInfo(true), 'top');

// With rotation off, dragging pans instead of orbiting.
api.viewer.camera.options.isRotationEnabled = false;
```

See it in the playground: [Top-down view](https://playground.twinfinity.dev/?pgId=camera/top-down-zoom-to-extent).

### Animating and saving views

You can also move the camera over time and bookmark viewpoints. `api.camera.lookAt(eye, target)` sets the
camera each frame (call `api.viewer.wakeRenderLoop()` while animating), and `getViewAsString()` /
`setViewFromString()` serialize a view so you can store it and jump back to it later — handy for
deep-links and saved viewpoints.

See it in the playground: [Camera animation](https://playground.twinfinity.dev/?pgId=camera/animation).

This should give you the basics for using cameras in Twinfinity to craft the viewer experience you want.