hytopia
Version:
The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.
104 lines (48 loc) • 1.17 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [server](./server.md) > [Matrix4](./server.matrix4.md) > [perspective](./server.matrix4.perspective.md)
## Matrix4.perspective() method
Sets the current matrix to a perspective matrix with the given field of view, aspect ratio, and near and far bounds.
**Signature:**
```typescript
perspective(fovy: number, aspect: number, near: number, far: number): Matrix4;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
fovy
</td><td>
number
</td><td>
The field of view of the projection.
</td></tr>
<tr><td>
aspect
</td><td>
number
</td><td>
The aspect ratio of the projection.
</td></tr>
<tr><td>
near
</td><td>
number
</td><td>
The near bound of the projection.
</td></tr>
<tr><td>
far
</td><td>
number
</td><td>
The far bound of the projection.
</td></tr>
</tbody></table>
**Returns:**
[Matrix4](./server.matrix4.md)
The current matrix.