GHD Posted October 27, 2007 Report Share Posted October 27, 2007 I am running a program which used to work but now gives all ground altitudes as zero. The code is: double dLat, dLong; double dLat1, dLong1, dHeight; long long Lat; long long Lat1; long long Long; long long Long1; long GroundAlt; FSConnection.Read(0x560, 8, &Lat1); FSConnection.Read(0x568, 8, &Long1); if (FSConnection.ReadAndProcess(0x20, 4, &GroundAlt)) { dLat1 = Lat1; dLat1 = dLat1*90.0/(10001750.0 * 65536.0 * 65536.0); dLong1 = Long1; dLong1 = dLong1*360.0/(65536.0*65536.0*65536.0*65536.0); dHeight = GroundAlt; dHeight = dHeight/256.0; } The latitide and longitude are correct but the altitude is always returned as zero. Any ideas? George Edit. I've just tried with V4.203 with exactly the same result. Link to comment Share on other sites More sharing options...
Pete Dowson Posted October 27, 2007 Report Share Posted October 27, 2007 I am running a program which used to work but now gives all ground altitudes as zero. The code is:The latitide and longitude are correct but the altitude is always returned as zero. ... Edit. I've just tried with V4.203 with exactly the same result. Could you first try using Logging and/or FSInterrogate (the tools provided to investigate such things), to check what you are reading to what is provided? BTW I've just re-checked, and both ground altitude and aircraft altitude read-outs are still fine. (There's actually no reason why they shouldn't be as it is all down to Simconnect these days! ;-)). Regards Pete Link to comment Share on other sites More sharing options...
GHD Posted October 27, 2007 Author Report Share Posted October 27, 2007 Thanks for the reply Pete. FSInterrogate confirms the program findings, offset 0x20 is being returned as zero. However, the program positions the aircraft before interrogating the height. I was running FSX in paused, slew mode and I could see that the position was being changed but the altitude remained the same. I then "unpaused" FSX and it worked correctly. I am sure I have run it previously with FSX paused but perhaps I hadn't :? Sorry to have troubled you. George Link to comment Share on other sites More sharing options...
Pete Dowson Posted October 27, 2007 Report Share Posted October 27, 2007 I then "unpaused" FSX and it worked correctly.... Sorry to have troubled you. No problem. I wouldn't have thought of that either! ;-) Pete Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now