Jump to content
Sign in to follow this  
Taildragger

Library bridge problem

Recommended Posts

Hi Scott,Well, that sounds like an improvement over what I was doing. Thanks -- will check it out.John

Share this post


Link to post
Share on other sites

Aha -- that's it. MS has a version 2 of the SDK on their website.Many thanks, Arno. And if you ever feel the urge to create the tool you mention in #5 above, I'm sure it would find a number of grateful users.John

Share this post


Link to post
Share on other sites
Guest artmartin

Appears that many users are using an afterthought feature I added into my Autogen Creation program I've had out in Beta testing that has the potential for doing exactly what we're looking for. I originally only had the ability to put in single GUI class objects as the Annotator program allowed. FS would then put in one of the objects in that class on the scenery as autogen at the chosen location. Emails came in then telling me that one could create a custom GUI class in the Default.xml file with a single object in them and thus be in much more control over object placement. Since I had a multiple house generation tool in the program they suggested I do a similar tool for those custom GUI class objects. The tool I created took advantage of the code I'd written for freehand defining of a curving line on the image, letting go of the mouse, and going back and clicking the mouse a desired distance away from the initial point of the defined line to set the spacing between the objects. It seems to work rather well as long as one doesn't need exact placement of the objects and doesn't care about the direction the object is facing. To simplify the coding I just made all the objects align vertically/horizontally. Now the requests are coming in for the user to be able to input exactly the distance between those objects and to be able to control the angle alignment. Seems a reasonable request. Will be tough with the freehand tool though since the user could create quite a complex shape. I think I'll add the functionality instead on a straight line tool for the first step. The user would define a line by setting a point and stretching out the line. After releasing the mouse button, they'd press the button once more on one side of the line or the other to define which direction off of the line the objects should extrude to. An input box would allow them to decide the spacing between the multiple objects. I don't know if the units for that spacing should be lat/long degrees, pixels across the image, or some other distance measurement like meters or feet. This is where the calculations get dicey for a program like mine. I don't truly calculate any lat/long coordinates or actual distances when placing objects but instead only use the grid reference the .agn file dictates - a 1 X 1 grid from -.5 to +.5. Those relative coordinates can change greatly in how they're represented in FS from a northern latitude scenery tile location to one at the equator. So let's say a user wants to put in a bridge using the preexisting bridge segments included with FS. They'd have to know the basic length of the segment they wanted to use and create a custom GUI class of that segment. Scaling isn't a parameter in the autogen files so you'd have to be satisfied with size of the object as created. In my program you'd input the distance apart you want the segments to be. You'd then draw a line where you wanted the bridge and mouse click on the side of the line you wanted the boxes representing the objects to be drawn out to. The program would create the objects along that line angled at the same amount as the line, spaced apart by the user-desired amount. Now here's another question. Do we assume we want the front face of the object to be where the line was drawn? What if we're putting in a string of telephone poles instead? Maybe they need to be rotated 90 degrees then. Guess I'd need to give the user a box to input amount of rotation from the original angle. The plot thickens.The real bummer to all this though is that you can't see what you just created without going through the lengthy startup of FS each time you make a change. Anyway, it's an intriguing challenge and autogen might not even be the best place to try to do this. By the way, I've given up using Avsim to host my new program and have been graciously been given my own forums on both Scenerydesign.org at:http://www.scenerydesign.org/forum/forumdisplay.php?f=56">and at the VFR Autogen site at:http://www.vfrautogen.co.uk/forums/index.php?c=4&sid=214a8eefb4b46c349338102b2a78b100">The latest version of beta program itself can be be found at the following link:http://www.vfrautogen.co.uk/artseditor_view.php">Please don't download this program unless you understand the risks and responsibilities of using a beta program and in no way should you ever contact Avsim or any of the hosts of the forums for program support. Thanks again to Avsim for helping me get this ball rolling.Art Martin

Share this post


Link to post
Share on other sites

Hi Art,That sounds very interesting. To be able to precisely control placement, separation, and angle of multiple library objects is exactly what is missing today.In the case of bridges, the desired separation between objects would be zero.Rotation would be important. The end segments with ramps of course need to differ by 180 deg.The WYSIWYG problem may not be critical. With today's techniques, we still have to start the sim to see the final results.As far as whether autogen is the best method, I'm not knowledgable enough on the pros and cons to comment.Good luck! I will check in from time to time on your progress at the other site.John

Share this post


Link to post
Share on other sites

The attached file is a spreadsheet that will create an FS2004 XML library bridge of any desired style, location, length, and orientation.User selects a style from the available library objects, specifies the desired end-point coordinates, and the scale factor. From that, a VBA macro "writes" the xml code to piece together the required number of individual bridge segments. This is based on the offset method suggested by Arno in reply #6 above.It seemed possible only to post this as a text file, so it will be gibberish. Just name and save it as *.xls and any version of Excel, 2000 or later should open it. From there, see the ReadMe worksheet for help.I have visually verified that the bridges come out right in all four earth hemispheres, so hopefully the math is OK. Still, this is a work in progress, so comments, bug reports and suggestions are most welcome -- here, or by E-mail in my user profile.John

Share this post


Link to post
Share on other sites

That's a fabulous utility, John - THANKS! Can't wait to try it out.I need someone who has a good working knowledge of VBscripting for Excel to help with a little AFCAD and object placement project- if you're interested, drop me a line please.Thanks again!sg


I7-7700k@4.7ghz | 32gb RAM | EVGA GTX1080 8gb | Mostly P3Dv5 (also IL2:BoX, DCS, XP11)

Share this post


Link to post
Share on other sites

