Sign in to follow this  
Guest JuiceRabbit

FSX SDK water polygon help

Recommended Posts

I'm trying create a test lake using the FSX SDK. It works but the lake appears at an elevation of -32000 feet. Does anyone know how to make it sit on the surface of the terrain?Btw, Google Earth (the $20 "Plus" version) is excellent for tracing terrain features such as coastlines, rivers, roads, railways etc. :)http://forums.avsim.net/user_files/156499.jpg

Share this post


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

Shapefiles have 3 components - x,y,and z coordinates. If your shapefile is lacking the altitude (z), then Shp2Vec will assume a null value, and for FS that is -32768.The solution is to find some way to add that information to the shapefile and then your Lover's Lake will display correctly.Best regards.Luis

Share this post


Link to post
Share on other sites

Thanks, that makes sense!I'll try setting the z values to 0. I hope a value of 0 will make the water polygons "cling" to the ground at whatever elevation the ground happens to be. I'll let you know if it works.

Share this post


Link to post
Share on other sites

Clinging won't work. You need to set the proper elevation values.Christian

Share this post


Link to post
Share on other sites

OMG! :(You mean if I wanted to put in a river, i need to specify the correct height for every point in the polygon? That seems crazy! Why couldnt the poly just sit on the underlying terrain like a road vector.Any ideas as to how I could extract the underlying elevation from the appropriate BGL file?I suspose for coastlines it wont be a problem, since they will all be at sea level. But for rivers, big hassle! :( :(Im writing a little utility that takes a "tagged" Google Earth KML and converts the polygons or polylines into FSX features eg water polys, roads etc.

Share this post


Link to post
Share on other sites

For mesh-clinging water, please specify the:Legacy_LandWaterMask_Water_NoFlatten GUIDIt should not need any slope attributes.You can also get the altitude of that area by using TMFViewer - load the relevant dem and read the values directly.Then, add that altitude to the shapefile.And congratulations on having gotten so far in spite of the scanty documentation in the S.D.K.Best regards.Luis

Share this post


Link to post
Share on other sites

Thanks... but I wonder how the DEM bgl can be read programatically? Is this possible? It must be, the TMF viewer does it and so does LWMViewer.Any ideas?In the meantime I'll try Legacy_LandWaterMask_Water_NoFlatten guid. Too much work and not enough time to "play" with FSX :(

Share this post


Link to post
Share on other sites

I searched forLegacy_LandWaterMask_Water_NoFlattenin all the SDK docs, but cant find any reference to it.Can you give me the actual value for this GUID?

Share this post


Link to post
Share on other sites

All available textures are those listed in the terrain.cfg file.The one in question is:// Legacy_LandWaterMask_Water_NoFlattenTexture.381Name=Legacy_LandWaterMask_Water_NoFlattenColor=FF638AC2guid={5835459A-4B8B-41F2-ADC1-DEE721573B28}Textures=OCEAN_SEA_LARGE_LAKE_0FlattenMode=noneLandClassRemapType=noneExcludeAutogen=YesRenderToTexture=YesRenderPriority=80000Water=YesI imagine that you will be the first to test mesh-clinging water in FS X. Please let us know how it turns out.Best regards.Luis

Share this post


Link to post
Share on other sites

Looking forward to getting the SDK. I use Global Mapper, which has the ability to export shapefile polylines with z values from an underlying DEM. This would be best if you were also producing mesh from the same DEM. Or if you could extract a DEM from the game bgls.scott s..

Share this post


Link to post
Share on other sites

Hi JuiceRabbit.The GUID to use in the shapefiles DBF file is:{5835459A-4B8B-41F2-ADC1-DEE721573B28}found in the terrain.cfg as Luis writes.The XML can look something like this:<?xml version="1.0"?>Note there is no slope reference! You don't need any for a poly that has no z value.Dick

Share this post


Link to post
Share on other sites

Thanks :)I haven't tested Legacy_LandWaterMask_Water_NoFlatten yet, but I have got my utility now writing the .SHP files correctly (with 0 for elevation). Here's a couple of pics. Next time I'll try Legacy_LandWaterMask_Water_NoFlatten and then post some shots.Also, any tips on how to create islands inside the river? I realise i need to create other polygons to represent the islands but what Guid do i use? Can you give me a clue? Thanks in advance!http://forums.avsim.net/user_files/156729.jpghttp://forums.avsim.net/user_files/156730.jpg

Share this post


Link to post
Share on other sites

Thanks... I havent tried that yet, but see my post above, I've got my utility wrting the shape files correctly :) Can you help with islands?

Share this post


Link to post
Share on other sites

My next step would be to get my utility to extract elevation data either from a FSX BGL or from an external DEM (eg SRTM file) for each point in the polygon. Although I want to try Legacy_LandWaterMask_Water_NoFlatten as suggested above to see if that works. If it does work then maybe no need to extract elevation data.

Share this post


Link to post
Share on other sites

I haven't played with this extensively, but I think you don't need to do any thing special for islands. Just process your data and the islands will appear just fine. The pain of having to deal with islands seems to be solved with the new SDK...Christian

Share this post


Link to post
Share on other sites

Ive never used the FS9 or FSX sdk before a few days ago... can you give me more info?To put an island inside a water poly, what do i do? Create an exclusion poly for the island? Or or land poly for the island? I dont know.Help! :)

Share this post


Link to post
Share on other sites

Hi JuiceRabbit.You could use a DBF reference to this terrain.cfg texture:// Legacy_LandWaterMask_Flatten[Texture.379]Name=Legacy_LandWaterMask_Land_FlattenColor=FFAB4141guid={D242B77F-7308-4685-9B6C-89AF1CD43D13}FlattenMode=slopeFlattenPriority=50000LandClassRemapType=noneExcludeAutogen=NoRenderToTexture=NoRenderPriority=200000Water=NoNote the {b}Water=No{/b}. I haven't tried this, but it should work. You should try to study the terrain.cfg, as almost all the info for display characteristics is there.Christian was trying to pint out that a shapefile produced from most any GIS program should easily handle embedded islands ( donut holes? )in the water polys. That's also my experience so far.Dick

Share this post


Link to post
Share on other sites

Thanks :) I'll give this a try over the next day or so.Im been generating my own shape file from a Google Earth KML file. So to have an island in a lake I need to draw 2 polygons in Google Earth, 1 for the lake and 1 for the island. So ill try this GUID for the island.

Share this post


Link to post
Share on other sites

Best method for creating islands - good question.As has been mentioned, you could - leave holes in your river shapefile polygons where the land would show through; - use Dick's suggested method and please let us know how that works; - draw the islands separately and give them attributes of land class polygons (choose the ones that give you the land class of your choice) and see if they display over the water.Thanks for testing all of this.Best regards.Luis

Share this post


Link to post
Share on other sites

>Also, any tips on how to create islands inside the river? I realise i need to create other polygons to represent the islands but what Guid do i use? Can you give me a clue? Thanks in advance!An island should be represented within the Shapefile as a hole in the water polygon. No Guid is required.-Doug

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