---
title: "view.set: Set View — Scene kit command — Kition"
description: "Sets the viewport's target, distance, turn, tilt and projection at once; looking through a camera, `cameraZoom` and `cameraOffset` alone zoom and move its frame and keep the camera view."
canonical: "https://developer.kition.ai/docs/kits/scene/commands/view.set"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/scene/commands/view.set](https://developer.kition.ai/docs/kits/scene/commands/view.set)

# view.set

**Set View.** Sets the viewport's target, distance, turn, tilt and projection at once; looking through a camera, `cameraZoom` and `cameraOffset` alone zoom and move its frame and keep the camera view.

- Kit: Scene 0.1.0 (.kscene); reference: [Scene kit commands](https://developer.kition.ai/docs/kits/scene.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `cameraOffset` | `number[]` | no | Looking through a camera: its frame's centre, in half viewports right and up of the centre [x, y] |
| `cameraZoom` | `number` | no | Looking through a camera: how large its frame shows, 0.1 to 16 (1 fits the viewport) |
| `distance` | `number` | no | Metres from the target |
| `perspective` | `boolean` | no | Perspective or orthographic |
| `target` | `number[]` | no | The point the view turns around [x, y, z] |
| `tilt` | `number` | no | Degrees: 0 looks down, 90 level |
| `turn` | `number` | no | Degrees about the up axis |

## Call through scene_run

```text
scene_run {
  "path": "<file>.kscene",
  "steps": [{ "command": "view.set" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `cameraOffset`, `cameraZoom`, `distance`, `perspective`, `target`, `tilt`, `turn`. scene_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `changed` | `boolean` | no |  |

```json
{
  "additionalProperties": true,
  "properties": {
    "changed": {
      "type": "boolean"
    }
  },
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "cameraOffset": {
      "description": "Looking through a camera: its frame's centre, in half viewports right and up of the centre [x, y]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "cameraZoom": {
      "description": "Looking through a camera: how large its frame shows, 0.1 to 16 (1 fits the viewport)",
      "type": "number"
    },
    "distance": {
      "description": "Metres from the target",
      "type": "number"
    },
    "perspective": {
      "description": "Perspective or orthographic",
      "type": "boolean"
    },
    "target": {
      "description": "The point the view turns around [x, y, z]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "tilt": {
      "description": "Degrees: 0 looks down, 90 level",
      "type": "number"
    },
    "turn": {
      "description": "Degrees about the up axis",
      "type": "number"
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/scene-darwin-arm64@0.1.0 and the kit itself (scene_commands through @kition/cli@0.1.1, built from KitionAI/kition-scene@4d06faf).
