Question Creating Elevation layer for Asteroid?

Notebook

Addon Developer
Addon Developer
Donator
Joined
Nov 20, 2007
Messages
11,285
Reaction score
263
Points
158
To BrianJ.

any chance you could do a "how I did it" for us lesser mortals?

Thanks, N.
 

BrianJ

Addon Developer
Addon Developer
Joined
Apr 19, 2008
Messages
1,280
Reaction score
126
Points
63
Location
Code 347
any chance you could do a "how I did it" for us lesser mortals?
:lol:
Of course. Maybe martins and Face can see if my method makes sense. Let me make some diagrams and get back to you.
 

Notebook

Addon Developer
Addon Developer
Donator
Joined
Nov 20, 2007
Messages
11,285
Reaction score
263
Points
158
That would be excellent, BrianJ.
I would like to get into base making with 2016, but its intimidating!
Currently stuck on my "transparency" thread, not sure how to end it and make it generic enough for 2016 surface tiles, without knowing how to make them!

Thanks, N,
 

BrianJ

Addon Developer
Addon Developer
Joined
Apr 19, 2008
Messages
1,280
Reaction score
126
Points
63
Location
Code 347
OK, here we go...

A brief (as possible) summary of my method for making planet wide elevation tiles (up to Level5) from a greyscale heightmap

You will need an image processing program such as Photoshop or Gimp that can scale and crop images to precise size.

You will also need Face's "ele2png.exe" included in his Treeman "OT3" package, download here:
http://www.snoopie.at/face/beta/ot3.zip (unzip into your \Orbiter\Utils folder)
Infos about ele2png:
https://www.orbiter-forum.com/showthread.php?p=567125&postcount=208

********************************************************

0. Set up your planet's Texture directory to receive your .pngs as follows:

Make a folder in your Orbiter\Textures\ folder, thus:
\Orbiter\Textures\PlanetName\Elev
(where PlanetName is the name of your planet eg. Pluto)

In the Elev folder, make 5 subfolders named 01, 02, 03, 04 and 05
In each of the five subfolders, make a folder named 000000

In subfolder 05 only, make another folder named 000001 (because Level5 has two rows of tiles)

1. Download your planet height map.
It should be in 2:1 width to height ratio, 0deg longitude at the centre.

2. Scaling the image
Scale your image to the following size for each level:
Level1 64 x 32
Level2 128 x 64
Level3 256 x 128
Level4 512 x 256
Level5 1024 x 512

3. Adding columns and rows.
We need to add 3 columns and 3 rows of pixels to each image, as described below.
a) Copy the first two columns of pixels (left hand side) and ADD them to the right hand edge.
b) Copy the last column of pixels (of the original image, right hand side) and ADD it to the left hand edge.
Diagram:
ceres_how_to1.png

c) Copy the top row of pixels and ADD it to the top edge.
d) Copy the bottom row of pixels and ADD it to the bottom edge TWICE.
Diagram:
ceres_how_to2.png

So now your images should be:
Level1 67 x 35
Level2 131 x 67
Level3 259 x 131
Level4 515 x 259
Level5 1027 x 515

4. Making the 259 x 259 .pngs for Levels1 - 3
Create a 259 x 259 square and fill it with 50% grey.
Paste the appropriate Level image into the TOP LEFT corner.
Save it as 000000.png (8-bit greyscale) in the appropriate folder \Elev\01\000000 or \Elev\02\000000 or \Elev\03\000000.
Here is the Level1 000000.png for Ceres:
000000.png

5. Chopping two 259 x 259 squares from 515 x 259 image for Level4
When chopping squares, remember each square overlaps by 3 pixels with every neighbour square.
a) Make two copies of your Level4 515 x 259 image.
b) Crop one image to the left hand side (deleting the last 256 columns), save as 000000.png (8-bit greyscale) in \Elev\04\000000 folder.
c) Crop one image to the right hand side (deleting the first 256 columns), save as 000001.png (8-bit greyscale) in \Elev\04\000000 folder.
Diagram:
ceres_how_to3.png

6. Chopping eight 259 x 259 squares from 1027 x 515 image for Level5
Various different ways to chop the image, here's how I did it.
a) Make two copies of your Level5 1027 x 515 image.
b) Crop one image to the left hand side, to 515 x 515 (deleting the last 512 columns).
c) Crop one image to the right hand side, to 515 x 515 (deleting the first 512 columns).
d) Duplicate each of your 515 x 515 cropped images so you have four copies of each.
e) Now you can crop each of those images to 259 x 259, cropping to a different corner each time.
f) Save as xxxxxx.png in the appropriate folder - \Elev\05\000000 for the top row of squares, \Elev\05\000001 for bottom row.
Diagram:
ceres_how_to4.png

