opengpws icon indicating copy to clipboard operation
opengpws copied to clipboard

Help with drawing terrain

Open todirbg opened this issue 4 years ago • 0 comments

Hi, I have problem setting up terrain drawing and I am at loss what I am doing wrong. I think I've set it up correctly because it is kind of working. I think that I am setting it up correctly. The problem is that it is drawing the terrain on the whole panel instead of in a size defined by .disp_sz and the scale is way off if set to 1. I have to set it to 0.01 to see the terrain. Here is what my set up looks like(don't mind its ugly and the colours are not right, I'll fix it if I can make it work) `
egpws_conf_t egpws_conf={ .jet = B_TRUE, .ifr_only = B_FALSE, .appr_min = APPR_MIN_NONE, .ra_calls = RA_CALLOUT_1000, .ra_500 = RA_500_HARD, .type = EGPWS_MK_VIII, .terr_colors = { {.min_hgt = -300, .max_hgt = -200, .rgba = {1.0, 1.0,1.0,1.0}}, {.min_hgt = -200, .max_hgt = -100, .rgba = {0.0, 1.0,0.0,1.0}}, {.min_hgt = -100, .max_hgt = 0, .rgba = {0.0, 0.0,1.0,1.0}}, {.min_hgt = 0, .max_hgt = 500, .rgba = {1.0, 0.0,0.0,1.0}} } };

static const egpws_range_t egpws_ranges[] = { { NM2MET(10), 100 }, { NM2MET(25), 175 }, { NM2MET(50), 250 }, { NM2MET(100), 500 }, { NM2MET(200), 1000 }, { NAN, NAN } };

egpws_render_t render = {.do_draw = B_TRUE, .scale = 0.01, .offset = VECT2(0, 0), .disp_sz = VECT2(320, 240)}; `

In flopp I am updating the render with render.position = pos; render.rotation = orient.y;

and in draw callback sys.terr->terr_render(&render);

You may have guessed that this is used inside openwxr standalone.c and egpws_render_t render was moved out of draw cb so it is global. I was expecting that it would draw the terrain in a 320x240 size display at the lower left corner of the panel. What am I missing? Thank you for your time!

todirbg avatar Nov 09 '20 09:11 todirbg