PDA

View Full Version : Get terrain height at Point2d


salmo
09-25-2012, 09:41 PM
Stupid question I know, but can anyone advise how to get the terrain height at a given 2d map point (x, y) please?

VO101_Tom
09-25-2012, 10:16 PM
I do not know that there is a possibility during the game (I think not), but you can see in FMB. IvanK gave me a good tip couple of weeks ago:

http://www.pumaszallas.hu/Private/VO101_Tom/pics/Clod_elevation.jpg

salmo
09-25-2012, 10:37 PM
Thankyou Tom, I want to get the terrain height at various point2d's dynamically via script at runtime though.

adonys
09-26-2012, 02:34 PM
it should be possible to place something at runtime sticky to the ground, and then get the height of that object, resulting in the height of the terrain on which it was placed on.

this would work if a method to sticky place an object on terrain at runtime is available. nad it must be, as they have vehicles which are following the terrain.

salmo
09-26-2012, 11:23 PM
it should be possible to place something at runtime sticky to the ground, and then get the height of that object, resulting in the height of the terrain on which it was placed on.

this would work if a method to sticky place an object on terrain at runtime is available. nad it must be, as they have vehicles which are following the terrain.

I was hoping there was a C# method for this function, but alas there appears not to be one. I had also thought of implimenting your solution. Dynamically place an object, get its Z-height, then destroy the just-placed object. Very clunky but so be it. Thankyou.

IvanK
09-27-2012, 01:37 AM
Check the code in ATAGs bombing tool. It does it. I think colander was the artist of this tool.