Sign in to follow this  
Guest

How to mix AreaFill & AreaDrawPolygons

Recommended Posts

Dear friends,Now I am deep into it!! (or at least I think I am! :) )Here is the question!I am not sure I understood the point of having a LWMPol filled with land. Let's assume the following.We are in the middle of the sea. I want to put a small island that fits inside one area of a cell. I know that I have to assign a landclass for this place otherwise I will never get land there. So, the first thing to do is to get some land there. At this point, I test that I have in fact land there and if a square of land shows up I am happy.Next step would be to cut the land to show up water. For this I would need to draw a series of LWMPols to trim de land. But this is a lot of trouble and I thought that perhaps I can mix area fills with pols and draw one poly only. The idea is to fill the entire area with water (baring in mind that there is land assigned to that area) and then cut the water to show the land thus making use of the land filled LWMPol. This is how MS advices to do islands in the middle of lakes.This approach does not work as I expected and if this true then I can't see the point of having land filled LWMPolys.The code that I am using is attached as well as a screenshot of what happens.In the code, an alternative way of doing the same is shown commented but it does not make sense or even work.Any comments?Cheersjmf

Share this post


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

Hi jmf.First off, I've got to comment on something.Don't ask for help on the TDF sceneries without first including the exact latitude and longitude concerning the problem! Also, if a Landclass needs to be generated for an example, include the INF information and the class number, so everyone can duplicate the example. Yes, I can figure it out, but it takes time.The area of your scenery is already water, so you should just mask in the land. To debug your script, I first tried to split the poly into smaller, less complex shapes... and that fixed the problem. TXT file attached.Dick

Share this post


Link to post
Share on other sites

Hi Dick,Yes I could have sent the bgl with the landclass assignement. It would be simpler this way! Next time I'll remind myself to do that!What I was after was whether the approach was correct in terms of syntax. This is not clearly documented. Maybe you could include something like this in your excelent tutorial. If you wish, just cut & paste this example!I tried the opposite, ie, using the very same shape and cutting to achive water and that worked (ie, a water filled LWM). That's why I thought that the shape wasn't the problem. Wrong conclusion!!What do you mean by:"The area of your scenery is already water, so you should just mask in the land. " Does this mean that I should just specify a land filled LWM with this shape and that's it? How do you specify the land class? This would be simpler and it came to my mind but from what I understood from both the SDK and your tutorial is that you always need to have a land class assigned in order to have a land filled LWM. I hope I am wrong ;)Thanks for your help!jmf

Share this post


Link to post
Share on other sites

Hi jmf.My previously attached TXT file needs a landclass. But it doesn't need anything filled with water first. That can be done to insure a 'clean slate', but in this case, there is nothing to 'clean' as there is nothing but water there in the first place. ( It's in the ocean. )So save some code, and just draw the land mask polys. If you have an underlying landclass, the land masking polys will show up.The point is, when debugging, try to look at the code in a logical order. Is it the right LOD8 Cell? Is it the right LOD13 Area. Does all the code match the SDK format? ( And refer to the SDK often! ).At that point, try to eliminate some portion of the code to see what works... I reduced your poly to the last 20 points first, and that produced a valid poly, so I then split the points into 3 groups, and the problem was solved. The shape of the original poly must have been too complex.------------------------Now for the next step. You can avoid a landclass BGL entirely by making a VTP Method2 poly right on the ocean with a layer of at least 8. No need for landclass or masking. It will have all the characteristics of land, including autogen and seasons. You can then give it some re-meshing with transparent LWM flattens, if you like. Shorelines, roads, etc... can be layered right over it... but you cannot use watermasking with it anymore.If you use a layer of 0-3, you can color the ocean! Layers 4-7 are for texturing land that was already established by a landclass, and that can be affected by LWMs.Dick

Share this post


Link to post
Share on other sites

Hi Dick,Thanks again!I am still a bit confused about two things:1) "But it doesn't need anything filled with water first. That can be done to insure a 'clean slate', but in this case, there is nothing to 'clean' as there is nothing but water there in the first place. ( It's in the ocean. )"There must be an underlying class assigned to this area because that is needed to show land at some point. Therefore it is not clean right? Unless this assignement is done in such a way that it does not show up may be by setting the class for one area only it might not show despite the class being there.2)"So save some code, and just draw the land mask polys. If you have an underlying landclass, the land masking polys will show up."This is exactly the point. By default there is no landclass there. In other words, is it possible to have a landclass assigned to an area even if it is showing only water (all this before you start adding LM polys)?Thanks for the tips for debugging!Great discussion! Thanks for your time Dick,Cheersjmf

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