# Convex and concave LWM & VTP2 polygons ?

## Recommended Posts

Hi,On this subject the MS Terrain SDK docs refer to fans and stripes! I wonder if someone with experience in geometrical computation could point me out to some reading where I could get some insight on these terms.As far as I could test, FS takes convex LWM polygons OK as far as the sides of the polygons do not cross one other. On the contrary concave VTP2 do not seem correct.Kind Regards, Luis

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

Hi Luis,don't worry too much about it. MSFS handles the problem for you, I know it sounds important in the SDK, but it can be safely ignored.Quick explanation: say you have a set of triangles that touch each other. You could record all the points of each triangle. However, if they share a side, you could only record the new point(s) (this is faster and modern games make use of this). There are 2 ways to do that, fans and strips. Fans are basically counting the points in clockwise or counterclockwise fashion. This way you get triangles that are ordered like a fan (ie all triangles share the very first point!). Or you count the point in an alternating fashing. This would (typically) look more like a snake.Now, the final shape of the polygon doesn't really matter, all this determines is how the triangles are formed within the shape.Say you have a fan shape. With the FAN setting, the triangles are really sorted like triangles in a fan. With the STRIPE setting, you get 2 big triangles forming a square box and all the other little triangles for the tips of the fan.Say you have a snake shape. With the FAN setting you get very long thin triangles starting from the head. Also, this doesn't work if the snake is concave (basically, your snake has to be a long rectangle). The STRIPE setting will divide your snake in fairly equal size triangles traversing along the snake. Concave snakes work with this setting!FANS can deal with some concave shapes, but not many.Cheers, Christian

##### Share on other sites

Hi,Thank you the tips. I went through some readings and I would like to report my findings about FS taking convex/concave LWM/VTP polygons.For LWM polygons I tried as many shapes as I could and it seems that FS represents them OK (being concave or not). Therefore when I have a LWM polygon I only have to partition it when it spans more than one area.For VTP polygons what I get is very strange. It seems to me that there are 2 modes for FS to represent polygons. These modes depend on the texture number. For some textures, FS represent all concave polygons that I can draw. But, for some textures, it uses "triangle fans". In this case FS has a limited capacity to represent concave polygons.I would like to avoid the partition of VTP polygons in triangles as this could result in a very large number of polygons (may be I am worried without reason!). I am finishing an algorithm to partition any concave polygon in a set of "fan OK polygons". I apply this algorithm to all VTP polygons even to the ones which have a texture number that would not require the partition. When the polygons are convex or are "fan OK polygons" in first place, I skip the partitioning. Kind Regards, Luis

## Create an account

Register a new account

• Tom Allensworth,
Founder of AVSIM Online

• ### Hot Spots

• 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!