Why 'Y' parameter?
Blitz3D Forums/Blitz3D Beginners Area/Why 'Y' parameter?
| ||
Why does TerrainY need a Y parameter? surely it would just return the Y value for the terrain at x,z coords??? |
| ||
I've been wondering the same thing. I just put 0 for the Y parameter whenever I use it ;) |
| ||
I believe that is there just for balance in that function. TerrainX has X and TerrainZ has Z. Probably all 3 use the same C code only returning a different paramater. |
| ||
For want of not repeating, I just stick a 0 in the Y paremeter. |
| ||
I did have a snippet of code that went something like: Altitude=(EntityY(Ship,1)-(TerrainY(Terrain,EntityX(ship,1),(EntityY(Ship,1)),EntityZ(Ship,1))) This was giving some rather odd readings, until I did as suggested, and put a 0 in... |
| ||
12 years later it dawns on me. The parameter is the world coordinate. There's no guarantee that the terrain is necessarily aligned with a given plane. For example RotateEntity Terrain,90,0,0 MoveEntity Terrain,0,-200,-10 Therefore the TerrainY value is absolute in global coordinates. |