Jump to content
Sign in to follow this  
rhumbaflappy

FS2k2 roads using the Terrain SDK?

Recommended Posts

Guest

Hi Falko, both of these are generated from the same apt code.The Airport 2.6 sca reads: RefPoint( 7 :TagPoly 1 50:40.6881 -001:6.12216 V1= 10000 V2= 2235 ) RRStart( 3 10 -443 0 -258 ) ; 1The FSSC sca reads: RefPoint( rel :lblEnd 1.0 N50:40:41.5860 W001:06:07.5836 v1= 10000 v2= 3180 ) LoadBitmap( 0 5 F0 0 0 0 "v_road_minor.bmp" ) Smoothing( 1 ) RRStart( 3 10 -443 0 -258 )Also could you give details of how to change 'roads' to 'shore/waves', I managed to get the waves but against a road.Thanks David

Share this post


Link to post
Share on other sites

Hi David.If the BGLC code is not too long, attach it as a text file to a post. Then I could see what needs to be done to alter the code to show shorelines and waves.Also, add a comment line to the BGLC code ( starts with ";" ) that gives the Latitude and Longitude.Dick

Share this post


Link to post
Share on other sites

Hi Falco.Over the next few days I'm going to create a new TDFCalc program that reads it's latitude and longitude directly from FS2002 and CFS2 via the FSUIPC module. It will show all the numbers needed for LWM and VTP code, for any given point, automatically. I'll probably call it TDFSlew, as that would be it's usage.It occured to me, if you could develop a program to input these FS2002 derived points to a list, using FSUIPC, then your program could create BGLC code at the click of a few buttons.Input could occur as you slew to a point in the sim, and press a key combination. From your program, you could have a "code" button, that would create and save the BGLC code as the filename of choice, then clear the buffer for a new set of points.This would bypass SCASM entirely, and allow BGLC coding "on the fly", by use of the slewing function of FS2002.What do you think?Dick

Share this post


Link to post
Share on other sites
Guest

Hi Dick, I was this the code you required (asm)?Thanks David

Share this post


Link to post
Share on other sites

