---
name: "Animation.rotate3d"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "Animation.rotate3d - 从固定轴顺时针旋转一个角度"
---

## Animation.rotate3d

> [VERSION] Base Library >= 2.21.8

### Description

Rotate clockwise by an angle around a fixed axis

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `x` | `number` | No | x coordinate of the rotation axis |
| `y` | `number` | No | y coordinate of the rotation axis |
| `z` | `number` | No | z coordinate of the rotation axis |
| `angle` | `number` | No | Rotation angle, range -180~180 |

### Return Value

Type: `Animation`

Animation instance

### Examples

#### Rotate 90 degrees around the Z axis

```ts
Page({
  data: {
    animationData: {},
  },
  onReady() {
    const animation = ty.createAnimation({ duration: 500 });
    animation.rotate3d(0, 0, 1, 90).step();
    this.setData({ animationData: animation.export() });
  },
});
```
