Jump to content
Sign in to follow this  
Guest

Making lakes/ponds

Recommended Posts

Hi georgio and all.Here's the link for the TMF-style polygon discussion.The download here at AVSIM is Christian Stock's Ryan's Creek scenery... Sorry no link to the file library, the server is down right now.And , yes, georgio, we can already have FS2002-style flattened lakes, flattened coast correction, framerate-friendly invisible flattens, large mesh-clinging rivers, etc... Once you see Christian's code discovery, you'll understand the complexity. Right now, we need to do by hand, what Microsoft did with an advanced TMF polygon placement/generator.

Share this post


Link to post
Share on other sites
Guest

Hi rhumbaflappy (it it Richard ??), Arno and the gang..It looks that a lot of brainpower is already in the field.I checked the TMF thread, VERY interesting.I understand there is software developed as we write; this is great.If there is anything I can do just let me know guys (either in software or 'decoding').I also checked Christian's airport. He has done amazing decoding work. It would be very easy with his work in hand, to auto-create ASM code.To avoid making things twice, if you think some coordinated sort of group can be formed, I'll be glad to join.Catch you all later.George

Share this post


Link to post
Share on other sites

Hi George and all.Here's some of my random thoughts on this... To follow this you will need to download and read Christian's Ryan's Creek documentation.One way of viewing the problem, would be from a typical designer's viewpoint:The LOD8 area could be defined as a 8192 X 8192 bitmap with the polygons drawn in, and then "resampled" to the rowOffset1, rowOffset2 and colOffset, as defined by Christian. The Offsets define the location of each 256 X 256 LOD13-size sub-area. The points would then need to be derived... the actual flatten or flat-water polygon is basically a list of "moveto" commands, which the terrain engine fills in to make a polygon. So, the resampled LOD13 size bitmap shapes would need to be converted to a list of outline points defining the irregular corners of the "slice" of polygon that exists in it's borders. ( That LOD13 bitmap is 256 X 256 points. ) Somehow the elevation would have to be assigned to the shape as well, and type of polygon. And also, it's possible for 2 or more shapes to exist in the same LOD13 area, each having it's own elevation. and requiring it's own point list. The LOD13 area spans 1223 X 1223 meters at the equator.The only reason I'm suggesting an interface of a 8192 X 8192 bitmap: a designer could simply draw and fill his lakes, coasts or flattens on the LOD8 bitmap, assign height to shape, define type of polygon type to the shape, and get the MASM/BGLC code generated. Easy interface, complicated programming!Another way of viewing the problem would to have a location calculator that would spit out the code for the 4 corners of LOD13 size boxes that enclose the area to be flattened or watered. The point data in the generated code could then be "hand-edited" to get the desired shape, type, and elevation ( if needed ). Much simpler programming, not very user friendly. But, for the ponds and lakes and corrections we need, maybe user-friendly has less importance. A brute-force method could also work. A master text code covering the entire LOD8 area, with all 1296 LOD13 areas defined by their 4 corners could be made. Using a text editor, cut out all code for unneeded LOD13 areas, then adjust corner points in used areas, define elevations, and types. Define the LOD8 group info and needed counts, and you're good to go for compiling! This approach would be the easiest to implement, the least user friendly, and may be the best way for us to quickly get some examples out to the interested simmers. There would be a lot of editing text, compiling, try-out in the sim, more text editing, compiling, etc... It's a large amount of cut-n-paste, but could be done. Perhaps a variation of this combined with a calcualtor approach might work, saving a lot of the text cutting process.I could come up with something within the next couple of weeks regarding a brute-force master list, Christian's FS2002 macros, my CFS2 water macros, and an example. That is if I don't go crazy thinking about this all first :)Dick

Share this post


Link to post
Share on other sites
Guest luissa

Hi,I am considering the correction of a coastline with several kms of lenght. Probably I will not use a bitmap for the primary interface. Instead I will (probably) use an existing GUI tool for scenery design such as FSDS, ASD or SCC. On those tools I can activate a grid and set the grid size to correspond to LOD13. Then I will draw a polyline with the correct coastline. Using the grid and the polyline as templates, I will draw the water polygons. I can make the RefPoint to coincide with one "upper-left" corner of a LOD13 square and set the scale of the project so that the delta coordinates of the opposite corner for that LOD13 square (at my working latitude) are 255 255. Then I will generate the txt code (SCASM) for all my polygons and will edit it so that I only keep the list of points coordinates. Simple calculations that I can make on a spreadshet can give me the 1 column and the 2 row needed parameters ....and, if I will have luck ..... may be I will reach the point of having it all back in a MASM file for final compilation.Regards, Luis

