设置摄像机
Let's create a tracking camera with a third-person view. Go to Create → Camera → Persecutor and add the new nodes near the car.现在我们来创建一个第三人称视角的跟随摄像机。进入Create → Camera → Persecutor菜单,在汽车附近添加新的节点。
The two interconnected nodes are the PlayerPersecutor tracking camera and Persecutor_Target, which is the default target of the camera.这两个互相关联的节点分别是PlayerPersecutor跟随摄像机和Persecutor_Target,后者是摄像机的默认跟踪目标。
We need to track the car body, that's why we do the following:我们需要跟踪的是车身,因此需要执行以下操作:
-
Make the Persecutor_Target node a child of the pickup_frame node.将Persecutor_Target节点设置为pickup_frame节点的子节点。
- Reset the position of the target relative to the body.将目标相对于车身的位置重置为 (0, 0, 0)。
-
Move the target a little higher to have a nice overview of the car.将目标节点稍微上移,以便更好地查看整辆汽车。
-
Switch the viewport to the view from the new camera.将视口切换到新摄像机的视角。
-
Configure the parameters according to your preferences. Pay attention to the following parameters:根据需要调整摄像机参数,以下参数尤为重要:
- Main Player — make sure to switch it on, so that the camera is set by default when you launch the application.Main Player:确保启用此选项,使摄像机在启动应用程序时作为默认摄像机。
- FOV Degrees — field of view that allows zooming the camera to choose the most artistic view.FOV Degrees:视野角度,可通过缩放选择更具美感的视角。
- Min/Max Distance — the minimum and maximum distance from the camera to the target; by making them equal, we can lock the camera in orbit around the target.Min/Max Distance:摄像机与目标之间的最小和最大距离;如果设置为相同值,可以锁定摄像机在目标周围的轨道。
- Min/Max Theta — the maximum and minimum tilt angle of the camera; by default it is able to move along the entire semiaxis.Min/Max Theta:摄像机的最小和最大俯仰角;默认设置允许其在整个半轴范围内移动。
Now, if we run the app, it will automatically set our tracking camera with a view of the standing car.现在,运行应用程序后,系统将自动启用我们配置好的跟随摄像机,并以第三人称视角观察静止的汽车。
Left click in the application window to capture the cursor. This will allow us to inspect the car from all sides by moving the mouse. Press Esc to release the cursor.在应用窗口中点击鼠标左键以捕获光标,这样就可以通过移动鼠标从各个角度查看汽车。按下Esc释放光标。
本页面上的信息适用于 UNIGINE 2.20 SDK.