Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VTP source code HELP

Featured Replies

Hello friends,I'm trying to write VTP and LWM source data from 'first principles'. I am comfortable programming in C and other scripts so I thought why not use such knowledge to program terrain data automatically - the problem is that I have managed to understand how to code LWMs (the terrain SDK for fs02 didn't help much - what REALLY helped was Rhumbaflappy's tutorial!) but I am finding VTP hard mostly cause there are texture issues!Can anyone point me to some reference regarding VTP data. Obviously, i'm using rhumbaflappy's include files.CheersStorm

I just went through the same ordeal and implemented VTP and LWM in C++. Based on the FS 2002 Terrain SDK doc (Terrain Texture Names.doc) and rhumbaflappy's latest include files the structure becomes entirely transparent.I wish that could be said for the other non terrain fields and all the other BGL data.

  • Author

Hi Storm.The SDK was incorrect about how sesonal textures are packed. They show them separated by commas:

Thanks Mat and Dick,The code example is extremely helpful - Dick, one question:- can I use my own textures for coast (I see you have 'Santa' textures so I guess that the question is redundant but anyway)? If yes, what's the recipe (in terms of image format, size etc) to get the texture on the VTP?CheersStorm

  • Author

Hi Storm.I usually use the extended 8-bit format ( 8-bit, mipped, with alpha as transparent ). I believe DXT1 with or without alpha can also be used, but the alpha will be transparent. Textures should be 256x256 pixels.As far as the VTPTextureType, the above example used 3, 0, 0, 4... but I'm not sure these values make any difference... play with it and see.Dick

Hi Dick,Managed to code VTP (at last!) - thanks, once again for the invaluable support.One question regarding the position of VTP points:I'm using BMP maps (representing 4x4 LOD 13 areas = 1024x1024 points) to retrieve coastline data.I translate pixel position to LOD 8 location using the following formula:(StartX+(PixelPosition*NumOfSectorPnts)/Width)StartX = left most boundary position of 4x4 cell (I'm sure this value is correct)PixelPosition = pixel column valueNumOfSecPnts = 1024Width = Image WidthIn FS I'm getting the points at position 0 offset (from the LOD8 grid lines). Obviously this results in all the polygons being offset. I'm pretty sure I have to apply some offset after translating pixel values but I can't figure out the formula to use. Any idea?RgrdsStorm

  • Author

Hi Storm.I'm not sure this is what you need, but VTP2 has 255 x 255 points in an LOD13 area... not 256 x 256 like LWM polys. And we have no idea why MS coded it this way!Christian Stock is using a GIS program to create VTP and LWM data, and was frustrated to find they don't line up ( shorelines and water polys ), for just this reason. Dick

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.