Jump to content
Sign in to follow this  
rhumbaflappy

Including a flatten bgl file

Recommended Posts

Guest JohnC

I have just attempted to flatten an area outside Kahului airport on Maui, Hawaii just to familiarize myself with the methodology.I used SCASM 288 and submitted the following code:Header( 1 20:52.50 20:52.00 -156:26.8 -156:26.3)Area16N Flatten ( 1.61 20:52.00 -156:26.8 20:52.00 -156:26.3 20:52.50 -156:26.3 20:52.50 -156:26.8 )End16SCASM said it compiled OK in scaerrorlog.I put in the Header information to get rid of the scaerrorlog warning that I had no header, and I didn't know how to define the header extents here.I placed the single BGL in its own Scenery directory and put it at the top of the FS2k2 list.When I start up FS2k2, I cannot see any flattened area that I thought should have been depressed down and flattened to 1.61 meters. The area in question is in the area of 30 meters or more and is not flat since I taxiied across it and watched the altitude readout.I was under the impression that a bgl in a directory called scenery at the top of the scenery dbs would override anything underneath it. I put the bgl file at the top, I put it in the ADDON SCENERY Scenery folder, and put it in the Hawaii SCENEDB.Nothing.Can anyone suggest any possibilities?

Share this post


Link to post
Share on other sites
Guest sgreenwood

Hi John,>I put it in the ADDON SCENERY Scenery folderThat should work.>The area in question is in the area of 30 metersThe minimum area actually flattened seems to depend on the LOD of the mesh underneath. And it is not always entirely flat, especially true for small areas over low LOD mesh resolutions! I usually test with extreme values first; you might want to try testing your code first with an elevation of 200-500m above the surroundings!I've written a small toolkit to create flatten bgls. I use Elevation instead of Flatten, which I have not tested. You are welcome to download it and compare my SCASM output with your source:www.fs-traveler.com/cgi-bin/flatten.zipSteve

Share this post


Link to post
Share on other sites

Have you tried putting the lat/lon coordinates in the other order? The SCASM docs say that usually the coordinates are in anti-clockwise direction and yours seem to be in clockwise direction.For the rest the source looks OK.Arno


Member Netherlands 2000 Scenery Team[link:home.wanadoo.nl/arno.gerretsen]Arno's FlightSim World for scenery design hints, tips and other tricks...

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest JohnC

My sentence was poorly worded the area flattened actually has a ELEVATION of about 30 meters so I expected it would be easy to see a depression down to 1.6 meters.I'll try elevation instead of flatten and try Arno's idea in the post after yours. Thanks for the response. Extreme values are a good idea.

Share this post


Link to post
Share on other sites
Guest JohnC

