Drawing tracks for live timing

Discussion in 'Plugins' started by DuRiN, Aug 26, 2013.

  1. DuRiN

    DuRiN Registered

    Joined:
    Oct 12, 2010
    Messages:
    44
    Likes Received:
    14
    Some time ago, Biker gave me the solution to draw the tracks from points. Now i have a tool to make the drawing in C# reading from the AIW file, but although i have give a thousand of thinkings over this file, dont know how to get the initial point (start position).

    Can anyone help me please?
     
  2. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,346
    Likes Received:
    6,572
    Each wp_pos is a position, with wp_perp giving you the direction.
     
  3. DuRiN

    DuRiN Registered

    Joined:
    Oct 12, 2010
    Messages:
    44
    Likes Received:
    14
    thx for reply Lazza. What i want to know is if there is something to remark what is the start point. I have made a routine in C# that draws tracks from wp_pos but cant find how the AIW says what is the initial point or start


    do you know what i mean?

    thx again!
     
  4. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,346
    Likes Received:
    6,572
    Ah lol

    As far as bringing it back to proper timing (sectors etc) use wp_score - it specifies the sector and the total lap distance to that point.

    You may also use WP_PTRS as a reference (first 2 values are previous and next waypoint, which gives a pretty good clue what the current one is ;)) but in rF1 at least there were a LOT of variations that sometimes made it tricky to draw a map if you relied on it. Unfortunately when a platform like rFactor allows people to experiment and still make it work, people feel a need to ditch the ISI examples and go their own way.

    But starting with those, and looking at the values in a couple of tracks, you should be able to cater for pretty much anything you find.
     
  5. DuRiN

    DuRiN Registered

    Joined:
    Oct 12, 2010
    Messages:
    44
    Likes Received:
    14
  6. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,346
    Likes Received:
    6,572
    Cool :)

    I did similar for a live timing page, had to wrestle with a few AIWs in rF1 especially with the pitlane (I've got dots representing all the cars), but can get it good enough. Must admit I haven't bothered with rF2, don't want to go there until the AIW is always available.
     
  7. sdecorme

    sdecorme Registered

    Joined:
    Mar 15, 2011
    Messages:
    6
    Likes Received:
    0
    Hi Lazza
    Do you share some code to read the aiw structure file, because I would like to draw the inner and outler track line .
    I would like draw the center line and extrapole the external line with the track width.
    Thanks
     
  8. SPASKIS

    SPASKIS Registered

    Joined:
    Sep 7, 2011
    Messages:
    3,155
    Likes Received:
    1,426
  9. DuRiN

    DuRiN Registered

    Joined:
    Oct 12, 2010
    Messages:
    44
    Likes Received:
    14
  10. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    @DuRiN
    Start to found "[Waypoint]"

    In the main loop read

    "wp_pos" //world Position (x,y,z) ; y is the Height!
    "wp_perp" // perpendicular vector (x,y,z)
    "wp_width" //width of track (road_left, road_right, far_left, far_right) read only road_left and road_right
    "WP_PTRS" //to control waypoints (prev_wp, next_wp, branch_id, pathbranch_wp) if pathbranch == 0 --> main path(track)

    Read Next waypoint the same way

    The vector calcs (in C# need to know how to use vectors)

    Road_left_pos= wp_pos + (-wp_perp*road_left)
    Road_right_pos= wp_pos + (wp_perp*road_right)

    With this points can create a shape.
     
  11. SPASKIS

    SPASKIS Registered

    Joined:
    Sep 7, 2011
    Messages:
    3,155
    Likes Received:
    1,426
    Thats exactly how I did it Mario.

    enviado mediante tapatalk
     
  12. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169

    You did I wrote. ;)
     
  13. DuRiN

    DuRiN Registered

    Joined:
    Oct 12, 2010
    Messages:
    44
    Likes Received:
    14
    thanks a lot mario and spaskis...i have developed an app for draw but not in your way to draw (i think yours is better...i will give a chance and try to get it) :)
     
  14. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    You use StreamGeometry in C#?
     
  15. DuRiN

    DuRiN Registered

    Joined:
    Oct 12, 2010
    Messages:
    44
    Likes Received:
    14
    didnt know about the existence of that class...i read the aiw looking for wp_pos and then painting circles to get a track...i will take a look to that class mate...thx!
     
  16. bandini

    bandini Registered

    Joined:
    May 7, 2014
    Messages:
    1
    Likes Received:
    0
    Hi SPASKIS,

    I've shown your work! I'm sure that you've wrote a script for this purpose, can you please post it??
    The language of your code will not be a problem, I've some experience with different languages.
    Just for info I will to write a script like yours (using Matlab), but I'm not confident with .aiw files.

    Thanks
     
  17. SPASKIS

    SPASKIS Registered

    Joined:
    Sep 7, 2011
    Messages:
    3,155
    Likes Received:
    1,426
    I didn't write any script. I made an excel file. Some posts before you can see the formulas that were used.

    enviado mediante tapatalk
     

Share This Page