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

Applies a transform to the specified model.

## Example

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

## Usage

```javascript
const modelId = "my-model-id";
const transform = {
  position: {
    x: 1.0,
    y: 1.0,
    z: 1.0
  },
  rotation: {
    angle: 3.14,
    centerOfRotation: {
      x: 0.0,
      y: 0.0,
      z: 0.0
    },
    x: 1.0,
    y: 0.0,
    z: 0.0
  },
  scale: {
    x: 2.0,
    y: 2.0,
    z: 2.0
  }
};
const type = "bim";

viewer3d.setTransform(modelId, transform, type);
```

## Parameters

### modelId

Id of the model to transform.

| **Type** | **Required** |
| -------- | ------------ |
| String   | Yes          |

### transform

Transform to apply.

| **Type** | **Required** |
| -------- | ------------ |
| Object   | Yes          |

**Properties**

| **Name**   | **Type**                                | **Required** | **Description**     |
| ---------- | --------------------------------------- | ------------ | ------------------- |
| `position` | [Vector3](docId\:kEwRHKTC8Iq2HlT48sRFQ) | No           | Position to move to |
| `rotation` | [Rotation](docId:2oViB7IabUIfxwS58jVDO) | No           | Rotation transform  |
| `scale`    | [Vector3](docId\:kEwRHKTC8Iq2HlT48sRFQ) | No           | Scale transform     |

### type

Limit the type of model the transform applies to.

| **Type** | **Required** |
| -------- | ------------ |
| String   | No           |

Valid values are:

- `bim`
- `point-cloud`

