Enjoying Cesium for Unreal so far
I have some (lat, long, alt) points but the alt points are a little noisy. Is there a way to get the height of the terrain? Ideally I’d like to draw on the tiles like:
but just getting access to the height of the terrain would suffice.
Is this possible yet in Cesium for Unreal?
Great question. We are currently working on a direct way of querying the height of terrain given lat/long.
However, given your use case, a decal component might be well suited for your use case of drawing on top of the terrain.
If you do need to get the height in the meantime, you could try doing a line trace to the world terrain object and use the Z value. The only issue might be if the fully refined tile is not loaded in when doing the trace, in which case the resulting terrain altitude will either end up being an overestimate or underestimate.
You could work around this by a) doing a new line trace when the camera gets close to the area and more detailed terrain gets loaded in, and adjusting the height of your Unreal object, or b) Temporarily setting the Maximum Screen Space Error in the tileset to a small number, and using the fully-loaded terrain to do the line trace (for example, using a small max SSE at editor time, then once the heights are determined, the value can be set back to normal).
Thanks! I did get ray tracing to work. Had some issues with ray tracing not working when the camera wasn’t looking in the direction I wanted to ray trace but got around it with a minimal caching solution. Should be a good enough solution to last to an update with legit terrain height grabbing.
Do you guys have a release date for the elevation query?
Hi @xuelong , do you have any updates regarding this feature?
any progress on this quite useful feature?
I agree it is very useful! But we don’t have an update on it at this time.