Scott, my knowledge of VBA is very amateurish -- mostly learned during this project.But will contact you to see what you have in mind. If I feel qualified to tackle the job, I would be most happy to help out.John

Share this post


Link to post
Share on other sites
Guest artmartin

Great tool. Thanks for your contribution. I've been trying to do something similar in VB code but with a graphical and FS-interactive user interface although a concerted effort learning GMAX has taken away my development time lately. As I learn GMAX and see how really quickly one could create a custom bridge, I'm beginning to wonder the wisdom of using these built-in generic bridge segments. I've done some experimenting and, even though the bridges do get created where I want them, I find them less than satisfying. So many of the segments have lightpoles on every segment and when you string 15 or 20 of them together to form a long span, you get way too many lights for realism. It's really hard to not see the join point between the segments especially if you have to rotate off of NS/EW. The ramps on the ends end up too steep or too shallow to match the contour of the land. Often the width of the segment doesn't match the number of lanes of the road going over the bridge. If the bridge turns in the middle of the span, it's extremely hard to line the segments up right.Bottom line is that I think I'm going to get away from using the generic bridge segments, bite the bullet, and simply create my own GMAX bridges. Once I have a few models made I can simply alter their length, width, height, and textures and have a much more finished product. Now of course you have to realize that bridges here in the SW rarely are suspension or RR type where one has to model cables and girders. Most of the bridges I'm going to build are simply elevated roadways so I think you can see where my head's at.Thanks again,Art Martin

Share this post


Link to post
Share on other sites

Hi Art,Your points are well taken. Many of the flat library bridges are not realistic.My problem is I have need for more complex structures -- trusses especially, and even a few covered wooden styles. For these I find GMax frustrating (too impatient I guess).As far as resizing to fit the road, that can usually be done by adjusting the scale factor, as long as it's not so extreme as to mess up the overall bridge proportion.Will be interested to see what you come up with. GMax designs that could be easily scaled to fit the need would be extremely useful.John

Share this post


Link to post
Share on other sites

One gotcha I forgot to mention in the readme.This method works only for bridges spanning flat terrain. If you try to cross a canyon, the end ramps will be OK on the rim, but the center segments will be collapsed into the abyss (see attached shot).The problem is that each segment has the same altitude above the underlying ground or water. Thus the bridge follows the terrain contour -- not very satisfying.To fix this would require knowing the digital elevation profile of the surface directly below the intended bridge, and making that data available to the macro during the xml file creation. Each span segment could then be given the correct altitude adjustment to keep the deck level.At this point I am clueless how to proceed. Perhaps some of the mesh gurus out there have ideas?John

Share this post


Link to post
Share on other sites
Guest luissa

Hi,You can place the segments with the option AGL not set and give the segments an altitude parameter (which will be taken as above mean sea level).Luis

Share this post


Link to post
Share on other sites
Guest artmartin

Spent a few hours last night creating some basic bridge objects in GMAX and it was rather easy. Of course they were the simple concrete bridges I described in my previous post that basically have a roadway, some siderails, and support posts. All are 4 lane road bridges with a slight arch in the middle as is commonly done for short spans. I created 4 basic designs, a short bridge (~800 ft span), a longer one (1/10th mile or so), a dual version of the longer one, and finally a version of the long one that turns off to one side in the middle. The are all easily scaled in GMAX and the bottom support posts extend down past their reference point. If I were at home instead of work I'd include some screen prints of them. Maybe I'll do that later. I'll zip them up and upload them to the library here for anyone to use. I was thinking of the need for suspension bridges and ones with girders. Sounds like it'd be easier to simply create a box cover for the bridge and texture it with images that have transparency between the cables/girders. Obviously for major landmarks you'd want to go all out on the designs.Art Martin

Share this post


Link to post
Share on other sites

Hi Luis,I guess you are referring to setting the line "altitudeIsAGL = False" in the XML code, and then entering the MSL value in the "alt = " line. Great suggestion, that should simplify things.The MSL elevations of the bridge end points can be read at the same time as their coordinates, either from the sim, or from SBuilder or LWMViewer. For bridges over uneven terrain, the two end-point elevations will generally differ, so the deck will have some slope. But to get the MSL of each center segment, I should be able to just interpolate between the end points along the length of the span. Or the adjustment could perhaps easier be done with the biasY attribute. (Sorry, I'm just thinking aloud.)Much obliged for steering me in a new direction.John

Share this post


Link to post
Share on other sites

Thanks, Art -- I will look forward to trying them out. Maybe simply scaling an existing design in GMAX is something I can handle. ;-)John

Share this post


Link to post
Share on other sites
Guest artmartin

Scaling something like a bridge where you want to scale only in one dimension was something I didn't know how to do until last night. Up until then when I used the scale tool, everything got scaled - width, height, and length. When I was shrinking a building's footprint I had to go back and tweak the model objects to ensure it wasn't hovering over the ground. Found out there are 4 separate scaling tools (find them if you hold down the button on the primary scale tool). Not sure what each does but I stumbled upon one that scaled only in a single dimension and it seemed to work well. Man, I wish that program had a standard help system with find and index. Looking through tutorial files is a major pain when you're trying to find something very specific. You go looking for a tip on unwrapping a texture and you end up wasting 20 minutes reading a tutorial on how to extrude a nose from some game character. Sheesh.I'm curious. I've almost never seen in AVSIM's libraries contributions of GMAX objects unless they're already bundled in an object library. Is there some restriction on sharing your .gmax creations? There seems to be very few places on the internet where people put out their creations for free. I would suppose if you distribute them then you also have to include whatever texture files you used on the objects. Of course GMAX seems to include the full path to the texture files so I'm concerned that you'd also have to include instructions for remapping the textures if someone can't recreate the directory they were stored in. Art

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