getPosASL and eyePos return incorrect Z coordinates.
The error is proportionate to the distance between the z value being tested and the sea level.
{F21808}
getPosASL and eyePos return incorrect Z coordinates.
The error is proportionate to the distance between the z value being tested and the sea level.
{F21808}
Download test mission and put in folder etc.
Start mission
Go into 3rd person to see better.
Press 0, 0, 0
Three lines are drawn between the player and man1.
Red = eyePos
Blue = getPosASL
Green = getPosATL
Move towards man1 (follow the lines).
As you move closer, note that the green line is drawn in the correct place.
The Red and Blue lines are way above the player (and man1).
This doesn't sound like a bug. Both getPosASL and eyePos return PositionASL, drawLine3D expects PositionATL. If you feed it PositionASL you get your Z offset by the sea level. Use ASLtoATL to convert the positions.
Place both men in the sea and eyePos and ASL will work correctly. see updated description of this command https://community.bistudio.com/wiki/drawLine3D
Thanks for the replies gents.
Was unaware of the ATLtoASL and ASLtoATL commands.
You can close this as resolved if you like.