Internal Plugins - TelemVect3 mPos [world position in meters]

Discussion in 'Plugins' started by B1K3R, Apr 7, 2013.

  1. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,602
    Likes Received:
    88
    Sorry for asking so many questions, but lack of specifications in Internal Plugins is killing me :(

    mPos, which contains x, y and z properties apparently indicate the world position in meters.

    My question is how to translate these values to draw them on the screen. I think they must be relative to something and I need to create some formula.

    Also, are the track maps provided by ISI or I need to make them?

    Thanks!!!

    Example values of one snap-shot:
     
  2. 64r

    64r Registered

    Joined:
    Jan 16, 2012
    Messages:
    191
    Likes Received:
    35
    There is no easy way of getting the ISI track map details, so you need to create a map yourself. Basically you collect a set of co-ordinates for a lap then you can save them to be used for every lap on that circuit. You can then plot the car position over the same co-ordinates.

    View attachment 7164
     
  3. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,602
    Likes Received:
    88
    Ah ok :) Thanks again mate! Wish I can buy you a beer :)
     
  4. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,602
    Likes Received:
    88
    Your concept worked perfectly ;) I threw 20 AI on Sebring track and they drew the map for me :) I still need to polish it but its great for a first run. Was done in minutes really.

    Cheers mate for your tip!
     
  5. DuRiN

    DuRiN Registered

    Joined:
    Oct 12, 2010
    Messages:
    36
    Likes Received:
    10
    Can your drivers draw for me too?lol

    I have been searching info for weeks in how to draw coordinates to get the track drawned and can't get it....any help please?
     
  6. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,602
    Likes Received:
    88
    Yes, for sure mate! I have the tool ready (demo: http://rfactor.stefanmizzi.com/DrawTrack.aspx)

    Let me know how can I help you :)
     
  7. DuRiN

    DuRiN Registered

    Joined:
    Oct 12, 2010
    Messages:
    36
    Likes Received:
    10
    oh mate, great job what i have seen on that link!...i have a particular hotlaps system for our website and i want to know how to draw the x, y and z coordinates to get a track layout (like you have said before)...i have search a lot of in "saint google", but the tree doesn let me see the forest :-(

    can you help me with this mate? if you dont understand something that i have wrote, please ask me! thx in advance!
     
  8. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,602
    Likes Received:
    88
    Thanks :) Yes, I'll help you no problem mate. I am not sure if my way is the best way, but it works

    Here it goes. So I have defined some variables for each track and save them in the database (or wherever you want)

    zoom_factor_x //this variable zooms in/out the x position. I use 0.3 to 0.4 roughly with 600px
    zoom_factor_y //this variable zooms in/out the y position. I use 0.3 to 0.4 roughly with 600px
    screen_height //map image height in pixels. eg 600px
    screen_width //map image width in pixels. eg 600px
    offsetX //this value moves the x co-ordinate to the left or right of the image. It can be +ve or -ve in pixels. usually is 0
    offsetY //this value moves the y co-ordinate up or down of the image. It can be +ve or -ve in pixels.

    I try some different values for each map as shown on my link.

    Then the formula to draw pixel on image/canvas is:

    //Posx is the value from the plugin
    //Posz is the value from the plugin


    screenX = zoom_factor_x * (Posx) + screen_width / 2 + offsetX;
    screenY = zoom_factor_y * (-.Posz) + screen_height / 2 + offsetY;

    NOTE! I am using Posz and not Posy from the plugin file.

    Hope this helps you. Let me know if you need more info :)
     
    Last edited by a moderator: May 3, 2013
  9. DuRiN

    DuRiN Registered

    Joined:
    Oct 12, 2010
    Messages:
    36
    Likes Received:
    10
    many thanks...now i must have to translate to my php to get the path draw correctly but this info is very worthy for me...thank you very much and ask me if you need something mate...

    again...thanks!
     
  10. DuRiN

    DuRiN Registered

    Joined:
    Oct 12, 2010
    Messages:
    36
    Likes Received:
    10
    [​IMG]

    yeah!!!!it works mate...!!!!!you are great mate!....
     
  11. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,602
    Likes Received:
    88
    I'm glad it worked :)
     
  12. fastorro

    fastorro Registered

    Joined:
    Oct 8, 2010
    Messages:
    79
    Likes Received:
    0
    Last edited by a moderator: May 10, 2013
  13. fastorro

    fastorro Registered

    Joined:
    Oct 8, 2010
    Messages:
    79
    Likes Received:
    0

Share This Page