7. Converting the .png to .elv using "ele2png"
OK, you should have the following .pngs in subfolders within the Elev folder:
Code:
/01/000000/000000.png
/02/000000/000000.png
/03/000000/000000.png
/04/000000/000000.png
/04/000000/000001.png
/05/000000/000000.png
/05/000000/000001.png
/05/000000/000002.png
/05/000000/000003.png
/05/000001/000000.png
/05/000001/000001.png
/05/000001/000002.png
/05/000001/000003.png

a) We need to make a text file to give to ele2png, telling it which .png files to process.
The location of the .png files is relative to the \Elev folder.
Copy-paste the list of .pngs above into a .txt document and save it as pnglist.txt in your \Orbiter\Utils folder, next to ele2png.exe.

b) We need to make text files with the metadata required by ele2png to set the elevation scale correctly.
For each xxxxxx.png make a text file called xxxxxx.png.meta, and save it in the same folder as the .png.
Copy-paste the following line into the xxxxxx.png.meta file.
Code:
vmin=0 vmax=0 scale=1 offset=0 type=-16 padding=1x1  colormap=0 smin=0 emin=0 smean=0 emean=0 smax=0 emax=0  latmin=0 latmax=0 lngmin=0 lngmax=0
Now you need to set the vmin and vmax values. For planet-wide consistency they are the same in each file.
vmin = lowest point of entire heightmap (in meters, relative to planet mean radius, whole number - no decimals)
vmax = highest point of entire heightmap (in meters, relative to planet mean radius, whole number - no decimals)
For Ceres the values are vmin=-27000 vmax=11000

So, now you should have identical metadata files in your \Elev folder, as follows:
\01\000000\000000.png.meta
\02\000000\000000.png.meta
\03\000000\000000.png.meta
\04\000000\000000.png.meta
\04\000000\000001.png.meta
\05\000000\000000.png.meta
\05\000000\000001.png.meta
\05\000000\000002.png.meta
\05\000000\000003.png.meta
\05\000001\000000.png.meta
\05\000001\000001.png.meta
\05\000001\000002.png.meta
\05\000001\000003.png.meta

c) Now we need to invoke ele2png to process the .pngs
Open your Command Prompt window and type in the following with a space between each:
<Full path to ele2png (leave out .exe extension)>
<Full path to planet texture folder>
<Layer type> this will be Elev
<file list flag> this will be -F
<Full path to file list> path to pnglist.txt
<metadata flag> this will be -m0
Here is a pic of my Command Prompt screen for processing the Ceres .pngs.
I've colour coded it to make it easier to see what's what:
ceres_how_to5.png

Hit [Return] and ele2png should chew through the .pngs in a couple of seconds and display a list of the .elv files it has created.
Hopefully you have a xxxxxx.elv tile beside each xxxxxx.png!!

*************************************************
Hope I've got it right and not forgotten any steps!
Regards,
Brian
 

Notebook

Addon Developer
Addon Developer
Donator
Joined
Nov 20, 2007
Messages
11,285
Reaction score
263
Points
158
Much appreciated BrianJ.

Looks like as much effort typing that in as making the levels!:cheers:

N.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,123
Reaction score
344
Points
108
Location
Lisbon
Website
orbiterspaceport.blogspot.com
That's a lot of manual work...
I have a browser based java-script code that will split images up to 4K semi-automatically.
I can share it as is if it helps in some way- don't ask me for any support ;)
 
Last edited:

Face

Addon Developer
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,202
Reaction score
139
Points
88
Location
Vienna
Well, there is still the idea to implement "stichnslice" as addition to OT3 to aid with the splitting/merging of elevation tiles. I just got the impression that with the advent of astrogull's tool, this is not necessary anymore. :shrug:
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,123
Reaction score
344
Points
108
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Well pointed!

I gave Elv Tile Splitter a try once and it didn't work.
But I guess I was being dumb (honestly my wrong it should work and these things require some study).

Anyway, it's always good to have some more manual alternatives.
It's important to know how things work and not depend on a magic tool from a single user :)
 
Top