Share this post


Link to post
Share on other sites

Hi Luis.Yes. That should work. Read the documentation Christian left us with the Ryan's Creek download if you have trouble. Would you please post before and after screen shots, and maybe the MASM/BGLC text code? And could you give us the spreadsheet code, as well? :)To everyone else reading, these coast alterations will be water-flatten TMF polygons... just like lakes and ponds... and just the way Microsoft defines coasts..

Share this post


Link to post
Share on other sites

Hi all.I've got a working calculator for TMF poly calculations. I'll have it posted after one or 2 more tweaks. It's pretty rough, but does the job. It is based on Orlando Sotomayor's LOD calculator ( which means it's in JAVAscript and is an .html file ).So far, it seems reliable, and will locate the TMF group, and data location numbers. I've also altered Christian Stock's original INC file, to include CFS2 Style mesh-clinging water polygons, and renamed some variables to make them less confusing. I named it "RhumbaTMFMacro.inc" to prevent confusion with other BGLC macros. There's going to be a lot of changes to these macros as more discoveries are made.I'll also include some new documentation, to help other designers and researchers. Also, here's a pond I dug at Interlaken. Somebody move that runway!:-eek

Share this post


Link to post
Share on other sites
Guest

Excelent work my friend !!!looking forward for the tools.One question : Is the way to add sandy waterlines known yet ?CheersGeorge

Share this post


Link to post
Share on other sites

Hi George.I don't believe anyone yet understands beaches and shorelines. But:You'll notice in the picture, the APB (Airport background ), surrounding the default runway. The ABP is just a textured TMF polygon. Note how the water has priority over the textured TMF polygon, which in turn has priority over the ground texture and the autogen. So to easily make a shoreline, just make the dimensions of the textured TMF poly slightly larger than the lake TMF poly... Voila! The water masks the inside of the textured TMF poly, and should leave the edge of the poly exposed as a shoreline, over the default ground texture.The above pond was a set of 10 x, y points. I designed the pond with MSPaint, using a 256 X 256 pixel size, to correspond to the 256 X 256 requirements of the LOD 13 area. I just used the x, y points as the paint program gave them... Christian Stock mentioned the point bounds are 0-255, just like most paint programs.

Share this post


Link to post
Share on other sites
Guest

Thanks !Both very good ideas...Going to have some fun.....Cheers

Share this post


Link to post
Share on other sites

Hi George.I moved the pond and added a nice sandy beach.The placement of decal polygons is very odd. Here's a snippet of code:; TERRAIN DECALS HEADERdecal_header label word DECAL_HEADER 256, decal_list, decal_textures, decal_end; TERRAIN DECALS DATAdecal_data label worddata_start_0 label word DECAL_DATA 1, 6, 1, 7, 1, 0, 0 DECAL_GEOMETRY 1, DECAL_POLYGON, 1, 0 DECAL_POINTS 10 DECAL_POINT 1 + ( 25 * 256 ) + 4096 - 40 , 91 + ( 7 * 256 ) + 4096 - 24 DECAL_POINT 11 + ( 25 * 256 ) + 4096 - 40 , 117 + ( 7 * 256 ) + 4096 - 24 DECAL_POINT 79 + ( 25 * 256 ) + 4096 - 40 , 150 + ( 7 * 256 ) + 4096 - 24 DECAL_POINT 121 + ( 25 * 256 ) + 4096 - 40 , 142 + ( 7 * 256 ) + 4096 - 24 DECAL_POINT 142 + ( 25 * 256 ) + 4096 - 40 , 82 + ( 7 * 256 ) + 4096 - 24 DECAL_POINT 124 + ( 25 * 256 ) + 4096 - 40 , 50 + ( 7 * 256 ) + 4096 - 24 DECAL_POINT 123 + ( 25 * 256 ) + 4096 - 40 , 21 + ( 7 * 256 ) + 4096 - 24 DECAL_POINT 106 + ( 25 * 256 ) + 4096 - 40 , 7 + ( 7 * 256 ) + 4096 - 24 DECAL_POINT 53 + ( 25 * 256 ) + 4096 - 40 , 4 + ( 7 * 256 ) + 4096 - 24 DECAL_POINT 16 + ( 25 * 256 ) + 4096 - 40 , 35 + ( 7 * 256 ) + 4096 - 24 data_end_0 label wordVery different than the straight-forward water or flatten polys.

Share this post


Link to post
Share on other sites
Guest

This looks like the business.... !!!I'm just sorting out the maths. One question (well I have many..) is about the LOD.Christian talks about LOD8 but as I understand it (maybe wrong) with the further subdividing of the LOD quad, you go down to LOD13. Is this correct ? Why not go for LOD13 or whatever else we want ?So far I have understood this : One LOD8 quad gets divided by a 32x32 grid.Then for every one of the 32x32 quads you get a 256x256 grid and this is the max resolution.When using christian's flatten_data macro, you split the row number to two parts one with the 3 Most significant bits (the ranging from 0 to 7) and the other with the 2 Least significant bit ( ranging from 0 to 3).The subcolumn parameter gets the whole 5 bits with values from 0 to 31.Please correct me if and where I'm wrong.O.K., if the above is correct, I have all the hard part ready for gmax. It's a matter of puting it together.Now, how about some waves on the beaches ???? :-)George

