Closed AlessandroBagnoli closed 5 years ago
Hi - class Wrld.Space.Positioners.Positioner can be used to assist with this. It allows a geographical position to be specified relative to terrain height. Docs here: https://wrld3d.com/unity/latest/docs/types/Wrld.Space.Positioners.Positioner/ See usage in this example: https://wrld3d.com/unity/latest/docs/examples/fly-object-over-map/
We are currently revising related API points and examples to help clarify, expected in v0.7
Thank you for the reply. I've already tried using the Positioner class just like in the example you linked, without success. I'll wait for v0.7 and some other usage examples. Maybe I'm doing something wrong. Do you have an ETA for v0.7?
Tentative milestone date for v0.7 is mid-May https://github.com/wrld3d/unity-api/milestone/3
I am still wondering the same, how can I know the altitude above sea level of a given Vector3? IT seems that the map root is not aligned with the sea and placing a positioner using above ground requires streaming the area to know the proper altitude.
If I use "WorldToGeographicPoint" the altitude seems to be just Y value from the map root.
Closing during sweep You can use a Positioner to place objects at a height relative to the terrain at a given lat-lon coordinate. The Positioner will automatically update as terrain is streamed in, notifying via Positioner.OnPositionerPositionChangedDelegate
Api docs: https://wrld3d.com/unity/latest/docs/types/Wrld.Space.Positioners.PositionerApi/ See example here: https://wrld3d.com/unity/latest/docs/examples/position-object-with-positioner/
So i would like to place an object in a given point, on the ground, but how can i know the exact altitude of the ground? The example "Position Object at Latitude and Longitude" (https://wrld3d.com/unity/latest/docs/examples/position-object-at-latitude-and-longitude/) uses the instruction
box.localPosition = new Vector3(0.0f, 40.0f, 0.0f);
to fix the altitude, but how can I know the point's altitude where I'm placing the object is exactly 40? Right now, I am using Google Maps Elevation API to retrieve the altitude of a point, but there are some inconsistencies between the value returned from Google and the right altitude on the WRLD Maps. Any better solution?