Results 1 to 5 of 5

Thread: Calculate altitude/height of ground at any given point on the map?

  1. #1
    Ace
    Join Date
    May 2015
    Location
    Kansas City, Missouri area
    Posts
    515
    Post Thanks / Like
    Total Downloaded
    130.02 MB

    Calculate altitude/height of ground at any given point on the map?

    Is there any way to calculate the altitude above sea level of a given point on the map?

    Say function where I give it the (x,y) position of a point on the map and it returns the land elevation at that point?
    System: Microsoft Windows 10 Pro 64 bit, 10.0.18362 N/A Build 18362, 20,437 MB |
    ASUS GeForce GTX 1060 3GB | Intel Core i5-2500 Quad-Core Processor 3.3 GHz 6 MB Cache LGA 1155 | Intel DB65AL motherboard | ARCTIC Freezer i11 CPU Cooler | SVGA 500 watt power supply | Microsoft Sidewinder 2 Force Feedback joystick

  2. Likes Barraclough liked this post
  3. #2
    Team Fusion TWC_Fatal_Error's Avatar
    Join Date
    Dec 2013
    Location
    Florida
    Posts
    678
    Post Thanks / Like
    Total Downloaded
    226.63 MB

    Re: Calculate altitude/height of ground at any given point on the map?

    Yes sir just hold you mouse over the intended spot on the map in the FMB and at the end of the coordinate numbers after the ; is the AGL in meters including tenths of a meter<S> Fatal
    i7 2700 ,32 gigs, 4 ssd's ,1 7200rpm 2terabyte,1 samsung 55 display,2 mfd's,EDTRACKER,Warthog ,X55 stick, 7inch liliput monitor in mfd's 21 I-inc secondary display for instruments using virtual cockpit
    [*]iustus facere unus[*] JUST MAKE ONE ( FATAL ERROR) Commander TWC http://twcpilots.com

  4. #3
    Ace
    Join Date
    May 2015
    Location
    Kansas City, Missouri area
    Posts
    515
    Post Thanks / Like
    Total Downloaded
    130.02 MB

    Re: Calculate altitude/height of ground at any given point on the map?

    Quote Originally Posted by TWC_Fatal_Error View Post
    Yes sir just hold you mouse over the intended spot on the map in the FMB and at the end of the coordinate numbers after the ; is the AGL in meters including tenths of a meter<S> Fatal
    Aha yes - but I'm hoping to be able to grab that value in a script during the middle of a mission.

    There must be some way it is available as it certainly does display in FMB and also it's used frequently throughout the mission as it runs. But is it available to scripts while a mission is running?

    FYI Salmo's TF_extensions .dll has a function to provide elevation at any given point, but I can't seem to get that .dll to run under CloD 4.57 any more, and he didn't provide source for the dll so I'm not certain how he did it . . .
    System: Microsoft Windows 10 Pro 64 bit, 10.0.18362 N/A Build 18362, 20,437 MB |
    ASUS GeForce GTX 1060 3GB | Intel Core i5-2500 Quad-Core Processor 3.3 GHz 6 MB Cache LGA 1155 | Intel DB65AL motherboard | ARCTIC Freezer i11 CPU Cooler | SVGA 500 watt power supply | Microsoft Sidewinder 2 Force Feedback joystick

  5. #4
    ATAG Member ATAG_Oskar's Avatar
    Join Date
    Nov 2017
    Location
    Canada
    Posts
    986
    Post Thanks / Like
    Total Downloaded
    908.31 MB

    Re: Calculate altitude/height of ground at any given point on the map?

    Try

    Code:
    double z = Landscape.HQ(x, y);

  6. Likes TWC_Flug liked this post
  7. #5
    Ace
    Join Date
    May 2015
    Location
    Kansas City, Missouri area
    Posts
    515
    Post Thanks / Like
    Total Downloaded
    130.02 MB

    Re: Calculate altitude/height of ground at any given point on the map?

    Quote Originally Posted by ATAG_Oskar View Post
    Try

    Code:
    double z = Landscape.HQ(x, y);
    Aha, this was the key. Thank you.

    For whatever reason, I don't seem to be able to access Landscape--perhaps I don't know what namespace it is in or something.

    But I can access maddox.core.WLandscape.

    However, functions H, HQ, and other interesting-looking functions in maddox.core.WLandscape are all marked as "protected".

    So to get around that little issue I just made my own class derived from maddox.core.WLandscape and then I can access those functions from this derived class.

    It looks like this:

    Code:
    class twcLandscape : maddox.core.WLandscape
    {
        public static double HQ(double x, double y)
        {
            double height = twcLandscape.cHQ((float)x, (float)y);
            Console.WriteLine("Height HQ" + height.ToString());
            return height;
        }
        public static double H(double x, double y)
        {
            double height = twcLandscape.cH((float)x, (float)y);
            Console.WriteLine("Height H" + height.ToString());
            return height;
        }
        public static double Hmax(double x, double y)
        {
            double height = twcLandscape.cHmax((float)x, (float)y);
            Console.WriteLine("cHmax" + height.ToString());
            return height;
        }
        public static double Hmin(double x, double y)
        {
            double height = twcLandscape.cHmin((float)x, (float)y);
            Console.WriteLine("cHmin" + height.ToString());
            return height;
        }
        public static double HQ_air(double x, double y)
        {
            double height = twcLandscape.cHQ_Air((float)x, (float)y);
            Console.WriteLine("Height HQ_air" + height.ToString());
            return height;
        }
        public static double HQ_forestHeightHere(double x, double y)
        {
            double height = twcLandscape.cHQ_forestHeightHere((float)x, (float)y);
            Console.WriteLine("Height HQ_forestHeightHere" + height.ToString());
            return height;
        }
    }
    Then I just access twcLandscape.HQ(), twcLandscape.H(), etc, from anywhere in my script. And it seems to work just fine.

    I added a few additional functions that looked like they might be useful, such as HQ_Air(), HQ_forestHeightHere(), etc.
    System: Microsoft Windows 10 Pro 64 bit, 10.0.18362 N/A Build 18362, 20,437 MB |
    ASUS GeForce GTX 1060 3GB | Intel Core i5-2500 Quad-Core Processor 3.3 GHz 6 MB Cache LGA 1155 | Intel DB65AL motherboard | ARCTIC Freezer i11 CPU Cooler | SVGA 500 watt power supply | Microsoft Sidewinder 2 Force Feedback joystick

  8. Likes N/A liked this post

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •