The methods of changing the perspective in Cesium will give you a thorough understanding of the cesium camera

For beginners of cesium, the camera is an indispensable part of knowledge. In this article, we will thoroughly play with the camera in cesium.

First of all, we need to figure out a problem. There is more than one way to change the perspective of cesium. The viewer itself has the flyTo method. However, there are some differences between the viewer's flyTo and the camera's flyTo.

First, the parameters and usage of viewer's flyTo are as follows:

viewer.flyTo(target,options)

The target here refers to the target to fly to. This target is usually data or location. There are many types of data supported by this data. Any data that can be loaded in the form of entities can be used, such as some oblique photography models, manual models, geojson data sources, etc., as well as some standardized 3D tiles data, but it must be Note that this target cannot be coordinates or position. It can only be one target data. The principle of its positioning is to find the bounding box of the target data, and then fly with the center of the set of bounding boxes as the center point. And the characteristic of this flight is that it must wait for the data to be completely loaded before it can fly. If the data is not loaded, it will not fly.

As for the following options parameters, they are used to adjust the camera parameters. It is an object that contains a total of three parameters: duration, maxmumHeight and offset. For example, the parameter of the time spent during flight: duration. If you want the flight to be slower, then you can set this time to be longer. . The maximumHeight parameter refers to the maximum height of the camera during flight. The offset parameter refers to the offset of the camera. Offset can contain 3 parameters, namely the heading used to control the camera orientation, the pitch used to control the tilt angle of view, and the distance from the camera to the target center point.

Guess you like

Origin blog.csdn.net/lz5211314121/article/details/131721529