Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: an algoritm for creating the contour lines in ed_m0X  (Read 3732 times)

0 Members and 1 Guest are viewing this topic.

Uzin

  • Modder
  • member
  • Offline Offline
  • Posts: 2816
  • On lifetime holidays
an algoritm for creating the contour lines in ed_m0X
« on: December 27, 2011, 04:37:19 AM »

A few days ago I tried an algoritm for creating the contour lines in ed_m0X.
Maybe someone does not know how to, so it might be useful.
Here it goes:
1. Open map_h.tga in GIMP, chnge Regime to  RGB (not compulsory, but convenient).
2. Select the point with RGB = 0, and set   threshold  to such magnitude, that the selection line frames loosely rivers or lakes.
3. Copy the selection to newly created  white layer, do not forget to anchor.
4. Go to this new layer, select white with threshold =0, select the perimeter of white  region, what is the  desired contour line, Fill it with colour of your choice, everything else make transparent - and here it is, a contour line.
5.Repeat points 2.-4 , with higher threshold values, fill the lines with other colours of your choice .
6. Copy all contour lines created and add them to ed_m0X.tga, further proceed as needed.
Logged

agracier

  • Modder
  • member
  • Offline Offline
  • Posts: 3048
    • The Great War in a Different Light
Re: an algoritm for creating the contour lines in ed_m0X
« Reply #1 on: December 27, 2011, 08:59:47 AM »

That's an interesting technique ... one that I will save as a snippet for reference ...

The above may be a bit more exact, but here is also a method that makes use of one of the small map making apps called 'select_h_range.exe' ...

This also works with map_h. When it runs you enter two values: a/begin height and b/end height.

Let us say 100m and 150m.

You will get a new map_H as copy that shows in white the land area between 100-150m.

If you use a command like 'trace contours' in a graphics editor like Paint Shop Pro7, you will also end up with a set of contour lines for those heights. These contours you then anchor, select all and then import into an ed_m map as a new contour layer ....

Repeat as needed for different heights.
Logged

Uzin

  • Modder
  • member
  • Offline Offline
  • Posts: 2816
  • On lifetime holidays
Re: an algoritm for creating the contour lines in ed_m0X
« Reply #2 on: December 27, 2011, 09:14:07 AM »

here is also a method that makes use of one of the small map making apps called 'select_h_range.exe' .
Where can I get this app -select_h_range.exe' , please ?
Logged

agracier

  • Modder
  • member
  • Offline Offline
  • Posts: 3048
    • The Great War in a Different Light
Re: an algoritm for creating the contour lines in ed_m0X
« Reply #3 on: December 27, 2011, 09:39:05 AM »

Where can I get this app -select_h_range.exe' , please ?

It was originally on a thread somewhere a few years ago. I downloaded and carefully saved it of course. It is far too handy to ever loose.

Anyway, not knowing where it came from, not even which site - AAA? - here is a link of my own uploading.

http://www.sendspace.com/file/dgtv9k

Unzip, place in the same directory with a map_h of your choice, execute, enter first height - press enter, then enter second height, press enter. The app will create a new map_h in which the white area is that between the two heights you indicated ...

You can play around and make all kinds of height selections. Be sure to rename a map you wish to keep, cause it will overwrite existing maps_h of the same name when run again.
Logged

agracier

  • Modder
  • member
  • Offline Offline
  • Posts: 3048
    • The Great War in a Different Light
Re: an algoritm for creating the contour lines in ed_m0X
« Reply #4 on: December 27, 2011, 09:49:39 AM »

Here are two height selections from the Karelia map. The first for heights between 71-90 / the second for 91-100.

In the first post I think I said it gave heights in meters, but now I think it is rather in RGB values. Since there are 256 possible RGB values to a map_h, you have to exercise some caution about the values. RGB increases of 1 value are exponential in Il-2. The lower values correspond to about 2 or 5 meters height difference per value, while the higher values can go up to 65m per RGB value ... or something in that neighborhood anyway.

So the difference between RGB 0 and 1 is much smaller than between RGB 233 and 234 ... if you keep that in mind you can get a good result and know what you need to enter as values.

And if you anchor the white areas with a same colored square in a corner somewhere, it is easy to select and import the whole height selection into another map. (I didn't anchor in the pics here)



Logged

Uzin

  • Modder
  • member
  • Offline Offline
  • Posts: 2816
  • On lifetime holidays
Re: an algoritm for creating the contour lines in ed_m0X
« Reply #5 on: December 27, 2011, 09:59:14 AM »

Thank you very much for giving me the app.
I see, I have invented a wheel, did not I ? :) :) :)

EDIT:
Just tried the application. It makes essentially the same as function Select in GIMP, with Threshold , that is, the same as I described above in points 1. and 2.
Then my above points 3. to 6. need to be done in order to obtain true contour lines as one pixel wide lines for ed_m0X.tga files.
There are several ways leading to Rome, surely.
Logged

fatty_finn

  • Modder
  • member
  • Offline Offline
  • Posts: 207
  • "no idea"
Re: an algoritm for creating the contour lines in ed_m0X
« Reply #6 on: May 03, 2018, 03:10:54 AM »

as agracier said: "RGB increases of 1 value are exponential in Il-2. The lower values correspond to about 2 or 5 meters height difference per value, while the higher values can go up to 65m per RGB value ... or something in that neighborhood anyway"

yes indeed, and this exponential scaling causes bad problems if trying to make a new map with a lot of high altitude land - looks awful.
so, is there any way to alter the standard height scaling, when making a new map from scratch?
with thanks
f_f
Logged
Pages: [1]   Go Up
 

Page created in 0.032 seconds with 29 queries.