wrld3d / unity-api

Issue tracking for the WRLD Unity SDK
28 stars 8 forks source link

Question: Deleting buildings in the map #95

Closed bava-kumaravel closed 3 years ago

bava-kumaravel commented 6 years ago

Is there a way to Pick and Delete buildings in the Map? And also, a way to obtain the plot boundary of the deleted building from the Terrains API, so the cleared plot can be made into a mesh to be built on through the game?

jbrownwrld commented 6 years ago

Hello, Unfortunately we don't have a way to remove specific buildings from the map in our Unity SDK, as many buildings are often built into a single mesh. We do, however, have a way of getting the boundary of a building:

  1. Create an information-only BuildingHighlight following this example: https://docs.wrld3d.com/unity/latest/docs/examples/selecting-buildings/
  2. The resultant BuildingHighlight object will have a list of BuildingContour objects; these represent parts of the building as polygons with minimum and maximum altitudes. The points of the polygon are kept in a list within the BuildingContour type: https://docs.wrld3d.com/unity/latest/docs/types/Wrld.Resources.Buildings.BuildingContour/
  3. These points, when converted from LatLong to Vector3, should give you the information necessary to build a mesh representing the building's plot.