In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to add a single object Entity in Cesium development. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
In Cesium, add individual objects, such as labels, billboards, models, and so on, and use Cesium's viewer to add entity objects to display on the map. In the cesium map, it is added according to the coordinates of x, y and z. For the objects with direction and inclination angle, such as the model, we can also set the attribute of orientation to realize the turning and inclination angle of the three-dimensional direction. The attributes in the following figure are universal, and need to be set when adding each entity, id indicates the uniqueness of the entity, which can be easily used in the entity search, name is the name of the display entity, show is the control to show or hide, position and orientation are the comprehensive control of the entity's position and direction.
The following figure shows what types of objects can be added in the entity. All the objects listed in API can be added according to the parameters. Click the connection of each type of object and you can see the detailed parameter settings.
The following are the parameter settings for the model object:
Entities are added through viewer.entities.add, and here is a simple code to add a model, all organized in the form of json objects:
Viewer.entities.add ({
Id: "id attribute"
Name: "name"
Position: "location"
Orientation: "turn"
Model: {
Uri: "Model File path"
Scale: "Model scale"
}
});
Find a solid object:
Var buildentity = viewer.entities.getById ("corresponding id")
Locate an entity:
Viewer.flyTo (buildentity, {
Offset: {
Heading: Cesium.Math.toRadians (0.0)
Pitch: Cesium.Math.toRadians (- 45)
Range: 200
}
});
API document address:
Https://cesiumjs.org/refdoc/
This is the end of this article on "how to add a single object Entity in Cesium development". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.