I looked again and my source is actually counter-clockwise and goes bottom left,bottom right, top right, top left.......BTW, (along with many others, I'm sure) I appreciate your helpful presence here on this board.

Share this post


Link to post
Share on other sites
Guest luissa

John,I would add a LatRange() command just following the Header(). Also I would enlarge the range of both the Header() and LatRange(). By the way, here is a flatten code at the beginning of a macro object that needs a flatten area (the object is not to be placed on the airport grounds).; VOR MACRO; parameters; %1 = longitude; %2 = latitude; %3 = rotation; %4 = complexity; %5 = visibility; %6 = elevation GRP( %1 %2 )Area16N Flatten( %6 d 30 30 ; NW vertex d 0 -60 ; NE vertex d -60 0 ; SE vertex d 0 60 ; SW vertex )End16Area( 5 %1 %2 15 )....note that the flat area is a sqaure of 60 meters side.Regards, Luis

Share this post


Link to post
Share on other sites

Hi John.I took your code and compiled it as you first listed it. It does compile, and in the sim it does not work.I then use Winfried's BGLAnalyze3.1 to decompile it:; ----------------------------------------; flattentest.BGL disassembled by BGLAnalyze © on Sun Mar 09 09:16:45 2003; ----------------------------------------Header( 1 N20:52:30.00 N20:52:00.00 W156:26:18.00 W156:26:48.00 )LatRange( N20:52:00.00 N20:52:30.00 ); since SCASM does not support multiple latitude ranges; the range has been set to the minimum/maximum latitude.; LatRange information in the BGL file is given as comment.; If you want to use band separation, you must edit; the source file manually.; Insert the "Set( FSVers 0x800 )" instruction at the beginning; of the file, if you want to use the FS2002 instructions; for the facilities sectionmif( [$Version < 285] ) Error( You need at least SCASM version 2.85 to compile this code )mifend; ----------------------------------------; Miscellaneous section; ----------------------------------------; LatRange( S00:00:00.00 S00:00:00.00 ); ----------------------------------------Area16N Flatten( 1.610 N20:52:00.00 W156:26:48.00 ; vertex 1 N20:52:00.00 W156:26:18.00 ; vertex 2 N20:52:30.00 W156:26:18.00 ; vertex 3 N20:52:30.00 W156:26:48.00 ; vertex 4 )End16; ----------------------------------------; end of SCASM sourceAs you can see, the order of the points is clockwise ( makes no difference ), but the decompiler adds a valid LatRange. When this code is compiled, it correctly lowers the ground in the sim. Luis is exactly right.So the BGL requires a LatRange. Note, using shift-z to gather the altitude won't work exactly rigtht, because that is measured from the aircraft's COG ( I think ). I use TDFCalc3, and FSUIPC to determine exact altitudes, latitudes, and longitudes.Dick

Share this post


Link to post
Share on other sites
Guest JohnC

Thank you all for your help...I was fooled by using just the example code (which compiled), and in going back to the SCASM documentation, it DOES say that both Header and LatRange are required. I will restart, but one question I have hanging is this...what is the difference between a flatten command and an elevation command? Does one harden the surface and not the other? I will report on my success later (I hope).

Share this post


Link to post
Share on other sites
Guest JohnC

Thanks. I got everything working but I only saw the change after I shut down FS2k2 and restarted it again. Sticking a new bgl file into ADDON SCENERY|SCENERY and restarting the flight didn't seem to work.I am going to see if I can smooth out some really unsightly steep gradients north of the airport...I will try multiple points instead of just four point squares oriented NS-EW. (I can hear the groans and muffled laughter already)As to detecting actual altitude contours in the sim, I put the system into slew, slewed a Cessna 182 over the ocean and slewed down to the surface. Altitude is 3.8 feet. Slewing back onto land slowly, one can watch the SHIFT z altitude change as the aircraft wheels skew acros the ground. If you slew slowly enough, the wheels won't dig in.:-lol Has anyone out there used several different elevations in the same bgl?

Share this post


Link to post
Share on other sites

Hi John.Bear with me here.The mesh will control just how you may flatten an area. Here's some code:Header( 1 N43:00:00.00 N42:00:00.00 W087:00:00.00 W088:60:00.00 )LatRange( N42:00:00.00 N43:00:00.00 )Area16N Flatten( 400.000 N42:39:14.76 W088:36:33.84 N42:39:14.77 W088:36:33.84 )End16This tiny 2 point flatten will push up a huge area of real estate. That's because the mesh is probably LOD6 here.But look at this:Header( 1 N43:00:00.00 N42:00:00.00 W087:00:00.00 W088:60:00.00 )LatRange( N42:00:00.00 N43:00:00.00 )Area16N Flatten( 296.000 N42:39:31.20 W088:37:21.60 N42:39:31.20 W088:36:05.40 N42:38:41.40 W088:36:05.40 N42:38:41.40 W088:37:21.60 )End16Area16N Flatten( 400.000 N42:39:14.76 W088:36:33.84 N42:39:14.77 W088:36:33.84 )End16Here, I first suppress the mesh with a much larger flatten. That destroys the mesh... just like the LWM flattens for coastal water flattening. Immediately after that is my tiny 2 point flatten. Now it pushes up a much smaller area.Note how they have different elevations. Scasm chokes if the 2 points are the same, but LWM polys allow 2 identical points. For LWM flattens, the priciple is the same. Supress the mesh with a larger base, then the smaller flattens can raise the elevations with more control.Always keep your poly shapes convex ( fan-shaped ). Dick

Share this post


Link to post
Share on other sites
Guest JohnC

I read this to mean that SCASM can push up or flatten a large area because when it gets a command to push up two points, it doesn't know the bounds of the area to be elevated, so it pushes up the whole polygon, or pair of LOD6 polygons. I am going to try to terrace the area north of Kahului airport by a series of concentric polygon elevations with the first one the largest area, lowest elevation, and then finally to the airport boundaries itself. Although because of the tradewinds you rarely fly from the ocean onto the long runway, the shorter of the two runways for private aircraft over the city and port area really needs to have that large terrace reduced, because there is a large nature preserve (Kealia pond) directly under the approach from the east.I assume that the two point flatten is used to illustrate your point and has no practical application.

Share this post


Link to post
Share on other sites

Hi John.The point is that the mesh controls the area pushed up or down by even a tiny flatten. It's controlled by the LOD of the mesh.By their nature, Area16n flattens, and LWM flattens, destroy mesh. After the mesh is ruined, it takes a much more extensive set of flattens to prop or drop the terrain... as the effective LOD is increased.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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...