Sign in to follow this  
Guest

my spreadsheet is updated and attached to this post

Recommended Posts

It will calculate the .inf file information for custom photoreal textures for any location in the world...after you give it the latitude and longitude for two points in your scenery. It will now also calculate the eventual texture "name" in ms lingo for all fields except the first three, these will likely be common to existing scenery of that particular local.If anyone would like to test it, please right click on the attachment below, choose save to disk. then start excel and "open" this file using "as text document" as the file type. Anyone who is good at excel will probably understand my calculation for the naming elements per the lod, my big problem wtih the first three digits is not knowing how ms decided to break up the longitudes codes for the lod1 and 0.Cheers,Bob Bernsteinps, I "selectively protected it but no password, so unprotect if you wish to play with the equations..if you really want to calculate inf details, and don't want to risk messing up the equations, leave it protected.

Share this post


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

Terrific, Bob. Thanks a lot. It really does everything except slice and name the textures. Great stuff.Best regards.Luis

Share this post


Link to post
Share on other sites

The world splits in 6 LOD0 quadrants, so there is the need to use two quaternary digits to describe them, see the figure on the address http://www.volny.cz/stoje/lod/lod.jpg For any LOD the number of the digits is LOD+2, the files for any LOD are created with the commandMakeBmp = 1, as Christian Stock described it already one year ago. Somebody called the naming system as the "Russian dolls", I like it!Vlada

Share this post


Link to post
Share on other sites

Hi Vlada, Bob, Pit, and all.This is the gist of an e-mail I sent ot Bob Bernstein:As you know, longitude is split into 3 at LOD0. The way I handle all this is to add 180 to the longitude. That eliminates the negative numbers ( we can add them back later to display ). Now the world around is 360*, starting at the International Dateline ( W180 ), just like Microsoft. The first Number has no latitude, and is zero, unless it is between E60 and E179.999999... then it's 1. The second number is the LOD0, without 1/3 of the world. This makes the generation of the numbers seem pretty hard. I think my Delphi code is different than yours, but here's what I did. I start with a zero for each number in the string, and add 90 to the latitude, and add 180 to the longitude... to eliminate the negative numbers. Skipping the first number, I set each number for latitude, by adding a -1 ( if in the north half ) or +1 ( if in the south half ). For the first longitudinal number, it equals 1 if greater than 240 ( 180 + 60 .... E60 to E179.99999 ), else it's 0. I then set each remaining number for longitude, by adding +2 ( if in the east half ) or +1 ( if in the west half ). I then join the numbers as strings, to give me the name, as text. // ----------------------------------------------------- WorkingLat := Latitude + 90;WorkingLon := Longitude + 180;NameBuild00 := 0;NameBuild0 := 0;NameBuild1 := 0;NameBuild2 := 0;NameBuild3 := 0;NameBuild4 := 0;NameBuild5 := 0;NameBuild6 := 0;NameBuild7 := 0;NameBuild8 := 0;NameBuild9 := 0;NameBuild10 := 0;NameBuild11 := 0;NameBuild12 := 0;NameBuild13 := 0; // ----------------------------------------------------- If WorkingLat >= 90 then begin NameBuild0 := NameBuild0 - 1; WorkingLat := WorkingLat - 90; end else begin NameBuild0 := NameBuild0 + 1; end; If WorkingLat >= 45 then begin NameBuild1 := NameBuild1 - 1; WorkingLat := WorkingLat - 45; end else begin NameBuild1 := NameBuild1 + 1; end; If WorkingLat >= 22.5 then begin NameBuild2 := NameBuild2 - 1; WorkingLat := WorkingLat - 22.5; end else begin NameBuild2 := NameBuild2 + 1; end; If WorkingLat >= 11.25 then begin NameBuild3 := NameBuild3 - 1; WorkingLat := WorkingLat - 11.25; end else begin NameBuild3 := NameBuild3 + 1; end; If WorkingLat >= 5.625 then begin NameBuild4 := NameBuild4 - 1; WorkingLat := WorkingLat - 5.625; end else begin NameBuild4 := NameBuild4 + 1; end; If WorkingLat >= 2.8125 then begin NameBuild5 := NameBuild5 - 1; WorkingLat := WorkingLat - 2.8125; end else begin NameBuild5 := NameBuild5 + 1; end; If WorkingLat >= 1.40625 then begin NameBuild6 := NameBuild6 - 1; WorkingLat := WorkingLat - 1.40625; end else begin NameBuild6 := NameBuild6 + 1; end; If WorkingLat >= 0.703125 then begin NameBuild7 := NameBuild7 - 1; WorkingLat := WorkingLat - 0.703125; end else begin NameBuild7 := NameBuild7 + 1; end; If WorkingLat >= 0.3515625 then begin NameBuild8 := NameBuild8 - 1; WorkingLat := WorkingLat - 0.3515625; end else begin NameBuild8 := NameBuild8 + 1; end; If WorkingLat >= 0.17578125 then begin NameBuild9 := NameBuild9 - 1; WorkingLat := WorkingLat - 0.17478125; end else begin NameBuild9 := NameBuild9 + 1; end; If WorkingLat >= 0.087890625 then begin NameBuild10 := NameBuild10 - 1; WorkingLat := WorkingLat - 0.087890625; end else begin NameBuild10 := NameBuild10 + 1; end; If WorkingLat >= 0.0439453125 then begin NameBuild11 := NameBuild11 - 1; WorkingLat := WorkingLat - 0.0439453125; end else begin NameBuild11 := NameBuild11 + 1; end; If WorkingLat >= 0.02197265625 then begin NameBuild12 := NameBuild12 - 1; WorkingLat := WorkingLat - 0.02197265625; end else begin NameBuild12 := NameBuild12 + 1; end; If WorkingLat >= 0.010986328125 then begin NameBuild13 := NameBuild13 - 1; WorkingLat := WorkingLat - 0.010986328125; end else begin NameBuild13 := NameBuild13 + 1; end; // ----------------------------------------------------- If WorkingLon >= 240 then begin NameBuild00 := 1; WorkingLon := WorkingLon - 240; end else begin NameBuild00 := 0; end; If WorkingLon >= 120 then begin NameBuild0 := NameBuild0 + 2; WorkingLon := WorkingLon - 120; end else begin NameBuild0 := NameBuild0 + 1; end; If WorkingLon >= 60 then begin NameBuild1 := NameBuild1 + 2; WorkingLon := WorkingLon - 60; end else begin NameBuild1 := NameBuild1 + 1; end; If WorkingLon >= 30 then begin NameBuild2 := NameBuild2+ 2; WorkingLon := WorkingLon - 30; end else begin NameBuild2 := NameBuild2 + 1; end; If WorkingLon >= 15 then begin NameBuild3 := NameBuild3 + 2; WorkingLon := WorkingLon - 15; end else begin NameBuild3 := NameBuild3 + 1; end; If WorkingLon >= 7.5 then begin NameBuild4 := NameBuild4 + 2; WorkingLon := WorkingLon - 7.5; end else begin NameBuild4 := NameBuild4 + 1; end; If WorkingLon >= 3.75 then begin NameBuild5 := NameBuild5 + 2; WorkingLon := WorkingLon - 3.75; end else begin NameBuild5 := NameBuild5 + 1; end; If WorkingLon >= 1.875 then begin NameBuild6 := NameBuild6 + 2; WorkingLon := WorkingLon - 1.875; end else begin NameBuild6 := NameBuild6 + 1; end; If WorkingLon >= 0.9375 then begin NameBuild7 := NameBuild7 + 2; WorkingLon := WorkingLon - 0.9375; end else begin NameBuild7 := NameBuild7 + 1; end; If WorkingLon >= 0.46875 then begin NameBuild8 := NameBuild8 + 2; WorkingLon := WorkingLon - 0.46875; end else begin NameBuild8 := NameBuild8 + 1; end; If WorkingLon >= 0.234375 then begin NameBuild9 := NameBuild9 + 2; WorkingLon := WorkingLon - 0.234375; end else begin NameBuild9 := NameBuild9 + 1; end; If WorkingLon >= 0.1171875 then begin NameBuild10 := NameBuild10 + 2; WorkingLon := WorkingLon - 0.1171875; end else begin NameBuild10 := NameBuild10 + 1; end; If WorkingLon >= 0.05859375 then begin NameBuild11 := NameBuild11 + 2; WorkingLon := WorkingLon - 0.05859375; end else begin NameBuild11 := NameBuild11 + 1; end; If WorkingLon >= 0.029296875 then begin NameBuild12 := NameBuild12 + 2; WorkingLon := WorkingLon - 0.029296875; end else begin NameBuild12 := NameBuild12 + 1; end; If WorkingLon >= 0.0146484375 then begin NameBuild13 := NameBuild13 + 2; WorkingLon := WorkingLon - 0.0146484375; end else begin NameBuild13 := NameBuild13 + 1; end; // ----------------------------------------------------- CustomNameString := IntToStr( NameBuild00 ) + IntToStr( NameBuild0 ) + IntToStr( NameBuild1 ) + IntToStr( NameBuild2 ) + IntToStr( NameBuild3 ) + IntToStr( NameBuild4 ) + IntToStr( NameBuild5 ) + IntToStr( NameBuild6 ) + IntToStr( NameBuild7 ) + IntToStr( NameBuild8 ) + IntToStr( NameBuild9 ) + IntToStr( NameBuild10 ) + IntToStr( NameBuild11 ) + IntToStr( NameBuild12 ) + IntToStr( NameBuild13 ) + 'Su.bmp'; // ----------------------------------------------------- This is part of my Delphi code. It works 100%. I can place a texture anywhere with this, as long as I have the right latitude and longitude. Dick

Share this post


Link to post
Share on other sites

Thank you Vlada, finally you've answered the remaining question I had regarding naming.Much obliged, now I can finish my spreadsheet to fully automate the naming.B

Share this post


Link to post
Share on other sites

Dick enjoyed looking at your code...so much going on right now, its fun! Sorry not to get back to you quicker.I have to look at it more carefully, but after a quick look, it appears like you have calculated halving values ahead of time, and test against the halving value. I found in excel, that letting that value be calculated for me made for small amount of code. Anyway, three cheers for your work...you are breaking the ground we all will enjoy building on!Bob B

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