hi, everyone
I load a terrain page, but TerrainPage.getHeight() dont get my a correct value. in some places return NAN and in other the value its wrong, meaby the terrainScale is the problem?
RawHeightMap heightMap = new RawHeightMap(myUrl, tama
hi, everyone
I load a terrain page, but TerrainPage.getHeight() dont get my a correct value. in some places return NAN and in other the value its wrong, meaby the terrainScale is the problem?
RawHeightMap heightMap = new RawHeightMap(myUrl, tama
Hello daruk,
What are the vars "x" and "y"? If they are your naveNodo coordinates, you should take care of local/global coordinate systems. I mean, when you ask the Terrain for the height, you should use the addition of your object/node coordinates and those of the terrain.
Also, I've seen that you are using TerrainPage (class) instead of page (object). I think it is a copy-paste error
I think, your check code should be as follows:
if (
page.getHeight(
new Vector2f(
page.getLocalTranslation().x+naveNodo.getLocalTranslation().x,
page.getLocalTranslation().z+naveNodo.getLocalTranslation().z
)
)
>= naveNodo.getLocalTranslation().y
)
{
System.out.println("chocamos................................................");
}
thanks, the problem are the local/global coordinates, and i am from colombia
the method returns NaN if x or y are outside the terrain. at some points, i believe it was where the pieces of the terrainpage (you are using a quadtree=terrainpage, not a terrainblock, right?) touch each other, the result is wrong for some reason. i ficed it in my local code more than a year ago, so i have no idea what exactly i did