Re: Terragear-devel Digest, Vol 9, Issue 1

mat churchill <[email protected]>
Newsgroups gmane.games.flightgear.terragear.devel
Message-ID <[email protected]>
> > a tile over Lands End airfield and the nearby hill carnbrea the last
> > hill in England. Done by hand the hill and airfield look very accurate.
> > Some screenshots can be seen here:
> >
> > http://freespace.virgin.net/mamaloucos.circus/Flightgearweb/index.html
> >
> > I'm aware that spending a weekend tinkering with one scenery tile does
> > not provide any solutions for world scenery building, it just looks nice
> 
> How did you place that? I've been fiddling with tguserdefas a means of
> easily generating the polygons for the textures. It may be possible to
> automate something processing geotiff files to extract the position data,
> then write a tguserdef xml config file.

Yes completely un-scientific but seems accurate for a single tile,
probably useless for any usable amount of coverage. For the record this
is how I did it. 

Using Gimp i created an all black scenery tile with a white single pixel
width border along the top and left hand edge only . I copied it to
drycrop.rgb in the data/Textures/Terrain folder - drycrop being the
predominant terrain in Cornwall. 
I then cut a chunk out of the 2.1GB Cornwall jpeg I made with the
ermapper software that was roughly a few 3 or 4 flightgear tiles wide
and had some distinctive coastline features. I opened this chunk in Gimp
calling it stjust.jpg.

I them fired up Flightgear with the --fdm=magic, set the view to looking
downwards as far as it would go and rose up to enough height to include
a similar view above the ground to stjust.jpg. What you see at this
point is an all black cornwall with a fine white grid exactly the same
as the scenery tiles. I used the flightgear controls to visually line up
the coastline in flightgear with stjust.jpg and took a low res
screenshot  of the grid image in flightgear (fgfs-screen-001.ppn). 

In Gimp I created a new layer in stjust.jpg. I opened
fgfs-screen-001.ppn in the gimp and then copy and pasted it into the new
layer where it initially sits as a "floating selection". I changed the
opacity of the fgfs-screen-001.ppn derived layer to about 50% and then
used the scale, rotate and move tools to line up the transparent
flightgear screenshot grid with the photo scenery. What you see at this
point is a transparent grey grid sitting over the photo scenery. By
selecting the original stjust.jpg layer in the layers dialogue in gimp
and then using the rectangular select tool it was much easier than
expected to select along the white lines of the semi transparent grid
and select an exact  (OK not quite) scenery tile shaped bit of photo
texture.

In fact whether it was some coincidence or there is some reason for it I
found that if I carefully followed the white lines while watching the
pixel size in the bottom left hand corner of Gimp I found the two
closest possible sizes were 1023 or 1026 square. I chose 1023 which is 1
pixel out from the 1024 I wanted.
By copying and pasting this into a new 1023 x 1023 rgb file, re-scaling
this to 1024x1024 and then copying it to
data/Textures/Terrain/drycrop.rgb and running flightgear I got
accurately aligned photo scenery for the chosen tile.

Although it took a while to get to the point where I had the overlaid
semi-transparent grid in Gimp, once I had it set up it was quick to do
the same operation for a different tile in the grid or to slighty move
the grid over the photo scenery to get it to line up correctly.


> I've found that the Image::Imlib2 perl library is incredibly useful for
> chopping/stitching/converting images.
> 
> > It looks like we're interested in a similar thing here, so more than
> > willing to help if needed, but unfortunately am not a coder.
> 
> I'll happily tweak code, but I'd definitely not describe myself as a
> programmer (The results are generally not pretty :-).
> 
> 
> 
I'm going to try to follow what David Luffs mentioned just before christmas and here:

http://www.mail-archive.com/[email protected]/msg18457.html

My current questions are very basic apologies in advance.


"As you say, defining a polygon with a custom name, and then defining
the texture for that name to be the photo, works just fine."  How does
this work?


"If you give your polygons the extension .osgb36" - which polygons are
these ?

"--useUKgrid at the construct stage". What stage of construction is this
?


"I then chopped the images up along osgb36 grid lines". How? was this
done using Image::Imlib2 perl library.

If anyone answers these questions could they include some example commands, this helps me a lot. 
I'm happily building UK landmass by combining Gshhs coastline with srt-3 height data, so am not a 100% beginner. 
but my learning curve has been rapidly accelerated by seeing the commands others have used.
Been having a lot of fun in the process by the way !

Mat
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.