для этой страницы,
отображается код на другом
Setting Up Cameras
The main camera functions are available via the Camera panel of the Scene Viewport: you can switch between cameras, add new cameras to the current world, open the Camera Settings window or lock the current camera.
By default, there are 2 cameras in the world:
- Engine Camera that is created from the world script. The view from this camera is rendered in a separate Engine Viewport, and you cannot change its settings via the UnigineEditor. This camera represents current player. The Engine Camera can be changed via the script.
- Scene Camera that is created from the editor script. This is the default camera of the UnigineEditor.
Both, the Engine Camera and the Scene Camera, always exist in the world.
You can also add new cameras. Such cameras can be used as watchpoints in the world: you can position the cameras at different points of the world and then switch between them via the Camera panel of the Scene Viewport when it is necessary.
Adding a New Camera
To add a new camera to the current world:
- Change the position and orientation of the current camera by using the navigation controls.
Position, orientation and settings of the current camera will be copied for the new camera.
- On the Camera panel, click .
The new camera will be added to the list of the available cameras with the
A new available camera
At the same time, the camera will be added to the world as a PlayerDummy node.A new PlayerDummy node
- Change the default camera settings to the required ones.
Positioning the Camera
When the camera is locked ( ), you can freely move it in the current world without recording changes in its position or orientation.
If you unlock ( ) the camera, it will return to its initial position and further movement of the camera will be recorded.
To set and save a new position and orientation for the camera by using the navigation controls:
to unlock the camera.
If you don't unlock the camera, the new position and orientation will not be recorded.
- Place the camera to the required position and/or change its orientation by using the controls.
- Click to lock the camera. The position and orientation of the camera will be saved.
Also you can position the camera by selecting it in the World Hierarchy window and directly changing its transformation via the Parameters window. In this case, there is no need to unlock it: the new position will be saved anyway.
Setting Up the Camera
As settings of a new camera are simply copied from the current camera, you may need to change them via the Camera Settings window.
To open the Camera Settings window, choose the required camera and click on the Camera panel.
The list of available camera settings depends on the camera mode. The first image shows the settings of the camera in the perspective mode. The second one shows the settings in the orthographic mode.
Orthographic Camera Settings
|Name||Name of the current camera. If you change the camera name, the name of the node (PlayerDummy) will be also changed.|
|Ortho||Toggles between the perspective and orthographic camera modes.
|Height||Height of the viewing volume which is represented in the form of a rectangular parallelepiped.
The width of the viewing volume will be equal to its height.
The option is available only in the orthographic camera mode (the Ortho option is checked).
|Field of View (available only for the perspective mode)|
Camera's vertical field of view in degrees. This is the area that can be seen in the viewport (how many degrees the camera covers).
You can use the following formula to calculate horizontal FOV from the vertical one for the given aspect ratio (width/height): FOV_h = 2 × atan ( (width / height) × tan(FOV_v / 2)).
|Lens (mm)||Camera lens focal length.|
|Near||Distance to the camera near clipping plane:
|Far||Distance to the camera far clipping plane. It directly affects the light scattering results and the sky color.
|Viewport||A viewport bit mask for the camera that enables to selectively display objects, decals and lights in the camera viewport. If at least one bit matches, the object, decal or light will be rendered. The mask can be edited.|
|Reflection||A reflection bit mask for the camera that enables to selectively display reflections from objects. The mask can be edited.|
|Reverberation||A reverb mask for the camera determines what reverberation zones can be heard. At least one bit of this mask should match the reverb mask of the sound source and the reverb mask of the reverberation zone. The mask can be edited.|
|Sound||A sound mask for the camera that what sound channels can be heard. If at least one bit matches the sound source mask, the sound can be heard. Each bit of the source mask specifies a sound channel. The mask can be edited.|
Rendering the Camera Viewport in a Separate Window
The view from each camera can be rendered into a separate Scene Viewport window.
To render a view from a camera to a separate viewport perform the following steps:
Add a new Scene Viewport window, choose Windows -> Add Scene Viewport.
A new viewport named Scene 2 will open.New Scene Viewport
Select the desired camera to render the view from in the drop-down list of the Camera panel.You can change the camera at any time if necessary.
The total number of viewports, that can be opened simultaneously, is not limited. Each new viewport window has the same functionality as the main Scene Viewport window.
You can use several Scene Viewports to operate with several nodes located far away from each other, or to view different orthographic projections of the scene (Top, Front, and Side views).
Hiding and Showing Viewports
You can hide the Scene Viewport window and show the one that is hidden. To toggle the Scene Viewport window, select its name in the Windows menu and choose Show or Hide.
Hide the Scene 1 Viewport
Show the Scene 2 Viewport
You can remove a Scene Viewport window when you no longer need one. To do so, select the name of the Scene Viewport, that you want to remove in the Windows menu and choose Remove.