Share this post


Link to post
Share on other sites

Hi George.Yes, we're dealing with LOD8, subdivided into 32 X 32, which yields LOD13. The resulting LOD13 is then split into 256 X 256 points. These points number 0-255, 0-255.Christian actually misnamed the subrow, subsubrow and column! Changing the subrow and subsubrow number actually changes the column you're in. I'm going to release a new macro, as I noted above, renaming this to LOD13x, LOD13xx, and LOD13y.... makes more sense. Changes in x's move left to right; changes in y's move top to bottom. Also, I've been using LOD13x as 1-8 and LOD13xx as 1-4, with LOD13y as 1-32. It just works that way. 0 isn't used, as far as I can tell.The macro deals with the bit manipulation, so all we need to know is LOD13x, LOD13xx, and LOD13y.I've also got to do some work with the "decal" point data, as it uses a 8192 X 8192 grid, that appears to be offset 4056 points in the x direction, and 4072 in the y direction. The LOD13xx, LOD13x, and LOD13y, is unused and can be set to 0 as far as I can tell. Decals are not flattens or water, but are mesh-clinging textured polygons. I made the Interlaken beach with it. ( CFS2 water polys are also mesh-clinging ).In the above code snippet, I exposed the math to show what it looks like in the points, and left the LOD13 numbers in the DECAL_DATA structure:DECAL_DATA 1, 6, 1, 7, 1, 0, 0It could just as well have been:DECAL_DATA 1, 0, 0, 0, 1, 0, 0as those 3 location numbers are ignored for the TMF polygon decals, as Christian noted.Here's a view of LOD8, gridded to LOD13x, LOD13xx, and LOD13y:

Share this post


Link to post
Share on other sites
Guest

Hey guys, I've been really swamped lately and I'm currently focused on getting object textures to appear transparent on gmax objects, so I haven't followed the details of this development, but I need to ask....is the point of all of this work to simply create new water within default terrain? Why is there great interest in this? Is the photo realistic approach that uses resample.exe considered bad for this approach? Or is it that folks don't want to use a phototexture (even thou this method is also based on a 256x256 texture). Bob Bernstein

Share this post


Link to post
Share on other sites

Hi Bob.With this method, you can place water or any default-ground-texture polygon, either clinging to the mesh or flattened. Water will have all effects. Autogen is excluded, but only from the exact area of the polygon, not the entire LOD13 area. The pond I made at Interlaken is a good example. If desired you could place a swimming pool 9.6 meters square ( 2 x 2 ) in your backyard, without loosing the default textures or autogen surrounding the pool. You can trim a small area of coastline, or replace an entire HYP bgl. You can alter the ground texture for any size area, any shape, irregardless of the Landclass bgl. A flatten can alter any size area, any shape, to any height. Total control, and specific to the area and shape you desire, not an entire LOD area.I believe mesh can be altered to height at a single point, or a series of single points, each with separate height data, allowing custom mesh for small areas without regard to the rest of the underlying mesh... horizontal accuracy of 4.8 meters, and vertical accuracy of 1 meter. This is untried, but should be possible. That would allow total control of mesh for a small area.

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