Re: photo

David Luff <[email protected]>
Newsgroups gmane.games.flightgear.terragear.devel
Message-ID <[email protected]>
Jon Stockill writes:

> Am I correct in thinking that when photo scenery is created the image is
> draped over a regular grid with a resolution equal to the number of
> segments that the image has been broken into?
> 
> If this is the case then it explains the gaps I'm seeing around the edges
> of the photo scenery where it meets the normal textured polygons - the
> higher detail in the SRTM3 DEM really does show up the differences, and
> the photo sections look very flat.
> 
> If I were to define an area in the same way the land use is defined, but
> with a custom material, it appears I can control the scaling of the
> texture, but how do I control its orientation? Would it be draped over a
> full resolution elevation model? Or have I got completely the wrong end of
> the stick?
> 

Hi Jon,

I've never tried playing with the specific photo-scenery creator, so I can't comment on the differences between that and normal scenery generation, but I have draped small areas of photos over the scenery using the normal tools before.  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.  By default, the orientation of the texture is Northwards (I think) so most photos come out fine.

There's a couple of undocumented helpers available for the UK though.  If you give your polygons the extension .osgb36 then the coords will (should!) be interpreted as UK eastings and northings (meters) so eg you could have a polygon file:

CUSTOM_PHOTO_1
1
430000 300000
431000 300000
431000 301000
430000 301000
430000 300000

Not sure of the exact format there, but you get the gist, it's much easier to use eastings and northing for UK photos cut up along the grid than to convert to lat, lon.

However, the texture scaling is still based on lat, lon, so the textures have a discontinuity every now and again (1 deg lat?).  You can get round this in the UK by specifing --useUKgrid at the construct stage (might not propogate from the client and server tools) which causes the textures to be tiled aligned with UK grid lines across the whole UK.

Using --useUKgrid in conjunction with .osgb36 polygon files, it should be quite easy to get each piece of photo in exactly the right place.  It's been a couple of years since I played with this though, so the code (and my memory of how to use it) might have been broken by now though.  Shouldn't be too hard to fix though.  Also, I was on Cygwin at the time and using construct manually without the client - server arrangment, so I'm not sure if the --useUKgrid option will get passed through with them.

Cheers - Dave
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.