Hi David.I made some changes of your code you may like. If you 'copy' the code, paste it into WordPad ( not NotePad ), then save as TXT ( that will get rid of the color and size formatting ). Or use the attached TXT.include TDFMacros.incinclude TDFHeaders.inc; VTP Method2 Roads 50.678218-1.1021065 BGLHeader 52, 49, 0, -3, TerrainHeaderStart, VTPHeaderVTPHeader label word VTPFileHeader 256, VTPIndexStart, TextureStart, VTPEndVTPStart label word datamark_v0 label word VTPDataArea 1, 1, 0, 0 VTPLayer 8, 1 ; Layer 8 with replace to eliminate the default shorelines in the LOD13 Area VTPNumTexturesInLayer 1, 0 VTPTextureId 4, 0 ; accessing the 5th color VTPPolyCount 1, 0 VTPPolyMethod2 31, 1, 0 VTPPolyMethod2Ex 4 VTPWidePoint 9265, 1, 11058, 0 VTPWidePointWidth 1 VTPWidePoint 9265, 1, 11058, 0 VTPWidePointWidth 64 ; Greater width VTPWidePoint 9265, 0, 11058, 0 VTPWidePoint 9275, 0, 11059, 0 VTPWidePoint 9307, 0, 11062, 0 VTPWidePoint 9333, 0, 11065, 0 VTPWidePoint 9347, 0, 11063, 0 VTPWidePoint 9356, 0, 11048, 0 VTPWidePoint 9336, 0, 11018, 0 VTPWidePoint 9307, 0, 11004, 0 VTPWidePoint 9275, 0, 10988, 0 VTPWidePoint 9243, 0, 10973, 0 VTPWidePoint 9231, 0, 10967, 0 VTPWidePoint 9243, 0, 10970, 0 VTPWidePoint 9275, 0, 10977, 0 VTPWidePoint 9307, 0, 10985, 0 VTPWidePoint 9339, 0, 10992, 0 VTPWidePoint 9371, 0, 10999, 0 VTPWidePoint 9395, 0, 11005, 0 VTPWidePoint 9405, 0, 10996, 0 VTPWidePoint 9435, 0, 10978, 0 VTPWidePoint 9457, 0, 10965, 0 VTPWidePoint 9466, 0, 10959, 0 VTPWidePoint 9498, 0, 10940, 0 VTPWidePoint 9510, 0, 10933, 0 VTPWidePoint 9530, 0, 10921, 0 VTPWidePoint 9562, 0, 10901, 0 VTPWidePoint 9563, 0, 10901, 0 VTPWidePoint 9594, 0, 10882, 0 VTPWidePoint 9616, 0, 10869, 0 VTPWidePoint 9626, 0, 10863, 0 VTPWidePoint 9658, 0, 10844, 0 VTPWidePoint 9669, 0, 10837, 0 VTPWidePoint 9690, 0, 10825, 0 VTPWidePoint 9699, 1, 10819, 0 VTPWidePointWidth 0 VTPDataArea 1, 1, 0, 0 VTPLayer 8, 0 ; Layer 8 with NO replace, now VTPNumTexturesInLayer 1, 0 VTPTextureId 4, 0 VTPPolyCount 1, 0 VTPPolyMethod2 5, 1, 0 VTPWidePoint 9620, 1, 10929, 0 VTPWidePointWidth 1 VTPWidePoint 9620, 1, 10929, 0 VTPWidePointWidth 64 VTPWidePoint 9620, 0, 10929, 0 VTPWidePoint 9577, 0, 10895, 0 VTPWidePoint 9559, 1, 10877, 0 VTPWidePointWidth 0 VTPDataArea 1, 1, 0, 0 VTPLayer 8, 0 ; again, Layer 8 with NO replace, now VTPNumTexturesInLayer 1, 0 VTPTextureId 4, 0 VTPPolyCount 1, 0 VTPPolyMethod2 4, 1, 0 VTPWidePoint 9559, 1, 10877, 0 VTPWidePointWidth 1 VTPWidePoint 9559, 1, 10877, 0 VTPWidePointWidth 64 VTPWidePoint 9559, 0, 10877, 0 VTPWidePoint 9505, 1, 10862, 0 VTPWidePointWidth 0 datamark_v1 label word; ---------------------------------------------------------------------------------------------------------Cellv_381_111 EQU VTPCellID 0, 381, 111; --------------------------------------------------------------------------------------------------------- VTPIndexStart label word VTPIndexHeader 1, VTPIndexData, VTPStart VTPIndexData label word VTPIndexEntry Cellv_381_111, VTPStart, datamark_v0, datamark_v1; ---------------------------------------------------------------------------------------------------------; Added 2 textures to the list for ocean shorelinesTextureStart label word VTPTextureListHeader 6, TextureIndexStart, TextureDataStart, TextureDataEndTextureIndexStart label word VTPTextureListEntry TextureDataStart, texturemark_0, texturemark_1 VTPTextureListEntry TextureDataStart, texturemark_1, texturemark_2 VTPTextureListEntry TextureDataStart, texturemark_2, texturemark_3 VTPTextureListEntry TextureDataStart, texturemark_3, texturemark_4 VTPTextureListEntry TextureDataStart, texturemark_4, texturemark_5 VTPTextureListEntry TextureDataStart, texturemark_5, texturemark_6TextureDataStart label word texturemark_0 label word VTPTextureName "1162" VTPTextureType 2, 0, 0, 4 texturemark_1 label word VTPTextureName "1158" VTPTextureType 2, 0, 0, 4 texturemark_2 label word VTPTextureName "1160" VTPTextureType 2, 0, 0, 4 texturemark_3 label word VTPTextureName "1131" VTPTextureType 2, 0, 0, 4 texturemark_4 label word VTPTextureName "1045" ; tan ocean shore with waves VTPTextureType 2, 0, 0, 4 texturemark_5 label word VTPTextureName "1054" ; tan ocean shore without waves VTPTextureType 2, 0, 0, 4 texturemark_6 label wordTextureDataEnd label word; ---------------------------------------------------------------------------------------------------------VTPEnd label wordNote the waves in the skinny section are wrong... you'll need to breakup the lines here, and use the non-wave texture.Read through 'terraintextures.cfg' in the main FS2002 folder.If this is Falco's resulting code... it looks good.If there is a restraint on the number of lines allowed, remember you can cut'n'paste segments of code together as they test OK, to eventually create one BGL.There is a rule for spanning multiple cells:Cells are in U,V order ( like x,y ), with U as Longitude, and V as Latitude.The cells need to be arranged in the index as latitudinal V bands, starting with V as 0, then V as 1, etc. in order.Within each V band, they need to be arranged in U order... U as 0, then U as 1, etc.so Cells 0,0...1,0...2,0...3,0....... Until the V band ( latitude ) is done. Then go on to the next V band Cells 0,1...1,1...2,1... until that V band is done.So watch the Cell index order when spanning cells.Within the cell, I haven't seen a problem, but you may wish to rearrage your LOD13 Area entries to follow the same rule. It may make a difference in Framerates or texture 'popping'. Area 0,0...1,0...2,0......then 0,1...1,1...2,1 completing each y band before moving south to the next band.Dick

Share this post


Link to post
Share on other sites
Guest

Hi Dick,It is interesting you are suggesting this because I had a similar idea today about the same thing! What I was thinking was something along the same lines as afcad which reads the fs coordinates and allows placement of objects. Unfortunately I have no idea as to how to implement this but I think the idea is excelent.Cheersjmf

Share this post


Link to post
Share on other sites
Guest falko

