Sign in to follow this  
rhumbaflappy

AutoAsm progress

Recommended Posts

AutoAsm is a prototype program that allows you to turn polygons drawn onto a .raw image into FS coastlines, rivers and lakes. After much pulling out of hair I finally solved the problems caused by multiple visits of the datastream into a given LOD13 square. It now uses a different algorithm based on calculating the azimuth angle of points around the edge of the square. The result is that I believe the program can handle shapes of virtually any complexity. It now handles multiple LWM polygons so you can draw any number of separate lakes as well as coastlines and rivers. The creation of the asm file is significantly faster. Finally I've added a coastline import function (uses data from http://rimmer.ngdc.noaa.gov/coast/). It needs more work, though - currently there's nothing to tell the program which side the water's on! I still need to fix one problem (the discontinuity caused by the beginning/end of polygons). I hope to have the next version out next week. It should be far more robust than the first version. The next major addition will be VTP support. A more long term aim is to add the ability to import two extra bitmaps that define the generic textures and terrain mesh (I wrote a VB program to do precisely this last year). You would then be able to create for example a completely new island with three bitmaps that define the generic textures, mesh terrain and coastlines/lakes/rivers. Best regards, Chris

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi Chris.You've been doing a lot of work! Thanks.One of the puzzles I'm mulling is that a lot of our source input may be in the form of raster grahpic shapes, and it needs to be translated to vector-type points. For instance, with Terrascene, we can get an incredibly accurate watermask for areas up to LOD8 size, at least from US and Canadian Data.This mask can be converted From TARGA to any type graphic file we like, and can be reduced to a 2 bit black/white image. My dream program would read that LOD8 sized mask, and create the LWM polys automatically. The same type of mask could be created for VTP polys to create landclass type ground polys.Is this idea too far from where you're going?Dick

Share this post


Link to post
Share on other sites

Hi Dick! This is *very* close to where I'm going! As you know, the program currently traces a line that describes the polygon. If the polygon were filled in (as I assume would be the case with the Targa image) then AutoAsm would get very confused (in fact it would first trace the outside of the polygon, then the next inside layer and so on, gradually spiralling into the centre....) However, it should be pretty easy to change the tracing routine so it can handle solid polygons. All you would need to do would be to convert the Targa to a 2 bit .raw format. I'll give it some thought. Maybe there'll be a Terrascene/LWM import function in the next version! By the way, what resolution would you need? Currently it's limited to 1600*1200, but that's purely arbitrary (it's set by dimensioning the arrays). Overall, it should be no problem! Best regards, Chris

Share this post


Link to post
Share on other sites

Hi Chris.Resample is pushing the limits at LOD8 size, so that's about the limit. The image produced by Terrascene is actually larger than the LOD8 size, so resample can be directed to get all 1024 slices correctly. But the user could be responsible to trim and resize the TARGA himself, to 8192x8192 for LWMs, if needed.The extents of a VTP LOD8 are actually 4080 thru 12239... 8160x8160 for LOD8 ( each LOD13 Area equivalent to 255x255 ). My thinking is that as far a LWMs and resampled slices, row and column '0' are for overlap, and that's why VPT2s use 8160 ( which equals 32x255 ), as they have no LOD13 overlap.Terrascene can be made to produce masks for any of it's elements... lines or polys, and I believe it can produce a shoreline... that means a mask can be made that is just a line for LWM water if needed.Similar masks of polys or lines can be made for land-types, roads, rails...I just guessed at the LOD8 size, but that seems to approach the limit of what resample can process... Terrascene doesn't have that problem. I'm still very impressed that I can give it a slightly oversized bounds for an LOD8 sized area, and the TARGA output easily made to a bitmap, and resampled exactly to size and scale! Tiny 1 pixel roads line up at the borders of adjoining LOD8 areas... even the diagonal ones! I haven't seen that happen with any other method! European sceneries may not be much better than the default FS2002, unless there is better data freely available than I know of.The output of Terrascene for FS2002 resampling is actually 4.8 meters, so very little resizing will be needed.Enclosed is an example 'slice'.. converted to jpeg, for the forum... but the quality is pretty good, and is hard to distinguish from the default textures. The tiny dark line is a stream, and is watermasked! There is no "framerate hit".Dick

