A first-person camera refers to a camera in a 3D scene that simulates the perspective from a first-person viewpoint. The camera’s position and rotation are centered around itself.
In Wings Engine, you can find the “Camera” component in the left panel. By default, there is an Bird’s Eye camera, which serves as the main camera. To add a first-person camera, you need to add it manually.
Go to the toolbar and select “Camera” , then add a “First-Person Camera”.
** Configuration item ** | Describe |
---|---|
Z Distance | The visible distance of objects in the 3D scene, also known as the near and far planes. |
Position | The 3D spatial position of the first-person camera. |
Rotation | The rotation angles of the first-person camera. |
Field of View | The size of the plane projected by the first-person camera. |
Moving Speed | The speed at which the view rotates when using the first-person perspective. |
Lock Pointer | Whether the mouse is locked while rotating the view in first-person perspective. |
Rotation Speed | The sensitivity of the camera lens rotation. |
Collision | Detects whether there is a collision with objects. |
Collision Ellipsoid Size | X, Y, Z represent the distance at which the camera will stop to avoid colliding with objects (e.g., if the value is set to 100, the camera will stop 100 meters away from an object). |
Adjust each parameter of the first-person camera according to your needs.
Once you have configured the camera parameters, exit the editing mode. In the scene, add a “Single Line Text”componentand apply simple styling adjustments.
Add interactions to the “Single Line Text” component, with the interaction settings as follows:
This setup allows you to switch to the first-person perspective by clicking a button. The final effect will look as follows: