Jump to content
Sign in to follow this  
rhumbaflappy

LWMViewer tool for FS2004

Recommended Posts

Guest jimkeir

Hi.I've fixed the bug with the file you mentioned; another ExtendedPoly I'd missed.Also, I've added support for FDSConnection in addition to FSConnect and FSUIPC. You only need one of the three installed for it to work, but there shouldn't be any problem with having more. FSUIPC is the first one checked in the program, since it is the only one that seems to support Write operations correctly.Incidentally, these DLLs are only needed to support the 'flight following' functions. The file viewer part still works fine without them.Another update (!) on the website, hopefully in the right place this time... BTW, my email address should be in the ReadMe.txt file. Feel free to email directly if you find further problems.I'll get round to documenting the file formats RSN.Regards,Jim Keir.

Share this post


Link to post
Share on other sites

Hi Jim.Would it be possible for LWMViewer to build a georeferenced bitmap file of the BGLs to a size specified by the user?That could be very helpful to users of Coastline Maker or Ground2K. Ground2K could use bitmaps of up to 8000 x 8000 pixels without trouble. A 1000 x 1000 size for each cell would be useful.It could also help designers with access to GIS programs, as they could load new vector data over the bitmap, and view the changes their data would make.Dick

Share this post


Link to post
Share on other sites
Guest jimkeir

Hi.Yep, I think so. The height display I put in last week is based on a bitmap anyway, it's just a case of adding some scaling and saving it to disk.FYI, I've been asked to allow disassembly of the BGLs to disk, which I also plan to add soon. I think I'll add an 'Export' menu wth various options. And that reminds me, I've not posted details of the new VTPs yet. I prepared a document and then forgot about it :) I'll try and post that tomorrow. Briefest of brief summaries, from memory:=====================- VTPWidePoint.wReserved is now a point count, for following VTP3Points- VTP3Point is a signed 24-bit struct: X_Offset:11; Pad:1; Y_Offset:11; UseWidth:1;The offsets in the VTP3Point get added to the last plotted point. VTPWidePoint specifies a fixed location, as it used to. Both VTPWidePoint and VTP3Points count towards the total number of points in a poly. Like VTPWidePoint, each VTP3Point can also specify 'UseWidth' and be followed by an extra byte.=====================There are other small differences, but this struct was (for me anyway) the hardest part to work out.Regards,Jim Keir.

Share this post


Link to post
Share on other sites

Hi Jim.Great news. A save to bitmap function would be great.Here's the macro I've been using:; --------------------------------------------------------------------------------VTPChildPoint Macro ChildX, ChildY, WidthFlag WORD ( WidthFlag * 8000h ) + ( ( ChildX MOD 800h ) * 10h ) + ( 0 * 8h ) + ( ( ChildY MOD 800h ) / 100h ) BYTE ( ( ChildY MOD 100h ) ) EndM; --------------------------------------------------------------------------------The term I used was VTPChildPoint ( "VTPChildPoint 21,333,16" ), small difference in semantics... but if you would rather use the VTP3 term, I think that would be fine. I'll update the TDFMacros.inc after you publish your info.I also have used:; --------------------------------------------------------------------------------LWMPoly3 Macro PointCount, Reserved, Attrib, HeightStart, FractionStart, HeightEnd, FractionEnd; BYTE bPointCount:6 ; // Up to 62 points; BYTE bReserved:1 ; // Must be 0; BYTE bAttrib:1 ; // Polygon fill attribute, 0 = water, 1 = land BYTE ( Attrib * 80h ) + ( Reserved * 40h ) + PointCount SWORD HeightStart ; // Whole elevation value in meters BYTE FractionStart ; // Fractional elevation value in 1/128 meters SWORD HeightEnd ; // Whole elevation value in meters BYTE FractionEnd ; // Fractional elevation value in 1/128 metersEndM; --------------------------------------------------------------------------------LWMPoly3Ex Macro PointCount, Reserved, Attrib, HeightStart, FractionStart, HeightEnd, FractionEnd, ExPointCount; BYTE bPointCount:6 ; // Must be 63; BYTE bReserved:1 ; // Must be 0; BYTE bAttrib:1 ; // Polygon fill attribute, 0 = water, 1 = land BYTE ( Attrib * 80h ) + ( Reserved * 40h ) + PointCount SWORD HeightStart ; // Whole elevation value in meters BYTE FractionStart ; // Fractional elevation value in 1/128 meters SWORD HeightEnd ; // Whole elevation value in meters BYTE FractionEnd ; // Fractional elevation value in 1/128 meters BYTE ExPointCount ; // Number of polygon points = 63 + bExPointCountEndM; --------------------------------------------------------------------------------LWMPoint3 Macro x, y, z BYTE x ; BYTE y ; BYTE z ; 0-225 fraction of difference between HeightStart and HeightEndEndM; --------------------------------------------------------------------------------I think these structures are right, and they show fine in the sim and in your LWMViewer.If I wait for the SDK to add these terms, it might be a long wait. :(Dick

Share this post


Link to post
Share on other sites
Guest HotShot

Hi,in these times of ungratefulness to freeware developers, just a few words to thank you for your useful tool. It makes flatten removal so much easier ! :)

Share this post


Link to post
Share on other sites
Guest cwright

Jim, I just wanted to say how extremely useful LWMViewer has proved to be, particularly over the last week. I've been working to find a solution for islands (polygons inside polygons), a major problem when importing TerraScene images into AutoAsm. The good news is that I have a working solution (I plan to release AutoAsm before Christmas). But naturally during development the program generated lots of interesting LWM problems. Using LWMViewer to check for problems is much faster and more convenient than firing up FS. Over the last week or so it's saved me a lot of time. Many thanks! Best regards, Chris

Share this post


Link to post
Share on other sites

Hi Jim:I wholeheartedly agree with Chris' and HotShot's praise - this is one cool tool ;-)To make it even cooler (just kidding) here's a tiny request: would it be possible to add a function that allows one to enter lat/long and then computes the name of the FS9 LWM file for that region? I assume you know the formulae but here they are again, just in case:**9xxyy0.bgl, with xx (longitude) = TRUNC((180+long)/3.75)yy (latitude) = TRUNC((90-long)/2.8125)Note: enter negative values for western longitudes and southern latitudesUsually, I know the LOD5 coordinates of the areas I'm working in but occasionally I'd like to check out other areas quickly. I have the formulae in my EXCEL toolbox (as does TCalc2004) but it would be nice to have it integrated in LWMViewer as well.Cheers, Holger

Share this post


Link to post
Share on other sites
Guest jimkeir

Hi.Yes, I think that could be added. Even better, what about a 'load file by lat/long' dialog box, which displayed the filename before loading? You could always cancel the box if you don't want the files loaded.I've uploaded a new version which includes the 'export bitmap' function that was requested. BGL disassembly is in the pipeline too, but not in place yet.Many thanks to the folks who are posting here saying they like the tool! It's always good to hear that people are finding it useful.Regards,Jim Keir.

Share this post


Link to post
Share on other sites
Guest paul4540
http://forums.avsim.net/user_files/51535.jpgHi Jim,I also want to thank you for your LWM Viewer tool (and also a belated thanks to Christian for his Ground2K4). I am a beginner,and this is the first scenery project I've ever attempted. With tools like yours to work with, it makes it possible for a beginner like me to create some really high quality work. I'd also like to thank all of you regular contributors, and I will try to be more active in offering my assistance to anyone else who is just getting started. Anyway, I am enclosing a picture from my scenery project I'm working on of Buckeye Lake in east central Ohio. There is nothing really spectacular about this lake. In real life, it is just an overgrown pond. I believe its maximum depth is less than 10 feet. What makes it unique is that it spans two LOD5 cells. In order to get it to display correctly and eliminate the default LWM, I had to disable HP925170 and HP926170, which are found in two different folders (Namc and Name). Of course, this also took out most of Lake Erie and every smaller body of water across four states. I don't think I could attempt this without your LWMViewer to find and replace all thost. Thanks again.Paul

Share this post


Link to post
Share on other sites
Guest HotShot

>I've uploaded a new version which includes the 'export bitmap'>function that was requested. BGL disassembly is in the>pipeline too, but not in place yet.Wow, great news. lwmviewer will get the popularity it deserves for sure. (Btw how did you come to this as there is no SDK available yet ?)>Many thanks to the folks who are posting here saying they like>the tool! It's always good to hear that people are finding it>useful.I guess our mums once taught us to thank people for their presents. ;)>Regards,>Jim Keir.Greetings from the other shore of the Channel =)

Share this post


Link to post
Share on other sites

Hi Jim.Two more suggestions:The text file for the bitmap could use decimal degrees in addition to the degree/decimal minutes. That would make the bitmap use 100% ready for Ground2K. ( The sizable bitmap is a great addition! )UT9 bgls are utility lines, and could use a different color than the stream lines.This program is really becoming special!Dick

Share this post


Link to post
Share on other sites
Guest jimkeir

Hi.OK, the decimal locations are easy enough. I wonder how tricky it would be to write a project file for Ground2K directly, so it's ready to load?The reason that the utility lines are the same colour as stream lines is because they use the same layer number; I've cheated a bit by mapping layer numbers to colours. It should be easy enough to alter it to be aware of the actual texture ID instead of the layer number and base the colouring on that. Failing that, at least an awareness of the filename would do the trick.I've been spending a bit of time on my other project, so no visible progress on the disassembly features. However, I'll get back to it in the next few days at most. As with the 'load by position' feature, it's more or less already in the code. They both just need an interface added. (Load by position is already done as part of the 'autoload on follow' feature; file disassembly needs formatted output to a text file instead of plotted to screen).FYI, take a look at http://www.jimkeir.co.uk/AutoGen/index.html ; it describes where I'm going with the auto-generating software. I posted a version a week or so ago to see if it would help someone with a flatten problem. I think a few others tried it out, but it's been updated lots since then. As I said, *definitely* unfinished but does produce something that's useable.To answer Hotshot's question, I got the filespecs through a combination of a hex editor, Excel and sheer bloody-mindedness :-saeRegards,Jim Keir.

Share this post


Link to post
Share on other sites
Guest cwright

Jim, the bitmap export feature is extremely useful. AutoAsm can read the bitmaps, though the image does need some editing, for example to remove the LOD squares and change any grey lines to colours. This is no great problem. After all, the main point of reading in the bitmap would be to edit it so it is more accurate than the default. When I looked at the exported bitmap of my home area (the south of England) and compared it with the Ordnance Survey map, I could hardly believe how innacurate the coastline and roads are! Being able to run the program by double-clicking the bgl file is also great as it means I can call it automatically from AutoAsm. In the AutoAsm doc I'll recommed LWMViewer, as it's a perfect companion for any LWM/VTP creation tool. Many thanks. Best regards, Chris

Share this post


Link to post
Share on other sites

Excellent program... Thanks...Brings up a question from a part-time scenery modifier. I use Ground2K but have problems with residual flattened areas from the generic water mask. As mentioned vis-a-vis Lake Erie, if I eliminate the HP BGL I loose all other water masks in the area. Is there a methododology to eliminate a particular water mask?Dick Boley KLBE


regards,

Dick near Pittsburgh, USA

Share this post


Link to post
Share on other sites
Guest jimkeir

Hi all.Another day, another update. I've added the first LWM source export feature - not really tested much, but give it a go anyway. Also added Holger's request for a function to display the appropriate filename given a lat/long coordinate, and then to load the files.The macros I've used in the V3 exports are of course provisional - once the 'official' ones go into TDFMacros.inc I'll make any required changes.Same URL as usual - http://www.jimkeir.co.uk/LWMViewer.htmlRegards,Jim Keir.

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