Hi, When I want to move the object, the object snaps to the earth’s surface.How do I get the altitude of a position on the earth?
If possible, could you post a video of the issue?
If you need to get the altitude of a position on earth, this comment might be helpful: The height of the sea is not 0 - #8 by Kevin_Ring
Thank you for your reply! @agallegos
I need to get the altitude of positions on spline point.The #online EGM96 calculator can’t meet my requirements.
I used this solution: # Stick to the ground , but performance will degrade and this not work if the spline is far away from the player, and the tiles it is passing over are not loaded.
If you’re using a spline and have already defined their position on the globe, you should be able to access the location of a spline point during play and convert it from UE coordinates to longitude/latitude/height coordinates.
If I’m understanding your project correctly, you may want to try the following:
- Get the location at a spline point. You’ll want to switch the Coordinate Space to World instead of Local. There are also a lot of other useful spline functions that may be better suited for your situation.
- Connect the output of your get location node to a InaccurateTransformUnrealToLongitudeLatitudeHeight node. Connect the level’s georeference actor to the Target pin of the node.
- The Z value of the output of the coordinate transform node should contain the altitude at that spline point. You can use a Break Vector node to access only the altitude (stored as the vector’s Z value.)
This solution might not be as accurate if the player is far away from the origin, but should work even if the tiles around it are not loaded. I would also guess it would be better for performance than the Line Trace solution you explored.
thanks, I will try to do so
Hi @agallegos I want to get the altitude through longitude and latitude,So this doesn’t solve my problem
If you need to get the altitude from longitude and latitude, then your best bet is probably Stick to the ground, as you mentioned. It’s not good for performance but you can add another camera in that area and make it render to a render texture. Having the other camera should keep the tiles from unloading.
Otherwise, I don’t have any other suggestions - but if you find a method that works for you, please post it here!