Hi David,the SCM2VTP program only reads the old style refpoints and does not like the backside of the world. This I will fix in the next days. In the meantime you can get the program to run if you change the FSSC RefPoint coordinates from W001: to W01: To get your roads loking like coasts you should increase the width of the road from 10 m to 63 m. The width is limited since only one byte is used for the width. In the ASM file you have to change the "VTPWidePointWidth 10" to "VTPWidePointWidth 63". Maybe also the "VTPLayer 31, 0" has to be changed to "VTPLayer 8, 0" since 8 is the layer number for coastlines, 31 is for minor roads, as allready mentioned by Dick.best regards Falko

Share this post


Link to post
Share on other sites
Guest

Hi,Why is it neccessary to define the first point of a polygon three times as you can see in the following example? . . .VTPWidePoint 9265, 1, 11058, 0 <--- firstVTPWidePointWidth 1 VTPWidePoint 9265, 1, 11058, 0 <--- secondVTPWidePointWidth 10VTPWidePoint 9265, 0, 11058, 0 <--- thirdVTPWidePoint 9275, 0, 11059, 0VTPWidePoint 9307, 0, 11062, 0VTPWidePoint 9333, 0, 11065, 0VTPWidePoint 9347, 0, 11063, 0VTPWidePoint 9356, 0, 11048, 0VTPWidePoint 9336, 0, 11018, 0VTPWidePoint 9307, 0, 11004, 0VTPWidePoint 9275, 0, 10988, 0 . . .Regards, Heinrich

Share this post


Link to post
Share on other sites
Guest

Hi Falko!I've tried your programm. Amazing!!!Thank you Falko!!! I never thought making FS2k2 roads could be so easy.By the way: Could you also write a new version that is compatible to the SCA-code by SCC2000 (Schiratti Commander)?Best regardsSasa

Share this post


Link to post
Share on other sites

Hi Heinrich.I think I can answer this.All lines in FS2002 need to start with a width of 1, but unless you want your line tapered like a snake at the end, you proably should repeat the Point with a larger width. The third Point may be redundant, but it does no harm.Dick

Share this post


Link to post
Share on other sites
Guest

Thank you Dick and Falko for your help, had a play last night and started getting somewhere.David

Share this post


Link to post
Share on other sites
Guest falko

Hi Dick.Until now I have'nt used FSUIPC so I had to read the FSUIPC-SDK to find out if it would be possible to read out the positions from FS2002. Duo to the SDK it should not be to hard. But before I start to do the overnext step I think I first shoul do the next and add an sorting routine to the program SCM2VTP so the cells will appear

Share this post


Link to post
Share on other sites

Hi Falko.You're right. You should not get distracted, now.I've uploaded TDFCalc3 to AVSIM's Library. It uses FSUIPC to obtain position and ground elevations accurately. Works very well. I use Delphi for my small programs, but they have included Visual Basic, C+, and assembler examples ( as well as Delphi ).I hope the work your program this weekend. It's looking very useful.Dick

Share this post


Link to post
Share on other sites
Guest falko

Hi Sasa.Thanks to Ricard Ludowise for his TDFmacros and his tutorial witch solves the mysterie about the FS2002 roads. To answer you question: The next version will read in the SCC-SCASM code.Best regards,Falko

Share this post


Link to post
Share on other sites
Guest

I downloaded your program today.I made some roads in Airport and exported to Scasm.Coordinates are N62:10 E6:05.This is the result:;---------------------------------------------------------------------------; SCASM file generated by Airport Freeware Version 2.6 Build 149 for FS 2002; TEST.SCA 17. oktober 2002 - 20:37:52;---------------------------------------------------------------------------; MagVar = 3.9;---------------------------------------------------------------------------Set( FSVERS 0x800 ) Header( 1 64.66667 59.66667 8.66667 3.66667 )LatRange( 59.66667 64.66667 )set( areamx 64 )Copyright( " [Freeware Version 2.6 Build 149]" ); Road 1Area( 5 62:10.36876 006:9.51044 10 ) LayerCall( :Taglayer 16 ) Jump( : ):Taglayer RefPoint( 7 :TagPoly 1 62:10.36876 006:9.51044 V1= 10000 V2= 5341 ) IfVarAnd( :TagRoad 028c 0004 ) Jump( :TagPoly ):TagRoad Monitor3d( :TagPoly -10000 10000 0 2000 -10000 10000 ) Bitmap( airpt001.oav 0 0 0 0 ) Smoothing( 1 ) RoadStart( -5 -2176 0 977 ) ; 1 RoadCont( 9 0 -263 ) ; 2 RoadCont( -1791 0 -1663 ) ; 3 RoadCont( 1714 0 -773 ) ; 4 RoadCont( 2409 0 737 ) ; 5 RoadCont( 459 0 -93 ) ; 6 RoadCont( -626 0 1077 ) ; 7 StartSurface MoveTo( 0 0 0 ) EndSurface Smoothing(0):TagPoly ReturnEndA;---------------------------------------------------------------------------But when I tried to convert to VTP2 I get an error messageand in the output.asm I get these values; Cellv_383_255 EQU VTPCellID 0, 383, 255.These should be 397, 79. What's wrong :-hmmm

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