---
title: getViewpoint
slug: viewer-3d/methods/getViewpoint
docTags: 
createdAt: 2024-03-01T14:17:48.683Z
---

Returns the **Viewpoint**.

:::hint{type="info"}
The **Viewpoint** simulates the position of a camera looking at the scene.
:::

## Example

::codepen{url="https://codepen.io/Catenda/embed/MWMvmZm"}

## Usage

```javascript
const viewpoint = viewer3d.getViewpoint();
```

## Return Value

The **Viewpoint**.

| **Type** |
| -------- |
| Object   |

**Orthogonal Viewpoint**

| **Name**           | **Type**                                | **Description**                                     |
| ------------------ | --------------------------------------- | --------------------------------------------------- |
| `aspectRatio`      | Number                                  | Aspect ratio of the scene                           |
| `direction`        | [Vector3](docId\:kEwRHKTC8Iq2HlT48sRFQ) | Direction of the camera                             |
| `location`         | [Vector3](docId\:kEwRHKTC8Iq2HlT48sRFQ) | Location of the camera                              |
| `type`             | String                                  | Value is `orthogonal`                               |
| `up`               | [Vector3](docId\:kEwRHKTC8Iq2HlT48sRFQ) | Normalized vector describing the camera orientation |
| `viewToWorldScale` | Number                                  | The scale factor between the camera and the scene   |

**Perspective Viewpoint**

| **Name**      | **Type**                                | **Description**                                     |
| ------------- | --------------------------------------- | --------------------------------------------------- |
| `aspectRatio` | Number                                  | Aspect ratio of the scene                           |
| `direction`   | [Vector3](docId\:kEwRHKTC8Iq2HlT48sRFQ) | Direction of the camera                             |
| `fov`         | Number                                  | Field of view of the camera                         |
| `location`    | [Vector3](docId\:kEwRHKTC8Iq2HlT48sRFQ) | Location of the camera                              |
| `type`        | String                                  | Value is `perspective`                              |
| `up`          | [Vector3](docId\:kEwRHKTC8Iq2HlT48sRFQ) | Normalized vector describing the camera orientation |

### Example

```javascript
{
  type: "perspective",
  location: {
    x: 0,
    y: 0,
    z: 0,
  },
  direction: {
    x: 0,
    y: 1,
    z: 0,
  },
  up: {
    x: 0,
    y: 0,
    z: 1,
  },
  fov: 60,
  aspectRatio: 1,
};
```