Share this post


Link to post
Share on other sites

God created Earth on 6 days... With autoasm you can modify what is written in stone. Therefore you are almost God! :-LOLMANY thanks Chris for making this dream program. It might be the ultimate tool we'll need to make SCENERY, at last!--Daniel R. Careri

Share this post


Link to post
Share on other sites

Thanks Chris :) I can;t wait for the next version !CheersMichel

Share this post


Link to post
Share on other sites

Hi Chris!Good work!!, can you send screenshots of the program and the results in fs2002, please?ThanksPablo

Share this post


Link to post
Share on other sites

Just keepen tabs on the progress, Thanks Chris and Dick, that stream and road pic is neet! and no frame hit , fantastic work!!---- Sarg Willy

Share this post


Link to post
Share on other sites

Hi Sarg Willy.That 'slice' is created by Microsoft's resample.exe, from a Terracene2.1 output. That output was created from downloaded landuse data, water data, and line data, and used converted FS2002 textures.Whew.One of the goals to shoot for, may be to reproduce that quality with VTP and LWM polygons using AutoAsm. Dick

Share this post


Link to post
Share on other sites

Hi, Pablo, here are some screenshots that should give some idea of what can be done. First, take a screenshot in FS of a chosen area with a suitable zoom value. You'll need to know the exact centre position and size in decimal degrees. Then draw polygons onto the screenshot to define where the water will appear. As you can see, I was careful to keep the buildings dry! http://www.kline.demon.co.uk/picAA_4.jpg Now import the image into AutoAsm using the READ DATA button. The polygons I drew are faithfully reproduced. http://www.kline.demon.co.uk/picAA_3.jpg Now create an asm file by hitting the WRITE ASM button. The asm file is automatically created. Drag and drop the asm file into bglc.exe to compile it and you have the .bgl file. Pop the bgl into the FS scenery directory and you're all set to fly. Here's the result in FS2002.... http://www.kline.demon.co.uk/picAA_2.jpg The water is standard FS2002 flattened, landable water with all the effects except waves and beaches. Hopefully beaches and waves will be possible when I can add support for the VTP method. Of course, there's a bit more to it than that but this gives the basic idea. Best regards, Chris

Share this post


Link to post
Share on other sites

Hi Dick! I've added the ability to read in solid white polygons, which I assume would be generated by TerraScene. PSP will only save raw bitmaps with a minimum of 8 bits, so I'll stick with that. Here's the format it'll use. Can you confirm that it's okay? Using PSP or similar, it's easy to convert from targa to this format. 8 bit raw image file. Should work for 8192*8192, but it would take a few minutes to read in the 64 megabytes. Water areas indicated by solid polygons with pixel brightness of 255. The rest of the image is black. By the way, with 8192*8192 for one LOD8 area the 62 point polygon limit will be far exceeded (probably a minimum of 256 points), so it would make sense to use lower resolutions, provided the basic data isn't too badly damaged. Best regards, Chris

Share this post


Link to post
Share on other sites

Hi Chris.The watermask images use black for water... but that could be inverted by a paint program... or you could give a choice?An interesting twist might involve using the slices from resample rather than the entire Cell image.Those images ( slices ) are 256x256, and we can derive their Area and Cell location from the slice's name. Perhaps a whole folder of slices coul be fed 'hopper-like' into AutoAsm, and the whole mess converted to BGLC.Not only watermasks then, but Terrascene can make polys of roads, rails, shores, landtypes... and they can be isolated onto the targa image, then converted to bmp and sliced... so VTP method1 polys can be derived almost exactly like LWMs, as they depend on the 256x256 LOD13 Area as well. These would not be the standard FS2002 roads, but thin polygons that can be textured to look nearly the same as the roads. The shorelines could actually be improved... but the wave action would be lost... Not a bad thing for most lakes and ponds.A lot of ways to go here, and some choices you'll need to make. maybe AutoAsm will evolve into a few different programs by the time you're done with it.Dick

Share this post


Link to post
Share on other sites

Hi Pablo.You can also have mesh-clinging water ( for swamps, rivers... ) by using a value of -9999 for the height.Nice looking program, huh? And see how Chris is able to surgically cut around the buildings? Dick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this