Getting the 3d track path and road width.

Discussion in 'Plugins' started by dlecoutre, Mar 28, 2012.

  1. dlecoutre

    dlecoutre Registered

    Joined:
    Feb 15, 2012
    Messages:
    21
    Likes Received:
    0
    Hi,

    I need to implement something similar than the TrackMap plugin for our simulator, and I'd like to implement some other features on top of that. For that purpose I need to know the track path and road width. I found where to get the data point with rFactor1 ( "rFactor\GameData\Locations" ), it's in a text file, it's quite simple to read.
    For rFactor2, there is no GameData folder. I might have found it at this path "Documents\rFactor2\Installed\Locations\". All the files have a .mas extension. Are the files that I'm looking for at this location ? How do you extract the data points from this kind of file ?
    I'd like to get or compute the relative position of the car on the road ( e.g. the car is in the outside of the curve... The car in in the middle of the road... ) Is there a way to get the road width as well ?

    Thanks,
    David
     
  2. dlecoutre

    dlecoutre Registered

    Joined:
    Feb 15, 2012
    Messages:
    21
    Likes Received:
    0
    I figured out few things. The track map is in the *.AIW files, and the track name is in the corresponding *.gdb files. With this two files I can figure out which map to load.
    For rFactor2, I had to extract the *.aiw and *.gdb with the mas extractor.

    I'm not sure yet if I can automatize that process from the plugin... I still have to figure out how to compute the track width.
     
  3. blakboks

    blakboks Registered

    Joined:
    Oct 20, 2010
    Messages:
    843
    Likes Received:
    30
    You might be able to figure out the track width from the corridors in the .AIW. I think it measures the legal track width (both left and right) at each waypoint off the center-line, and the illegal terrain (i.e. grass, runoff areas, etc.). Sorry, I don't have much more information than that at the moment. I'm not at my home computer to check it out, either.
     
  4. dlecoutre

    dlecoutre Registered

    Joined:
    Feb 15, 2012
    Messages:
    21
    Likes Received:
    0
    Thanks, I found it. In the *.aiw file, look for the variables "wp_width", it gives the road width in meters. You can compute the x,y,z coordinate of the borders by using "wp_pos" value and the perpendicular vector of the road called wp_perp.
    e.g. for the left border :
    Code:
    Point3D leftBorder = wp_pos - wp_perp.scale(wp_width[0]) 
    The file provide usually 600 points per track. It's more than enough to generate a nice map.
     
  5. Darrter

    Darrter Registered

    Joined:
    Jun 26, 2013
    Messages:
    15
    Likes Received:
    0
    Hey,
    I know the thready is somewhat old, i wold like to know, if there is a way to extract the *.AIW file from the *.MAS.
    Can i all the call the MAS2.exe with some parameters to do that?
     

Share This Page