I got a Terrain Quad, and want to add Trees and Plants on top of it. My problem is that i cannot calculate the position where i should place the models, they are always either under the Terrain or way above it.
terrain.getHeight(x,z) always seems to return 0.
Any advice how to obtain the height of the Terrain at a specific point?
u can use ray collision, take a look on TestTerrainCollision
getHeight() has recently been fixed, so if you grab the latest update it will return the proper heightmap value.
Now this is the heightmap value, and not the actual height: it doesn’t take into account scale.
So as Setekh suggested, use ray collision for the most accurate height value.
Thanks, ray collision is working fine